public class DSchemaBuilderImpl extends Object implements SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
Constructor and Description |
---|
DSchemaBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
DPattern |
annotate(DPattern p,
com.sun.tools.rngom.digested.Annotation anno)
Called when annotation is found right inside a pattern
such as,
|
DPattern |
annotateAfter(DPattern p,
com.sun.tools.rngom.digested.ElementWrapper e)
Called when element annotation is found after a pattern.
|
DPattern |
commentAfter(DPattern p,
com.sun.tools.rngom.digested.CommentListImpl comments) |
DPattern |
expandPattern(DPattern p)
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.rngom.digested.Annotation |
makeAnnotations(com.sun.tools.rngom.digested.CommentListImpl comments,
Context context)
Creates
Annotations object to parse annotations on patterns. |
DPattern |
makeAttribute(NameClass nc,
DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeChoice(List<DPattern> patterns,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
com.sun.tools.rngom.digested.CommentListImpl |
makeCommentList() |
DataPatternBuilder |
makeDataPatternBuilder(String datatypeLibrary,
String type,
LocatorImpl loc) |
DPattern |
makeElement(NameClass nc,
DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
ElementAnnotationBuilder |
makeElementAnnotationBuilder(String ns,
String localName,
String prefix,
LocatorImpl loc,
com.sun.tools.rngom.digested.CommentListImpl comments,
Context context) |
DPattern |
makeEmpty(LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeErrorPattern() |
DPattern |
makeExternalRef(Parseable current,
String uri,
String ns,
Scope<DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl> scope,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
Grammar |
makeGrammar(Scope parent) |
DPattern |
makeGroup(List<DPattern> patterns,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeInterleave(List<DPattern> patterns,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeList(DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
LocatorImpl |
makeLocation(String systemId,
int lineNumber,
int columnNumber) |
DPattern |
makeMixed(DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeNotAllowed(LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeOneOrMore(DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeOptional(DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeText(LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeValue(String datatypeLibrary,
String type,
String value,
Context c,
String ns,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
DPattern |
makeZeroOrMore(DPattern p,
LocatorImpl loc,
com.sun.tools.rngom.digested.Annotation anno) |
boolean |
usesComments()
If this
SchemaBuilder is interested in actually parsing
comments, this method returns true. |
public NameClassBuilder getNameClassBuilder() throws BuildException
SchemaBuilder
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.getNameClassBuilder
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeChoice(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeChoice
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeInterleave(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeInterleave
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeGroup(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeGroup
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeOneOrMore(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeOneOrMore
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeZeroOrMore(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeZeroOrMore
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeOptional(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeOptional
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeList(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeList
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeMixed(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeMixed
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeEmpty(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno)
makeEmpty
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public DPattern makeNotAllowed(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno)
makeNotAllowed
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public DPattern makeText(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno)
makeText
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public DPattern makeAttribute(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeAttribute
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeElement(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeElement
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl loc) throws BuildException
makeDataPatternBuilder
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
makeValue
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public Grammar makeGrammar(Scope parent)
makeGrammar
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
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.public DPattern annotate(DPattern p, com.sun.tools.rngom.digested.Annotation anno) throws BuildException
SchemaBuilder
<element name="foo"> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'A' -->
...
</element>
annotate
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern annotateAfter(DPattern p, com.sun.tools.rngom.digested.ElementWrapper e) throws BuildException
SchemaBuilder
<element name="foo">
<empty /> <!-- this becomes 'P' -->
<foreign:annotation /> <!-- this becomes 'E' -->
</element>
annotateAfter
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern commentAfter(DPattern p, com.sun.tools.rngom.digested.CommentListImpl comments) throws BuildException
commentAfter
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
public DPattern makeExternalRef(Parseable current, String uri, String ns, Scope<DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl> scope, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException, IllegalSchemaException
makeExternalRef
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.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.BuildException
IllegalSchemaException
public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber)
makeLocation
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public com.sun.tools.rngom.digested.Annotation makeAnnotations(com.sun.tools.rngom.digested.CommentListImpl comments, Context context)
SchemaBuilder
Annotations
object to parse annotations on patterns.makeAnnotations
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, com.sun.tools.rngom.digested.CommentListImpl comments, Context context)
makeElementAnnotationBuilder
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public com.sun.tools.rngom.digested.CommentListImpl makeCommentList()
makeCommentList
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public DPattern makeErrorPattern()
makeErrorPattern
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public boolean usesComments()
SchemaBuilder
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.
usesComments
in interface SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
public DPattern expandPattern(DPattern p) 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 SchemaBuilder<NameClass,DPattern,com.sun.tools.rngom.digested.ElementWrapper,LocatorImpl,com.sun.tools.rngom.digested.Annotation,com.sun.tools.rngom.digested.CommentListImpl>
BuildException
IllegalSchemaException
Copyright © 2019 JBoss by Red Hat. All rights reserved.