public final class SchemaBuilderImpl extends Object implements SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>
| Constructor and Description |
|---|
SchemaBuilderImpl(JCodeModel codeModel) |
| Modifier and Type | Method and Description |
|---|---|
Leaf |
annotate(Leaf leaf,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations)
Called when annotation is found right inside a pattern
such as,
|
Leaf |
annotateAfter(Leaf leaf,
ParsedElementAnnotation parsedElementAnnotation)
Called when element annotation is found after a pattern.
|
Leaf |
commentAfter(Leaf leaf,
CommentListImpl commentList) |
Leaf |
expandPattern(Leaf leaf)
Called after all the parsing is done.
|
NameClassBuilder |
getNameClassBuilder()
Returns the
NameClassBuilder, which is used to build name
classes for this SchemaBuilder. |
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl |
makeAnnotations(CommentListImpl commentList,
Context context)
Creates
Annotations object to parse annotations on patterns. |
Leaf |
makeAttribute(NameClass nameClass,
Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeChoice(List<Leaf> leaves,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
CommentListImpl |
makeCommentList() |
DataPatternBuilder |
makeDataPatternBuilder(String datatypeLibrary,
String type,
LocatorImpl locator) |
Leaf |
makeElement(NameClass nameClass,
Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
ElementAnnotationBuilder<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> |
makeElementAnnotationBuilder(String ns,
String localName,
String prefix,
LocatorImpl locator,
CommentListImpl commentList,
Context context) |
Leaf |
makeEmpty(LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeErrorPattern() |
Leaf |
makeExternalRef(Parseable current,
String uri,
String ns,
Scope<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> scope,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> |
makeGrammar(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> scope) |
Leaf |
makeGroup(List<Leaf> leaves,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeInterleave(List<Leaf> leaves,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeList(Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
LocatorImpl |
makeLocation(String systemId,
int lineNumber,
int columnNumber) |
Leaf |
makeMixed(Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeNotAllowed(LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeOneOrMore(Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeOptional(Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeText(LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeValue(String datatypeLibrary,
String type,
String value,
Context c,
String ns,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
Leaf |
makeZeroOrMore(Leaf leaf,
LocatorImpl locator,
com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) |
boolean |
usesComments()
If this
SchemaBuilderis interested in actually parsing
comments, this method returns true. |
public SchemaBuilderImpl(JCodeModel codeModel)
public Leaf expandPattern(Leaf leaf) throws BuildException
SchemaBuilder
This hook typically allows as SchemaBuilder to expand
notAllowed (if it's following the simplification as in the spec.)
expandPattern in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic NameClassBuilder getNameClassBuilder() throws BuildException
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 SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeChoice(List<Leaf> leaves, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeChoice in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeInterleave(List<Leaf> leaves, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeInterleave in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeGroup(List<Leaf> leaves, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeGroup in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeOneOrMore(Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeOneOrMore in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeZeroOrMore(Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeZeroOrMore in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeOptional(Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeOptional in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeList(Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeList in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeMixed(Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeMixed in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeEmpty(LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations)
makeEmpty in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public Leaf makeNotAllowed(LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations)
makeNotAllowed in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public Leaf makeText(LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations)
makeText in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeAttribute in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeElement(NameClass nameClass, Leaf leaf, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeElement in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl locator) throws BuildException
makeDataPatternBuilder in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
makeValue in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> makeGrammar(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> scope)
makeGrammar in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>scope - 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 Leaf annotate(Leaf leaf, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException
SchemaBuilder
<element name="foo"> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'A' -->
...
</element>
annotate in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf annotateAfter(Leaf leaf, ParsedElementAnnotation parsedElementAnnotation) throws BuildException
SchemaBuilder
<element name="foo">
<empty /> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'E' -->
</element>
annotateAfter in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionpublic Leaf makeErrorPattern()
makeErrorPattern in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public 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 SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public Leaf makeExternalRef(Parseable current, String uri, String ns, Scope<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> scope, LocatorImpl locator, com.sun.tools.txw2.builder.relaxng.AnnotationsImpl annotations) throws BuildException, IllegalSchemaException
makeExternalRef in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>current - 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.BuildExceptionIllegalSchemaExceptionpublic LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber)
makeLocation in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public com.sun.tools.txw2.builder.relaxng.AnnotationsImpl makeAnnotations(CommentListImpl commentList, Context context)
SchemaBuilderAnnotations object to parse annotations on patterns.makeAnnotations in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public ElementAnnotationBuilder<Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl> makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl locator, CommentListImpl commentList, Context context)
makeElementAnnotationBuilder in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public CommentListImpl makeCommentList()
makeCommentList in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>public Leaf commentAfter(Leaf leaf, CommentListImpl commentList) throws BuildException
commentAfter in interface SchemaBuilder<NameClass,Leaf,ParsedElementAnnotation,LocatorImpl,com.sun.tools.txw2.builder.relaxng.AnnotationsImpl,CommentListImpl>BuildExceptionCopyright © 2017 Oracle Corporation. All rights reserved.