public class SchemaBuilderImpl extends Object implements SchemaBuilder, ElementAnnotationBuilder, CommentList
| Constructor and Description |
|---|
SchemaBuilderImpl(ErrorHandler eh) |
SchemaBuilderImpl(ErrorHandler eh,
com.sun.tools.rngdatatype.DatatypeLibraryFactory datatypeLibraryFactory,
SchemaPatternBuilder pb) |
public SchemaBuilderImpl(ErrorHandler eh)
eh - Error handler to receive errors while building the schema.public SchemaBuilderImpl(ErrorHandler eh, com.sun.tools.rngdatatype.DatatypeLibraryFactory datatypeLibraryFactory, SchemaPatternBuilder pb)
eh - Error handler to receive errors while building the schema.datatypeLibraryFactory - This is consulted to locate datatype
libraries.pb - Used to build patterns.public ParsedPattern expandPattern(ParsedPattern _pattern) throws BuildException, IllegalSchemaException
SchemaBuilder
This hook typically allows as SchemaBuilder to expand
notAllowed (if it's following the simplification as in the spec.)
expandPattern in interface SchemaBuilderBuildExceptionIllegalSchemaExceptionpublic NameClassBuilder getNameClassBuilder()
SchemaBuilderNameClassBuilder, which is used to build name
classes for this SchemaBuilder. The
NameClasses that are built will then be
fed into this SchemaBuilderto further build RELAX NG patterns.getNameClassBuilder in interface SchemaBuilderpublic ParsedPattern makeChoice(List patterns, Location loc, Annotations anno) throws BuildException
makeChoice in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeInterleave(List patterns, Location loc, Annotations anno) throws BuildException
makeInterleave in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeGroup(List patterns, Location loc, Annotations anno) throws BuildException
makeGroup in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeOneOrMore(ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeOneOrMore in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeZeroOrMore(ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeZeroOrMore in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeOptional(ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeOptional in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeList(ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeList in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeMixed(ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeMixed in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeEmpty(Location loc, Annotations anno)
makeEmpty in interface SchemaBuilderpublic ParsedPattern makeNotAllowed(Location loc, Annotations anno)
makeNotAllowed in interface SchemaBuilderpublic ParsedPattern makeText(Location loc, Annotations anno)
makeText in interface SchemaBuilderpublic ParsedPattern makeErrorPattern()
makeErrorPattern in interface SchemaBuilderpublic ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeAttribute in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeElement(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) throws BuildException
makeElement in interface SchemaBuilderBuildExceptionpublic DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location loc) throws BuildException
makeDataPatternBuilder in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context context, String ns, Location loc, Annotations anno) throws BuildException
makeValue in interface SchemaBuilderBuildExceptionpublic Grammar makeGrammar(Scope parent)
makeGrammar in interface SchemaBuilderparent - The parent scope. null if there's no parent scope.
For example, if the complete document looks like the following:
<grammar>
<start><element name="root"><empty/></element></start>
</grammar>
Then when the outer-most Grammar is created, it will
receive the null parent.public ParsedPattern annotate(ParsedPattern p, Annotations anno) throws BuildException
SchemaBuilder
<element name="foo"> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'A' -->
...
</element>
annotate in interface SchemaBuilderBuildExceptionpublic ParsedPattern annotateAfter(ParsedPattern p, ParsedElementAnnotation e) throws BuildException
SchemaBuilder
<element name="foo">
<empty /> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'E' -->
</element>
annotateAfter in interface SchemaBuilderBuildExceptionpublic ParsedPattern commentAfter(ParsedPattern p, CommentList comments) throws BuildException
commentAfter in interface SchemaBuilderBuildExceptionpublic ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope scope, Location loc, Annotations anno) throws BuildException
makeExternalRef in interface SchemaBuildercurrent - Current grammar that we are parsing. This is what contains
externalRef.scope - The parent scope. null if there's no parent scope.
See SchemaBuilder.makeGrammar(Scope) for more details about
when this parameter can be null.BuildExceptionpublic Location makeLocation(String systemId, int lineNumber, int columnNumber)
makeLocation in interface SchemaBuilderpublic Annotations makeAnnotations(CommentList comments, Context context)
SchemaBuilderAnnotations object to parse annotations on patterns.makeAnnotations in interface SchemaBuilderpublic ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, Location loc, CommentList comments, Context context)
makeElementAnnotationBuilder in interface SchemaBuilderpublic CommentList makeCommentList()
makeCommentList in interface SchemaBuilderpublic void addComment(String value, Location loc) throws BuildException
addComment in interface CommentListBuildExceptionpublic void addAttribute(String ns, String localName, String prefix, String value, Location loc)
AnnotationsaddAttribute in interface Annotationspublic void addElement(ParsedElementAnnotation ea)
AnnotationsaddElement in interface Annotationspublic void addComment(CommentList comments) throws BuildException
AnnotationsaddComment in interface AnnotationsBuildExceptionpublic void addLeadingComment(CommentList comments) throws BuildException
addLeadingComment in interface AnnotationsBuildExceptionpublic ParsedElementAnnotation makeElementAnnotation()
ElementAnnotationBuildermakeElementAnnotation in interface ElementAnnotationBuilderpublic void addText(String value, Location loc, CommentList comments) throws BuildException
ElementAnnotationBuilderaddText in interface ElementAnnotationBuilderBuildExceptionpublic boolean usesComments()
SchemaBuilderSchemaBuilderis interested in actually parsing
comments, this method returns true.
Returning false allows the schema parser to speed up the processing by skiping comment-related handlings.
usesComments in interface SchemaBuilderCopyright © 2019 JBoss by Red Hat. All rights reserved.