Package org.apache.ws.jaxme.xs.parser

Examples of org.apache.ws.jaxme.xs.parser.XSContext


    return result;
  }
 
  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here


      if (this instanceof XsESchema) {
        throw new IllegalStateException("The schema must have a null parent.");
      }
    }
    parent = pParent;
    XSContext context = getContext();
    if (context != null) {
      Locator loc = context.getLocator();
      locator = loc == null ? null : new LocatorImpl(getContext().getLocator());
    } else {
      locator = null;
    }
  }
View Full Code Here

    /** Sets the document locator.
     */
    public void setLocator(Locator pLocator) {
      locator = pLocator;
        XSContext context = getData();
        if (context != null) {
          context.setLocator(pLocator);
        }
    }
View Full Code Here

  /** <p>The XJC Schema URI: <code>http://java.sun.com/xml/ns/jaxb/xjc</code></p>
   */
  public static final String XJC_SCHEMA_URI = "http://java.sun.com/xml/ns/jaxb/xjc";

  public JAXBParser() {
    XSContext data = getContext();
    data.setXsObjectFactory(JAXB_XS_OBJECT_FACTORY);
    data.setXSObjectFactory(JAXB_OBJECT_FACTORY);
  }
View Full Code Here

    return result;
  }
 
  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here

    return result;
  }
 
  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here

    return result;
  }
 
  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here

  protected void setSchema(XSSchema pSchema) {
    schema = pSchema;
  }
 
  protected XsESchema parseSyntax(Node pNode) throws SAXException {
    XSContext data = getData();
    try {
      XsObjectFactory factory = data.getXsObjectFactory();
      XsESchema mySchema = factory.newXsESchema();
      XsSAXParser xsSAXParser = factory.newXsSAXParser(mySchema);
      addSyntaxSchema(mySchema);
      try {
        data.setCurrentContentHandler(xsSAXParser);
        DOMSerializer ds = new DOMSerializer();
        ds.serialize(pNode, xsSAXParser);
        return (XsESchema) xsSAXParser.getBean();
      } finally {
        removeSyntaxSchema();
      }
    } finally {
      data.setCurrentContentHandler(null);
    }
  }
View Full Code Here

  }

  protected void parseSyntax(Locator pLocator, String pSchemaLocation,
      XsESchema pSchema)
  throws SAXException, IOException, ParserConfigurationException {
    XSContext data = getData();
    try {
      XsObjectFactory factory = data.getXsObjectFactory();
      XMLReader xr = factory.newXMLReader(isValidating());
      EntityResolver entityResolver = xr.getEntityResolver();
      InputSource schemaSource = null;
      if (entityResolver != null) {
        schemaSource = entityResolver.resolveEntity(null, pSchemaLocation);
      }
      if (schemaSource == null) {
        schemaSource = getInputSource(pLocator == null ? null : pLocator.getSystemId(),
            pSchemaLocation);
      }
     
      XsSAXParser xsSAXParser = factory.newXsSAXParser(pSchema);
      addSyntaxSchema(pSchema);
      try {
        data.setCurrentContentHandler(xsSAXParser);
        runContentHandler(xr, xsSAXParser, schemaSource);
      } finally {
        removeSyntaxSchema();
      }
    } finally {
      data.setCurrentContentHandler(null);
    }
  }
View Full Code Here

  /** <p>Redefines the given {@link XsRedefinable}.</p>
   */
  protected void redefine(XsESchema pSyntaxSchema,
      XsERedefine pRedefine, XsRedefinable pChild) throws SAXException {
    XSSchema mySchema = getSchema();
    XSContext data = getData();
    XSObjectFactory factory = data.getXSObjectFactory();
    if (pChild instanceof XsTAttributeGroup) {
      XsTAttributeGroup attributeGroup = (XsTAttributeGroup) pChild;
      mySchema.redefine(factory.newXSAttributeGroup(mySchema, attributeGroup));
    } else if (pChild instanceof XsTNamedGroup) {
      XsTNamedGroup group = (XsTNamedGroup) pChild;
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.parser.XSContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.