Package com.sun.tools.rngom.parse.host
Class SchemaBuilderHost
- java.lang.Object
-
- com.sun.tools.rngom.parse.host.Base
-
- com.sun.tools.rngom.parse.host.SchemaBuilderHost
-
- All Implemented Interfaces:
SchemaBuilder
- Direct Known Subclasses:
CheckingSchemaBuilder
public class SchemaBuilderHost extends Base implements SchemaBuilder
- Author:
- Kohsuke Kawaguchi ([email protected])
-
-
Constructor Summary
Constructors Constructor Description SchemaBuilderHost(SchemaBuilder lhs, SchemaBuilder rhs)
-
Method Summary
-
-
-
Constructor Detail
-
SchemaBuilderHost
public SchemaBuilderHost(SchemaBuilder lhs, SchemaBuilder rhs)
-
-
Method Detail
-
annotate
public ParsedPattern annotate(ParsedPattern _p, Annotations _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
- Throws:
BuildException
-
annotateAfter
public ParsedPattern annotateAfter(ParsedPattern _p, ParsedElementAnnotation _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
- Throws:
BuildException
-
commentAfter
public ParsedPattern commentAfter(ParsedPattern _p, CommentList _comments) throws BuildException
- Specified by:
commentAfter
in interfaceSchemaBuilder
- Throws:
BuildException
-
expandPattern
public ParsedPattern expandPattern(ParsedPattern _p) throws BuildException, IllegalSchemaException
Description copied from interface:SchemaBuilder
Called after all the parsing is done.This hook typically allows as
SchemaBuilder
to expand notAllowed (if it's following the simplification as in the spec.)- Specified by:
expandPattern
in interfaceSchemaBuilder
- Throws:
BuildException
IllegalSchemaException
-
getNameClassBuilder
public NameClassBuilder getNameClassBuilder() throws BuildException
Description copied from interface:SchemaBuilder
Returns theNameClassBuilder
, which is used to build name classes for thisSchemaBuilder
. TheNameClass
es that are built will then be fed into thisSchemaBuilder
to further build RELAX NG patterns.- Specified by:
getNameClassBuilder
in interfaceSchemaBuilder
- Returns:
- always return a non-null valid object. This method can (and probably should) always return the same object.
- Throws:
BuildException
-
makeAnnotations
public Annotations makeAnnotations(CommentList _comments, Context context)
Description copied from interface:SchemaBuilder
CreatesAnnotations
object to parse annotations on patterns.- Specified by:
makeAnnotations
in interfaceSchemaBuilder
- Returns:
- must be non-null.
-
makeAttribute
public ParsedPattern makeAttribute(ParsedNameClass _nc, ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeAttribute
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeChoice
public ParsedPattern makeChoice(List patterns, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeChoice
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeCommentList
public CommentList makeCommentList()
- Specified by:
makeCommentList
in interfaceSchemaBuilder
-
makeDataPatternBuilder
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, Location _loc) throws BuildException
- Specified by:
makeDataPatternBuilder
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeElement
public ParsedPattern makeElement(ParsedNameClass _nc, ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeElement
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeElementAnnotationBuilder
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, Location _loc, CommentList _comments, Context context)
- Specified by:
makeElementAnnotationBuilder
in interfaceSchemaBuilder
-
makeEmpty
public ParsedPattern makeEmpty(Location _loc, Annotations _anno)
- Specified by:
makeEmpty
in interfaceSchemaBuilder
-
makeErrorPattern
public ParsedPattern makeErrorPattern()
- Specified by:
makeErrorPattern
in interfaceSchemaBuilder
-
makeExternalRef
public ParsedPattern makeExternalRef(Parseable current, String uri, String ns, Scope _scope, Location _loc, Annotations _anno) throws BuildException, IllegalSchemaException
- Specified by:
makeExternalRef
in interfaceSchemaBuilder
- 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
-
makeGrammar
public Grammar makeGrammar(Scope _parent)
- Specified by:
makeGrammar
in interfaceSchemaBuilder
- 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.
-
makeGroup
public ParsedPattern makeGroup(List patterns, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeGroup
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeInterleave
public ParsedPattern makeInterleave(List patterns, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeInterleave
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeList
public ParsedPattern makeList(ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeList
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeLocation
public Location makeLocation(String systemId, int lineNumber, int columnNumber)
- Specified by:
makeLocation
in interfaceSchemaBuilder
-
makeMixed
public ParsedPattern makeMixed(ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeMixed
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeNotAllowed
public ParsedPattern makeNotAllowed(Location _loc, Annotations _anno)
- Specified by:
makeNotAllowed
in interfaceSchemaBuilder
-
makeOneOrMore
public ParsedPattern makeOneOrMore(ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeOneOrMore
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeZeroOrMore
public ParsedPattern makeZeroOrMore(ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeZeroOrMore
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeOptional
public ParsedPattern makeOptional(ParsedPattern _p, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeOptional
in interfaceSchemaBuilder
- Throws:
BuildException
-
makeText
public ParsedPattern makeText(Location _loc, Annotations _anno)
- Specified by:
makeText
in interfaceSchemaBuilder
-
makeValue
public ParsedPattern makeValue(String datatypeLibrary, String type, String value, Context c, String ns, Location _loc, Annotations _anno) throws BuildException
- Specified by:
makeValue
in interfaceSchemaBuilder
- Throws:
BuildException
-
usesComments
public boolean usesComments()
Description copied from interface:SchemaBuilder
If thisSchemaBuilder
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
-
-