Package com.sun.tools.rngom.digested
Class DSchemaBuilderImpl
java.lang.Object
com.sun.tools.rngom.digested.DSchemaBuilderImpl
- All Implemented Interfaces:
SchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
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>
- Author:
- Kohsuke Kawaguchi ([email protected])
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalled when annotation is found right inside a pattern such as,annotateAfter
(DPattern p, com.sun.tools.rngom.digested.ElementWrapper e) Called when element annotation is found after a pattern.commentAfter
(DPattern p, com.sun.tools.rngom.digested.CommentListImpl comments) Called after all the parsing is done.Returns theNameClassBuilder
, which is used to build name classes for this .com.sun.tools.rngom.digested.Annotation
makeAnnotations
(com.sun.tools.rngom.digested.CommentListImpl comments, Context context) CreatesAnnotations
object to parse annotations on patterns.makeAttribute
(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeChoice
(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) com.sun.tools.rngom.digested.CommentListImpl
makeDataPatternBuilder
(String datatypeLibrary, String type, LocatorImpl loc) makeElement
(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeElementAnnotationBuilder
(String ns, String localName, String prefix, LocatorImpl loc, com.sun.tools.rngom.digested.CommentListImpl comments, Context context) makeEmpty
(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) 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) makeGrammar
(Scope parent) makeGroup
(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeInterleave
(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeList
(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeLocation
(String systemId, int lineNumber, int columnNumber) makeMixed
(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeNotAllowed
(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeOneOrMore
(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeOptional
(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeText
(LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeValue
(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) makeZeroOrMore
(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) boolean
If this is interested in actually parsing comments, this method returns true.
-
Constructor Details
-
DSchemaBuilderImpl
public DSchemaBuilderImpl()
-
-
Method Details
-
getNameClassBuilder
Description copied from interface:SchemaBuilder
Returns theNameClassBuilder
, which is used to build name classes for this . TheNameClass
es that are built will then be fed into this to further build RELAX NG patterns.- Specified by:
getNameClassBuilder
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Returns:
- always return a non-null valid object. This method can (and probably should) always return the same object.
- Throws:
BuildException
-
makeChoice
public DPattern makeChoice(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeChoice
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeInterleave
public DPattern makeInterleave(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeInterleave
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeGroup
public DPattern makeGroup(List<DPattern> patterns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeGroup
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeOneOrMore
public DPattern makeOneOrMore(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeOneOrMore
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeZeroOrMore
public DPattern makeZeroOrMore(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeZeroOrMore
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeOptional
public DPattern makeOptional(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeOptional
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeList
public DPattern makeList(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeList
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeMixed
public DPattern makeMixed(DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeMixed
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeEmpty
- Specified by:
makeEmpty
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeNotAllowed
- Specified by:
makeNotAllowed
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeText
- Specified by:
makeText
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeAttribute
public DPattern makeAttribute(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeAttribute
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeElement
public DPattern makeElement(NameClass nc, DPattern p, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeElement
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeDataPatternBuilder
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl loc) throws BuildException - Specified by:
makeDataPatternBuilder
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeValue
public DPattern makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) throws BuildException - Specified by:
makeValue
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeGrammar
- Specified by:
makeGrammar
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Parameters:
parent
- The parent scope. null if there's no parent scope. For example, if the complete document looks like the following:
Then when the outer-most<grammar> <start><element name="root"><empty/></element></start> </grammar>
Grammar
is created, it will receive thenull
parent.
-
annotate
public DPattern annotate(DPattern p, com.sun.tools.rngom.digested.Annotation anno) throws BuildException Description copied from interface:SchemaBuilder
Called when annotation is found right inside a pattern such as,<element name="foo"> <!-- this becomes 'P' --> <foreign:annotation /> <!-- this becomes 'A' --> ... </element>
- Specified by:
annotate
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
annotateAfter
public DPattern annotateAfter(DPattern p, com.sun.tools.rngom.digested.ElementWrapper e) throws BuildException Description copied from interface:SchemaBuilder
Called when element annotation is found after a pattern. such as,<element name="foo"> <empty /> <!-- this becomes 'P' --> <foreign:annotation /> <!-- this becomes 'E' --> </element>
- Specified by:
annotateAfter
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
commentAfter
public DPattern commentAfter(DPattern p, com.sun.tools.rngom.digested.CommentListImpl comments) throws BuildException - Specified by:
commentAfter
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
-
makeExternalRef
public DPattern makeExternalRef(Parseable current, String uri, String ns, Scope<DPattern, com.sun.tools.rngom.digested.ElementWrapper, throws BuildException, IllegalSchemaExceptionLocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> scope, LocatorImpl loc, com.sun.tools.rngom.digested.Annotation anno) - Specified by:
makeExternalRef
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Parameters:
current
- Current grammar that we are parsing. This is what contains externalRef.scope
- The parent scope. null if there's no parent scope. SeeSchemaBuilder.makeGrammar(Scope)
for more details about when this parameter can be null.- Throws:
BuildException
IllegalSchemaException
-
makeLocation
- Specified by:
makeLocation
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeAnnotations
public com.sun.tools.rngom.digested.Annotation makeAnnotations(com.sun.tools.rngom.digested.CommentListImpl comments, Context context) Description copied from interface:SchemaBuilder
CreatesAnnotations
object to parse annotations on patterns.- Specified by:
makeAnnotations
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Returns:
- must be non-null.
-
makeElementAnnotationBuilder
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, com.sun.tools.rngom.digested.CommentListImpl comments, Context context) - Specified by:
makeElementAnnotationBuilder
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeCommentList
public com.sun.tools.rngom.digested.CommentListImpl makeCommentList()- Specified by:
makeCommentList
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
makeErrorPattern
- Specified by:
makeErrorPattern
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
usesComments
public boolean usesComments()Description copied from interface:SchemaBuilder
If this 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.
- Specified by:
usesComments
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl>
-
expandPattern
Description copied from interface:SchemaBuilder
Called after all the parsing is done.This hook typically allows as to expand notAllowed (if it's following the simplification as in the spec.)
- Specified by:
expandPattern
in interfaceSchemaBuilder<NameClass,
DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildException
IllegalSchemaException
-