Package com.sun.tools.rngom.ast.util
Class CheckingSchemaBuilder
- java.lang.Object
-
- com.sun.tools.rngom.parse.host.Base
-
- com.sun.tools.rngom.parse.host.SchemaBuilderHost
-
- com.sun.tools.rngom.ast.util.CheckingSchemaBuilder
-
- All Implemented Interfaces:
SchemaBuilder
public class CheckingSchemaBuilder extends SchemaBuilderHost
Wraps aSchemaBuilderand 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.binarypackage, so if you are using that package for parsing schemas, then there's no need to use this.- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
-
Constructor Summary
Constructors Constructor Description CheckingSchemaBuilder(SchemaBuilder sb, ErrorHandler eh)CheckingSchemaBuilder(SchemaBuilder sb, ErrorHandler eh, DatatypeLibraryFactory dlf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParsedPatternexpandPattern(ParsedPattern p)Called after all the parsing is done.-
Methods inherited from class com.sun.tools.rngom.parse.host.SchemaBuilderHost
annotate, annotateAfter, commentAfter, getNameClassBuilder, makeAnnotations, makeAttribute, makeChoice, makeCommentList, makeDataPatternBuilder, makeElement, makeElementAnnotationBuilder, makeEmpty, makeErrorPattern, makeExternalRef, makeGrammar, makeGroup, makeInterleave, makeList, makeLocation, makeMixed, makeNotAllowed, makeOneOrMore, makeOptional, makeText, makeValue, makeZeroOrMore, usesComments
-
-
-
-
Constructor Detail
-
CheckingSchemaBuilder
public CheckingSchemaBuilder(SchemaBuilder sb, ErrorHandler eh)
- Parameters:
sb- YourSchemaBuilderthat parses RELAX NG schemas.eh- All the errors found will be sent to this handler.
-
CheckingSchemaBuilder
public CheckingSchemaBuilder(SchemaBuilder sb, ErrorHandler eh, DatatypeLibraryFactory dlf)
-
-
Method Detail
-
expandPattern
public ParsedPattern expandPattern(ParsedPattern p) throws BuildException, IllegalSchemaException
Description copied from interface:SchemaBuilderCalled after all the parsing is done.This hook typically allows as
SchemaBuilderto expand notAllowed (if it's following the simplification as in the spec.)- Specified by:
expandPatternin interfaceSchemaBuilder- Overrides:
expandPatternin classSchemaBuilderHost- Throws:
BuildExceptionIllegalSchemaException
-
-