Package com.sun.tools.rngom.ast.builder
Interface SchemaBuilder<N extends ParsedNameClass,P extends ParsedPattern,E extends ParsedElementAnnotation,L extends Location,A extends Annotations<E,L,CL>,CL extends CommentList<L>>
- All Known Implementing Classes:
CheckingSchemaBuilder,DSchemaBuilderImpl,SchemaBuilderHost,SchemaBuilderImpl
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>>
-
Method Summary
Modifier and TypeMethodDescriptionCalled when annotation is found right inside a pattern such as,annotateAfter(P p, E e) Called when element annotation is found after a pattern.commentAfter(P p, CL comments) expandPattern(P p) Called after all the parsing is done.Returns theNameClassBuilder, which is used to build name classes for thisSchemaBuilder.makeAnnotations(CL comments, Context context) CreatesAnnotationsobject to parse annotations on patterns.makeAttribute(N nc, P p, L loc, A anno) makeChoice(List<P> patterns, L loc, A anno) makeDataPatternBuilder(String datatypeLibrary, String type, L loc) makeElement(N nc, P p, L loc, A anno) makeElementAnnotationBuilder(String ns, String localName, String prefix, L loc, CL comments, Context context) makeInterleave(List<P> patterns, L loc, A anno) makeLocation(String systemId, int lineNumber, int columnNumber) makeNotAllowed(L loc, A anno) makeOneOrMore(P p, L loc, A anno) makeOptional(P p, L loc, A anno) makeZeroOrMore(P p, L loc, A anno) booleanIf thisSchemaBuilderis interested in actually parsing comments, this method returns true.
-
Method Details
-
getNameClassBuilder
Returns 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.- Returns:
- always return a non-null valid object. This method can (and probably should) always return the same object.
- Throws:
BuildException
-
makeChoice
- Throws:
BuildException
-
makeInterleave
- Throws:
BuildException
-
makeGroup
- Throws:
BuildException
-
makeOneOrMore
- Throws:
BuildException
-
makeZeroOrMore
- Throws:
BuildException
-
makeOptional
- Throws:
BuildException
-
makeList
- Throws:
BuildException
-
makeMixed
- Throws:
BuildException
-
makeEmpty
-
makeNotAllowed
-
makeText
-
makeAttribute
- Throws:
BuildException
-
makeElement
- Throws:
BuildException
-
makeDataPatternBuilder
DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, L loc) throws BuildException - Throws:
BuildException
-
makeValue
P makeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno) throws BuildException - Throws:
BuildException
-
makeGrammar
- 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
Called when annotation is found right inside a pattern such as,<element name="foo"> <!-- this becomes 'P' --> <foreign:annotation /> <!-- this becomes 'A' --> ... </element>- Throws:
BuildException
-
annotateAfter
Called when element annotation is found after a pattern. such as,<element name="foo"> <empty /> <!-- this becomes 'P' --> <foreign:annotation /> <!-- this becomes 'E' --> </element>- Throws:
BuildException
-
commentAfter
- Throws:
BuildException
-
makeExternalRef
P makeExternalRef(Parseable current, String uri, String ns, Scope<P, E, throws BuildException, IllegalSchemaExceptionL, A, CL> scope, L loc, A anno) - Parameters:
current- Current grammar that we are parsing. This is what contains externalRef.scope- The parent scope. null if there's no parent scope. SeemakeGrammar(Scope)for more details about when this parameter can be null.- Throws:
BuildExceptionIllegalSchemaException
-
makeLocation
-
makeAnnotations
CreatesAnnotationsobject to parse annotations on patterns.- Returns:
- must be non-null.
-
makeElementAnnotationBuilder
-
makeCommentList
CL makeCommentList() -
makeErrorPattern
P makeErrorPattern() -
usesComments
boolean usesComments()If 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.
-
expandPattern
Called after all the parsing is done.This hook typically allows as
SchemaBuilderto expand notAllowed (if it's following the simplification as in the spec.)- Throws:
BuildExceptionIllegalSchemaException
-