< prev index next >

src/jdk.xml.bind/share/classes/com/sun/xml/internal/rngom/ast/util/CheckingSchemaBuilder.java

Print this page




  55 import com.sun.xml.internal.rngom.parse.host.SchemaBuilderHost;
  56 import org.relaxng.datatype.DatatypeLibraryFactory;
  57 import org.xml.sax.ErrorHandler;
  58 
  59 /**
  60  * Wraps a {@link SchemaBuilder} and does all the semantic checks
  61  * required by the RELAX NG spec.
  62  *
  63  * <h2>Usage</h2>
  64  * <p>
  65  * Whereas you normally write it as follows:
  66  * <pre>
  67  * YourParsedPattern r = (YourParsedPattern)parseable.parse(sb);
  68  * </pre>
  69  * write this as follows:
  70  * <pre>
  71  * YourParsedPattern r = (YourParsedPattern)parseable.parse(new CheckingSchemaBuilder(sb,eh));
  72  * </pre>
  73  *
  74  * <p>
  75  * The checking is done by using the <tt>rngom.binary</tt> package, so if you are using
  76  * that package for parsing schemas, then there's no need to use this.
  77  *
  78  * @author
  79  *      Kohsuke Kawaguchi (kk@kohsuke.org)
  80  */
  81 public class CheckingSchemaBuilder extends SchemaBuilderHost {
  82     /**
  83      *
  84      * @param sb
  85      *      Your {@link SchemaBuilder} that parses RELAX NG schemas.
  86      * @param eh
  87      *      All the errors found will be sent to this handler.
  88      */
  89     public CheckingSchemaBuilder( SchemaBuilder sb, ErrorHandler eh ) {
  90         super(new SchemaBuilderImpl(eh),sb);
  91     }
  92     public CheckingSchemaBuilder( SchemaBuilder sb, ErrorHandler eh, DatatypeLibraryFactory dlf ) {
  93         super(new SchemaBuilderImpl(eh,dlf,new SchemaPatternBuilder()),sb);
  94     }
  95 


  55 import com.sun.xml.internal.rngom.parse.host.SchemaBuilderHost;
  56 import org.relaxng.datatype.DatatypeLibraryFactory;
  57 import org.xml.sax.ErrorHandler;
  58 
  59 /**
  60  * Wraps a {@link SchemaBuilder} and does all the semantic checks
  61  * required by the RELAX NG spec.
  62  *
  63  * <h2>Usage</h2>
  64  * <p>
  65  * Whereas you normally write it as follows:
  66  * <pre>
  67  * YourParsedPattern r = (YourParsedPattern)parseable.parse(sb);
  68  * </pre>
  69  * write this as follows:
  70  * <pre>
  71  * YourParsedPattern r = (YourParsedPattern)parseable.parse(new CheckingSchemaBuilder(sb,eh));
  72  * </pre>
  73  *
  74  * <p>
  75  * The checking is done by using the {@code rngom.binary} package, so if you are using
  76  * that package for parsing schemas, then there's no need to use this.
  77  *
  78  * @author
  79  *      Kohsuke Kawaguchi (kk@kohsuke.org)
  80  */
  81 public class CheckingSchemaBuilder extends SchemaBuilderHost {
  82     /**
  83      *
  84      * @param sb
  85      *      Your {@link SchemaBuilder} that parses RELAX NG schemas.
  86      * @param eh
  87      *      All the errors found will be sent to this handler.
  88      */
  89     public CheckingSchemaBuilder( SchemaBuilder sb, ErrorHandler eh ) {
  90         super(new SchemaBuilderImpl(eh),sb);
  91     }
  92     public CheckingSchemaBuilder( SchemaBuilder sb, ErrorHandler eh, DatatypeLibraryFactory dlf ) {
  93         super(new SchemaBuilderImpl(eh,dlf,new SchemaPatternBuilder()),sb);
  94     }
  95 
< prev index next >