Top Description Fields Constructors Methods
com.sun.tools.rngom.digested

public Class DSchemaBuilderImpl

extends Object
implements SchemaBuilder<NameClass, DPattern, ElementWrapper, LocatorImpl, Annotation, CommentListImpl>
Class Inheritance
All Implemented Interfaces
com.sun.tools.rngom.ast.builder.SchemaBuilder
Imports
com.sun.tools.rngom.ast.builder.Grammar, .NameClassBuilder, .Scope, .BuildException, .DataPatternBuilder, .ElementAnnotationBuilder, .SchemaBuilder, com.sun.tools.rngom.ast.om.ParsedPattern, com.sun.tools.rngom.nc.NameClass, .NameClassBuilderImpl, com.sun.tools.rngom.parse.Context, .IllegalSchemaException, .Parseable, com.sun.tools.rngom.ast.util.LocatorImpl, org.w3c.dom.Document, javax.xml.parsers.DocumentBuilderFactory, .ParserConfigurationException, java.util.List

Parses as Parseable into a DPattern.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final Document
dom

Used to parse annotations.

private final NameClassBuilder<N extends ParsedNameClass, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static DContainerPattern
pack-priv static DUnaryPattern
public DPattern
annotate(DPattern p, Annotation anno)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.annotate.

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

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

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.annotateAfter.

Called when element annotation is found after a pattern.

public DPattern
public DPattern
expandPattern(DPattern p)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.expandPattern.

Called after all the parsing is done.

public NameClassBuilder<N extends ParsedNameClass, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
getNameClassBuilder()

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.getNameClassBuilder.

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

public Annotation
makeAnnotations(CommentListImpl comments, Context context)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeAnnotations.

Creates Annotations object to parse annotations on patterns.

public DPattern
public DPattern
public CommentListImpl
public DataPatternBuilder<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
public DPattern
public ElementAnnotationBuilder<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
public DPattern
public DPattern
public DPattern
public Grammar<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
makeGrammar(Scope<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> parent)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeGrammar.

public DPattern
public DPattern
public DPattern
public LocatorImpl
makeLocation(String systemId, int lineNumber, int columnNumber)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeLocation.

public DPattern
public DPattern
public DPattern
public DPattern
public DPattern
public DPattern
public DPattern
public boolean
usesComments()

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.usesComments.

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

pack-priv static DPattern
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

domback to summary
private final Document dom

Used to parse annotations.

ncbback to summary
private final NameClassBuilder<N extends ParsedNameClass, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> ncb

Constructor Detail

DSchemaBuilderImplback to summary
public DSchemaBuilderImpl()

Method Detail

addAllback to summary
pack-priv static DContainerPattern addAll(DContainerPattern parent, List<DPattern> children)
addBodyback to summary
pack-priv static DUnaryPattern addBody(DUnaryPattern parent, ParsedPattern _body, LocatorImpl loc)
annotateback to summary
public DPattern annotate(DPattern p, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.annotate.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.annotate.

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 DPattern annotateAfter(DPattern p, ElementWrapper e) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.annotateAfter.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.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>
commentAfterback to summary
public DPattern commentAfter(DPattern p, CommentListImpl comments) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.commentAfter.

expandPatternback to summary
public DPattern expandPattern(DPattern p) throws BuildException, IllegalSchemaException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.expandPattern.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.expandPattern.

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 extends ParsedNameClass, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> getNameClassBuilder() throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.getNameClassBuilder.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.getNameClassBuilder.

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.

makeAnnotationsback to summary
public Annotation makeAnnotations(CommentListImpl comments, Context context)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeAnnotations.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.makeAnnotations.

Creates Annotations object to parse annotations on patterns.

makeAttributeback to summary
public DPattern makeAttribute(NameClass nc, DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeAttribute.

makeChoiceback to summary
public DPattern makeChoice(List<DPattern> patterns, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeChoice.

makeCommentListback to summary
public CommentListImpl makeCommentList()

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.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, LocatorImpl loc) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeDataPatternBuilder.

makeElementback to summary
public DPattern makeElement(NameClass nc, DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeElement.

makeElementAnnotationBuilderback to summary
public ElementAnnotationBuilder<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, CommentListImpl comments, Context context)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeElementAnnotationBuilder.

makeEmptyback to summary
public DPattern makeEmpty(LocatorImpl loc, Annotation anno)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeEmpty.

makeErrorPatternback to summary
public DPattern makeErrorPattern()

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeErrorPattern.

makeExternalRefback to summary
public DPattern makeExternalRef(Parseable current, String uri, String ns, Scope<DPattern, ElementWrapper, LocatorImpl, Annotation, CommentListImpl> scope, LocatorImpl loc, Annotation anno) throws BuildException, IllegalSchemaException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeExternalRef.

makeGrammarback to summary
public Grammar<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> makeGrammar(Scope<P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> parent)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeGrammar.

makeGroupback to summary
public DPattern makeGroup(List<DPattern> patterns, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeGroup.

makeInterleaveback to summary
public DPattern makeInterleave(List<DPattern> patterns, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeInterleave.

makeListback to summary
public DPattern makeList(DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeList.

makeLocationback to summary
public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeLocation.

makeMixedback to summary
public DPattern makeMixed(DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeMixed.

makeNotAllowedback to summary
public DPattern makeNotAllowed(LocatorImpl loc, Annotation anno)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeNotAllowed.

makeOneOrMoreback to summary
public DPattern makeOneOrMore(DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeOneOrMore.

makeOptionalback to summary
public DPattern makeOptional(DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeOptional.

makeTextback to summary
public DPattern makeText(LocatorImpl loc, Annotation anno)

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeText.

makeValueback to summary
public DPattern makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeValue.

makeZeroOrMoreback to summary
public DPattern makeZeroOrMore(DPattern p, LocatorImpl loc, Annotation anno) throws BuildException

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.makeZeroOrMore.

usesCommentsback to summary
public boolean usesComments()

Implements com.sun.tools.rngom.ast.builder.SchemaBuilder.usesComments.

Doc from com.sun.tools.rngom.ast.builder.SchemaBuilder.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.

wrapback to summary
pack-priv static DPattern wrap(DPattern p, LocatorImpl loc, Annotation anno)