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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Pannotate(P p, A anno)Called when annotation is found right inside a pattern such as,PannotateAfter(P p, E e)Called when element annotation is found after a pattern.PcommentAfter(P p, CL comments)PexpandPattern(P p)Called after all the parsing is done.NameClassBuilder<N,E,L,A,CL>getNameClassBuilder()Returns theNameClassBuilder, which is used to build name classes for thisSchemaBuilder.AmakeAnnotations(CL comments, Context context)CreatesAnnotationsobject to parse annotations on patterns.PmakeAttribute(N nc, P p, L loc, A anno)PmakeChoice(List<P> patterns, L loc, A anno)CLmakeCommentList()DataPatternBuildermakeDataPatternBuilder(String datatypeLibrary, String type, L loc)PmakeElement(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)PmakeEmpty(L loc, A anno)PmakeErrorPattern()PmakeExternalRef(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)PmakeGroup(List<P> patterns, L loc, A anno)PmakeInterleave(List<P> patterns, L loc, A anno)PmakeList(P p, L loc, A anno)LmakeLocation(String systemId, int lineNumber, int columnNumber)PmakeMixed(P p, L loc, A anno)PmakeNotAllowed(L loc, A anno)PmakeOneOrMore(P p, L loc, A anno)PmakeOptional(P p, L loc, A anno)PmakeText(L loc, A anno)PmakeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno)PmakeZeroOrMore(P p, L loc, A anno)booleanusesComments()If thisSchemaBuilderis interested in actually parsing comments, this method returns true.
-
-
-
Method Detail
-
getNameClassBuilder
NameClassBuilder<N,E,L,A,CL> getNameClassBuilder() throws BuildException
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
P makeChoice(List<P> patterns, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeInterleave
P makeInterleave(List<P> patterns, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeGroup
P makeGroup(List<P> patterns, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeOneOrMore
P makeOneOrMore(P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeZeroOrMore
P makeZeroOrMore(P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeOptional
P makeOptional(P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeList
P makeList(P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeMixed
P makeMixed(P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeAttribute
P makeAttribute(N nc, P p, L loc, A anno) throws BuildException
- Throws:
BuildException
-
makeElement
P makeElement(N nc, P p, L loc, A anno) throws BuildException
- 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
Grammar<P,E,L,A,CL> makeGrammar(Scope<P,E,L,A,CL> parent)
- 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
P annotate(P p, A anno) throws BuildException
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
P annotateAfter(P p, E e) throws BuildException
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
P commentAfter(P p, CL comments) throws BuildException
- Throws:
BuildException
-
makeExternalRef
P makeExternalRef(Parseable current, String uri, String ns, Scope<P,E,L,A,CL> scope, L loc, A anno) throws BuildException, IllegalSchemaException
- 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
-
makeAnnotations
A makeAnnotations(CL comments, Context context)
CreatesAnnotationsobject to parse annotations on patterns.- Returns:
- must be non-null.
-
makeElementAnnotationBuilder
ElementAnnotationBuilder<P,E,L,A,CL> makeElementAnnotationBuilder(String ns, String localName, String prefix, L loc, CL comments, Context context)
-
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
P expandPattern(P p) throws BuildException, IllegalSchemaException
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
-
-