Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to customize SchemaPatternBuilder in SchemaReaderImpl? #275

Open
angelozerr opened this issue Oct 12, 2022 · 0 comments
Open

How to customize SchemaPatternBuilder in SchemaReaderImpl? #275

angelozerr opened this issue Oct 12, 2022 · 0 comments

Comments

@angelozerr
Copy link

I need to create my own SchemaPatternBuilder in

SchemaPatternBuilder spb = new SchemaPatternBuilder();
because the default SchemaPatternBuilder create ElementPattern, AttributePattern with a shared locator.

When the parse is done all locator for all pattern are false because they share the same locator (for validation it is enough, but in my case I need to get the proper locator after the parse is done.

That's why I extend SchemaPatternBuilder to copy locator.

How to customize SchemaPatternBuilder in SchemaReaderImpl?

To fix this problem I create my own SchemaReaderImpl and I do:

SchemaPatternBuilder spb = properties.get(SCHEMA_PATTERN_BUILDER);
if (spb == null) {
	spb = new SchemaPatternBuilder();
}

If you like the idea, I could create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant