Top Methods
com.sun.tools.rngom.ast.builder

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>>

Known Direct Implementers
com.sun.tools.rngom.binary.SchemaBuilderImpl, com.sun.tools.rngom.parse.host.SchemaBuilderHost, com.sun.tools.rngom.digested.DSchemaBuilderImpl
Imports
com.sun.tools.rngom.ast.om.Location, .ParsedElementAnnotation, .ParsedPattern, .ParsedNameClass, com.sun.tools.rngom.nc.NameClass, com.sun.tools.rngom.parse.*, java.util.List

Method Summary

Modifier and TypeMethod and Description
public P
annotate(P p, A anno)

Called when annotation is found right inside a pattern such as,

<element name="foo">     <!-- this becomes 'P' -->
  <foreign:annotation /> <!-- this becomes 'A' -->
  ...
public P
annotateAfter(P p, E e)

Called when element annotation is found after a pattern.

public P
commentAfter(P p, CL comments)

public P
expandPattern(P p)

Called after all the parsing is done.

public NameClassBuilder<N, E, L, A, CL>

Returns:

always return a non-null valid object. This method can (and probably should) always return the same object.
getNameClassBuilder
()

Returns the NameClassBuilder, which is used to build name classes for this .

public A

Returns:

must be non-null.
makeAnnotations
(CL comments, Context context)

Creates Annotations object to parse annotations on patterns.

public P
makeAttribute(N nc, P p, L loc, A anno)

public P
makeChoice(List<P> patterns, L loc, A anno)

public CL
public DataPatternBuilder<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
makeDataPatternBuilder(String datatypeLibrary, String type, L loc)

public P
makeElement(N nc, P p, L loc, A anno)

public ElementAnnotationBuilder<P, E, L, A, CL>
makeElementAnnotationBuilder(String ns, String localName, String prefix, L loc, CL comments, Context context)

public P
makeEmpty(L loc, A anno)

public P
public P
makeExternalRef(Parseable
Current grammar that we are parsing. This is what contains externalRef.
current
,
String uri, String ns, Scope<P, E, L, A, CL>
The parent scope. null if there's no parent scope. See makeGrammar(Scope) for more details about when this parameter can be null.
scope
,
L loc, A anno)

public Grammar<P, E, L, A, CL>
makeGrammar(Scope<P, E, L, A, CL>
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.
parent
)

public P
makeGroup(List<P> patterns, L loc, A anno)

public P
makeInterleave(List<P> patterns, L loc, A anno)

public P
makeList(P p, L loc, A anno)

public L
makeLocation(String systemId, int lineNumber, int columnNumber)

public P
makeMixed(P p, L loc, A anno)

public P
makeNotAllowed(L loc, A anno)

public P
makeOneOrMore(P p, L loc, A anno)

public P
makeOptional(P p, L loc, A anno)

public P
makeText(L loc, A anno)

public P
makeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno)

public P
makeZeroOrMore(P p, L loc, A anno)

public boolean
usesComments()

If this is interested in actually parsing comments, this method returns true.

Method Detail

annotateback to summary
public 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>
annotateAfterback to summary
public 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>
commentAfterback to summary
public P commentAfter(P p, CL comments) throws BuildException
expandPatternback to summary
public P expandPattern(P p) throws BuildException, IllegalSchemaException

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.)

getNameClassBuilderback to summary
public NameClassBuilder<N, E, L, A, CL> getNameClassBuilder() throws BuildException

Returns the NameClassBuilder, which is used to build name classes for this . The NameClasses that are built will then be fed into this to further build RELAX NG patterns.

Returns:NameClassBuilder<N, E, L, A, CL>

always return a non-null valid object. This method can (and probably should) always return the same object.

makeAnnotationsback to summary
public A makeAnnotations(CL comments, Context context)

Creates Annotations object to parse annotations on patterns.

Returns:A

must be non-null.

makeAttributeback to summary
public P makeAttribute(N nc, P p, L loc, A anno) throws BuildException
makeChoiceback to summary
public P makeChoice(List<P> patterns, L loc, A anno) throws BuildException
makeCommentListback to summary
public CL makeCommentList()
makeDataPatternBuilderback to summary
public DataPatternBuilder<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> makeDataPatternBuilder(String datatypeLibrary, String type, L loc) throws BuildException
makeElementback to summary
public P makeElement(N nc, P p, L loc, A anno) throws BuildException
makeElementAnnotationBuilderback to summary
public ElementAnnotationBuilder<P, E, L, A, CL> makeElementAnnotationBuilder(String ns, String localName, String prefix, L loc, CL comments, Context context)
makeEmptyback to summary
public P makeEmpty(L loc, A anno)
makeErrorPatternback to summary
public P makeErrorPattern()
makeExternalRefback to summary
public P makeExternalRef(Parseable current, String uri, String ns, Scope<P, E, L, A, CL> scope, L loc, A anno) throws BuildException, IllegalSchemaException
Parameters
current:Parseable

Current grammar that we are parsing. This is what contains externalRef.

scope:Scope<P, E, L, A, CL>

The parent scope. null if there's no parent scope. See makeGrammar(Scope) for more details about when this parameter can be null.

makeGrammarback to summary
public Grammar<P, E, L, A, CL> makeGrammar(Scope<P, E, L, A, CL> parent)
Parameters
parent:Scope<P, E, L, A, CL>

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.
makeGroupback to summary
public P makeGroup(List<P> patterns, L loc, A anno) throws BuildException
makeInterleaveback to summary
public P makeInterleave(List<P> patterns, L loc, A anno) throws BuildException
makeListback to summary
public P makeList(P p, L loc, A anno) throws BuildException
makeLocationback to summary
public L makeLocation(String systemId, int lineNumber, int columnNumber)
makeMixedback to summary
public P makeMixed(P p, L loc, A anno) throws BuildException
makeNotAllowedback to summary
public P makeNotAllowed(L loc, A anno)
makeOneOrMoreback to summary
public P makeOneOrMore(P p, L loc, A anno) throws BuildException
makeOptionalback to summary
public P makeOptional(P p, L loc, A anno) throws BuildException
makeTextback to summary
public P makeText(L loc, A anno)
makeValueback to summary
public P makeValue(String datatypeLibrary, String type, String value, Context c, String ns, L loc, A anno) throws BuildException
makeZeroOrMoreback to summary
public P makeZeroOrMore(P p, L loc, A anno) throws BuildException
usesCommentsback to summary
public boolean usesComments()

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.