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
SchemaBuilder is 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
NameClass
es that are built will then be
fed into this SchemaBuilder
to further build RELAX NG patterns.BuildException
P makeChoice(List<P> patterns, L loc, A anno) throws BuildException
BuildException
P makeInterleave(List<P> patterns, L loc, A anno) throws BuildException
BuildException
P makeGroup(List<P> patterns, L loc, A anno) throws BuildException
BuildException
P makeOneOrMore(P p, L loc, A anno) throws BuildException
BuildException
P makeZeroOrMore(P p, L loc, A anno) throws BuildException
BuildException
P makeOptional(P p, L loc, A anno) throws BuildException
BuildException
P makeList(P p, L loc, A anno) throws BuildException
BuildException
P makeMixed(P p, L loc, A anno) throws BuildException
BuildException
P makeAttribute(N nc, P p, L loc, A anno) throws BuildException
BuildException
P makeElement(N nc, P p, L loc, A anno) throws BuildException
BuildException
DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, L loc) throws BuildException
BuildException
P makeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno) throws BuildException
BuildException
Grammar<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>
BuildException
P annotateAfter(P p, E e) throws BuildException
<element name="foo">
<empty /> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'E' -->
</element>
BuildException
P commentAfter(P p, CL comments) throws BuildException
BuildException
P 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.BuildException
IllegalSchemaException
A 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()
SchemaBuilder
is 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.)
BuildException
IllegalSchemaException
Copyright © 2019 JBoss by Red Hat. All rights reserved.