Top Description Constructors Methods
com.sun.tools.rngom.ast.util

public Class CheckingSchemaBuilder

extends SchemaBuilderHost
Class Inheritance
Imports
com.sun.tools.rngom.ast.builder.BuildException, .SchemaBuilder, com.sun.tools.rngom.ast.om.ParsedPattern, com.sun.tools.rngom.binary.SchemaBuilderImpl, .SchemaPatternBuilder, com.sun.tools.rngom.parse.IllegalSchemaException, com.sun.tools.rngom.parse.host.SchemaBuilderHost, .ParsedPatternHost, com.sun.tools.rngdatatype.DatatypeLibraryFactory, org.xml.sax.ErrorHandler

Wraps a SchemaBuilder and does all the semantic checks required by the RELAX NG spec.

Usage

Whereas you normally write it as follows:

YourParsedPattern r = (YourParsedPattern)parseable.parse(sb);
write this as follows:
YourParsedPattern r = (YourParsedPattern)parseable.parse(new CheckingSchemaBuilder(sb,eh));

The checking is done by using the rngom.binary package, so if you are using that package for parsing schemas, then there's no need to use this.

Author
Kohsuke Kawaguchi ([email protected])

Constructor Summary

AccessConstructor and Description
public
CheckingSchemaBuilder(SchemaBuilder<N extends ParsedNameClass, P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>
Your SchemaBuilder that parses RELAX NG schemas.
sb
,
ErrorHandler
All the errors found will be sent to this handler.
eh
)

public
CheckingSchemaBuilder(SchemaBuilder<N extends ParsedNameClass, P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> sb, ErrorHandler eh, DatatypeLibraryFactory dlf)

Method Summary

Modifier and TypeMethod and Description
public ParsedPattern
Inherited from com.sun.tools.rngom.parse.host.SchemaBuilderHost:
annotateannotateAftercommentAftergetNameClassBuildermakeAnnotationsmakeAttributemakeChoicemakeCommentListmakeDataPatternBuildermakeElementmakeElementAnnotationBuildermakeEmptymakeErrorPatternmakeExternalRefmakeGrammarmakeGroupmakeInterleavemakeListmakeLocationmakeMixedmakeNotAllowedmakeOneOrMoremakeOptionalmakeTextmakeValuemakeZeroOrMoreusesComments

Constructor Detail

CheckingSchemaBuilderback to summary
public CheckingSchemaBuilder(SchemaBuilder<N extends ParsedNameClass, P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> sb, ErrorHandler eh)
Parameters
sb:SchemaBuilder<N extends ParsedNameClass, P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>>

Your SchemaBuilder that parses RELAX NG schemas.

eh:ErrorHandler

All the errors found will be sent to this handler.

CheckingSchemaBuilderback to summary
public CheckingSchemaBuilder(SchemaBuilder<N extends ParsedNameClass, P extends ParsedPattern, E extends ParsedElementAnnotation, L extends Location, A extends Annotations<E, L, CL>, CL extends CommentList<L>> sb, ErrorHandler eh, DatatypeLibraryFactory dlf)

Method Detail

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

Overrides com.sun.tools.rngom.parse.host.SchemaBuilderHost.expandPattern.

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