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 (kk@kohsuke.org)
-
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 thisSchemaBuilder.com.sun.tools.rngom.digested.AnnotationmakeAnnotations(com.sun.tools.rngom.digested.CommentListImpl comments, Context context) CreatesAnnotationsobject 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.CommentListImplmakeDataPatternBuilder(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) booleanIf thisSchemaBuilderis interested in actually parsing comments, this method returns true.
-
Constructor Details
-
DSchemaBuilderImpl
public DSchemaBuilderImpl()
-
-
Method Details
-
getNameClassBuilder
Description copied from interface:SchemaBuilderReturns theNameClassBuilder, which is used to build name classes for thisSchemaBuilder. TheNameClasses that are built will then be fed into thisSchemaBuilderto further build RELAX NG patterns.- Specified by:
getNameClassBuilderin 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:
makeChoicein 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:
makeInterleavein 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:
makeGroupin 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:
makeOneOrMorein 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:
makeZeroOrMorein 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:
makeOptionalin 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:
makeListin 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:
makeMixedin 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:
makeEmptyin 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:
makeNotAllowedin 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:
makeTextin 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:
makeAttributein 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:
makeElementin 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:
makeDataPatternBuilderin 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:
makeValuein 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:
makeGrammarin 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>Grammaris created, it will receive thenullparent.
-
annotate
public DPattern annotate(DPattern p, com.sun.tools.rngom.digested.Annotation anno) throws BuildException Description copied from interface:SchemaBuilderCalled when annotation is found right inside a pattern such as,<element name="foo"> <!-- this becomes 'P' --> <foreign:annotation /> <!-- this becomes 'A' --> ... </element>- Specified by:
annotatein 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:SchemaBuilderCalled 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:
annotateAfterin 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:
commentAfterin 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:
makeExternalRefin 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:
BuildExceptionIllegalSchemaException
-
makeLocation
- Specified by:
makeLocationin 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:SchemaBuilderCreatesAnnotationsobject to parse annotations on patterns.- Specified by:
makeAnnotationsin 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:
makeElementAnnotationBuilderin 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:
makeCommentListin 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:
makeErrorPatternin 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:SchemaBuilderIf thisSchemaBuilderis 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:
usesCommentsin 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:SchemaBuilderCalled after all the parsing is done.This hook typically allows as
SchemaBuilderto expand notAllowed (if it's following the simplification as in the spec.)- Specified by:
expandPatternin interfaceSchemaBuilder<NameClass,DPattern, com.sun.tools.rngom.digested.ElementWrapper, LocatorImpl, com.sun.tools.rngom.digested.Annotation, com.sun.tools.rngom.digested.CommentListImpl> - Throws:
BuildExceptionIllegalSchemaException
-