Пример #1
0
 /**
  * Gets the parser implemented as a ContentHandler.
  *
  * <p>One can feed XML Schema as SAX events to this interface to parse a schema. To parse multiple
  * schema files, feed multiple sets of events.
  *
  * <p>If you don't send a complete event sequence from a startDocument event to an endDocument
  * event, the state of XSOMParser can become unstable. This sometimes happen when you encounter an
  * error while generating SAX events. Don't call the getResult method in that case.
  *
  * <p>This way of reading XML Schema can be useful when XML Schema is not available as a
  * stand-alone XML document. For example, one can feed XML Schema inside a WSDL document.
  */
 public ContentHandler getParserHandler() {
   NGCCRuntimeEx runtime = context.newNGCCRuntime();
   Schema s = new Schema(runtime, false, null);
   runtime.setRootHandler(s);
   return runtime;
 }
Пример #2
0
 /**
  * Gets the parsed result. Don't call this method until you parse all the schemas.
  *
  * @return If there was any parse error, this method returns null. To receive error information,
  *     specify your error handler through the setErrorHandler method.
  * @exception SAXException This exception will never be thrown unless it is thrown by an error
  *     handler.
  */
 public XSSchemaSet getResult() throws SAXException {
   return context.getResult();
 }
Пример #3
0
 /**
  * Parses a new XML Schema document.
  *
  * <p>Note that if the {@link InputSource} does not have a system ID, XSOM will fail to resolve
  * them.
  */
 public void parse(InputSource source) throws SAXException {
   context.parse(source);
 }