public interface SchemaBuilder<N extends ParsedNameClass,P extends ParsedPattern,E extends ParsedElementAnnotation,L extends Location,A extends Annotations<E,L,CL>,CL extends CommentList<L>>
| Modifier and Type | Method and Description |
|---|---|
P |
annotate(P p,
A anno)
Called when annotation is found right inside a pattern
such as,
|
P |
annotateAfter(P p,
E e)
Called when element annotation is found after a pattern.
|
P |
commentAfter(P p,
CL comments) |
P |
expandPattern(P p)
Called after all the parsing is done.
|
NameClassBuilder<N,E,L,A,CL> |
getNameClassBuilder()
Returns the
NameClassBuilder, which is used to build name
classes for this SchemaBuilder. |
A |
makeAnnotations(CL comments,
Context context)
Creates
Annotations object to parse annotations on patterns. |
P |
makeAttribute(N nc,
P p,
L loc,
A anno) |
P |
makeChoice(List<P> patterns,
L loc,
A anno) |
CL |
makeCommentList() |
DataPatternBuilder |
makeDataPatternBuilder(String datatypeLibrary,
String type,
L loc) |
P |
makeElement(N nc,
P p,
L loc,
A anno) |
ElementAnnotationBuilder<P,E,L,A,CL> |
makeElementAnnotationBuilder(String ns,
String localName,
String prefix,
L loc,
CL comments,
Context context) |
P |
makeEmpty(L loc,
A anno) |
P |
makeErrorPattern() |
P |
makeExternalRef(Parseable current,
String uri,
String ns,
Scope<P,E,L,A,CL> scope,
L loc,
A anno) |
Grammar<P,E,L,A,CL> |
makeGrammar(Scope<P,E,L,A,CL> parent) |
P |
makeGroup(List<P> patterns,
L loc,
A anno) |
P |
makeInterleave(List<P> patterns,
L loc,
A anno) |
P |
makeList(P p,
L loc,
A anno) |
L |
makeLocation(String systemId,
int lineNumber,
int columnNumber) |
P |
makeMixed(P p,
L loc,
A anno) |
P |
makeNotAllowed(L loc,
A anno) |
P |
makeOneOrMore(P p,
L loc,
A anno) |
P |
makeOptional(P p,
L loc,
A anno) |
P |
makeText(L loc,
A anno) |
P |
makeValue(String datatypeLibrary,
String type,
String value,
Context c,
String ns,
L loc,
A anno) |
P |
makeZeroOrMore(P p,
L loc,
A anno) |
boolean |
usesComments()
If this
SchemaBuilderis interested in actually parsing
comments, this method returns true. |
NameClassBuilder<N,E,L,A,CL> getNameClassBuilder() throws BuildException
NameClassBuilder, 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.BuildExceptionP makeChoice(List<P> patterns, L loc, A anno) throws BuildException
BuildExceptionP makeInterleave(List<P> patterns, L loc, A anno) throws BuildException
BuildExceptionP makeGroup(List<P> patterns, L loc, A anno) throws BuildException
BuildExceptionP makeOneOrMore(P p, L loc, A anno) throws BuildException
BuildExceptionP makeZeroOrMore(P p, L loc, A anno) throws BuildException
BuildExceptionP makeOptional(P p, L loc, A anno) throws BuildException
BuildExceptionP makeList(P p, L loc, A anno) throws BuildException
BuildExceptionP makeMixed(P p, L loc, A anno) throws BuildException
BuildExceptionP makeAttribute(N nc, P p, L loc, A anno) throws BuildException
BuildExceptionP makeElement(N nc, P p, L loc, A anno) throws BuildException
BuildExceptionDataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, L loc) throws BuildException
BuildExceptionP makeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno) throws BuildException
BuildExceptionGrammar<P,E,L,A,CL> makeGrammar(Scope<P,E,L,A,CL> parent)
parent - 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.P annotate(P p, A anno) throws BuildException
<element name="foo"> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'A' -->
...
</element>
BuildExceptionP annotateAfter(P p, E e) throws BuildException
<element name="foo">
<empty /> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'E' -->
</element>
BuildExceptionP commentAfter(P p, CL comments) throws BuildException
BuildExceptionP makeExternalRef(Parseable current, String uri, String ns, Scope<P,E,L,A,CL> scope, L loc, A anno) throws BuildException, IllegalSchemaException
current - Current grammar that we are parsing. This is what contains
externalRef.scope - The parent scope. null if there's no parent scope.
See makeGrammar(Scope) for more details about
when this parameter can be null.BuildExceptionIllegalSchemaExceptionA makeAnnotations(CL comments, Context context)
Annotations object to parse annotations on patterns.ElementAnnotationBuilder<P,E,L,A,CL> makeElementAnnotationBuilder(String ns, String localName, String prefix, L loc, CL comments, Context context)
CL makeCommentList()
P makeErrorPattern()
boolean usesComments()
SchemaBuilderis 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.
P expandPattern(P p) throws BuildException, IllegalSchemaException
This hook typically allows as SchemaBuilder to expand
notAllowed (if it's following the simplification as in the spec.)
BuildExceptionIllegalSchemaExceptionCopyright © 2018 JBoss by Red Hat. All rights reserved.