relaxng / jing-trang

Schema validation and conversion based on RELAX NG
http://www.thaiopensource.com/relaxng/
Other
228 stars 69 forks source link

Why com.thaiopensource.relaxng.pattern.ElementPattern is not public? #271

Open angelozerr opened 2 years ago

angelozerr commented 2 years ago

I'm implementing a custom pattern function which implements PatternFunction to visit pattern (element, attributes, etc pattern) to support XML completion based on RelaxNG similar to https://github.com/relaxng/jing-trang/blob/master/mod/pattern/src/main/com/thaiopensource/relaxng/pattern/DefaultValuesExtractor.java but I need to create my class in the com.thaiopensource.relaxng.pattern package because all classes which extends Pattern are not public https://github.com/relaxng/jing-trang/blob/84ec6ad578d6e0a77342baa5427851f98028bfd8/mod/pattern/src/main/com/thaiopensource/relaxng/pattern/ElementPattern.java#L6

I wonder why there is this restriction? Is it possible to add a public modifier for ElementPattern and other classes?

ndw commented 2 years ago

I'm not aware of any compelling reason for them not to be public.

angelozerr commented 2 years ago

Thanks @ndw for your answer. I will create a PR to fix this issue.