Package org.apache.ws.jaxme.xs

Examples of org.apache.ws.jaxme.xs.XSSchema


  /** <p>Adds the given object to the schema.</p>
   *
   */
  protected void add(XsESchema pSyntaxSchema, Object pChild) throws SAXException {
    XSSchema mySchema = getSchema();
    XSContext data = getData();
    XSObjectFactory factory = data.getXSObjectFactory();
    if (pChild instanceof XsEAnnotation) {
      XsEAnnotation annotation = (XsEAnnotation) pChild;
      mySchema.add(factory.newXSAnnotation(mySchema, annotation));
    } else if (pChild instanceof XsETopLevelSimpleType) {
      XsETopLevelSimpleType type = (XsETopLevelSimpleType) pChild;
      mySchema.add(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTComplexType) {
      XsTComplexType type = (XsTComplexType) pChild;
      mySchema.add(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTNamedGroup) {
      XsTNamedGroup group = (XsTNamedGroup) pChild;
      mySchema.add(factory.newXSGroup(mySchema, group));
    } else if (pChild instanceof XsTAttributeGroup) {
      XsTAttributeGroup attributeGroup = (XsTAttributeGroup) pChild;
      mySchema.add(factory.newXSAttributeGroup(mySchema, attributeGroup));
    } else if (pChild instanceof XsTTopLevelElement) {
      XsTTopLevelElement element = (XsTTopLevelElement) pChild;
      mySchema.add(factory.newXSElement(mySchema, element));
    } else if (pChild instanceof XsTAttribute) {
      XsTAttribute attribute = (XsTAttribute) pChild;
      mySchema.add(factory.newXSAttribute(mySchema, attribute));
    } else if (pChild instanceof XsENotation) {
      XsENotation notation = (XsENotation) pChild;
      mySchema.add(factory.newXSNotation(mySchema, notation));
    } else {
      Locator locator = (pChild instanceof XsObject) ?
        ((XsObject) pChild).getLocator() : pSyntaxSchema.getLocator();
      throw new LocSAXException("Unknown child type: " + pChild.getClass().getName() +
                                   ", perhaps you should handle this in a subclass?", locator);
View Full Code Here


    String xmlFileName = "examples/xs/Claes_Larsson/schema.xsd";
    java.net.URL xmlSystemId = new File(xmlFileName).toURL();

    InputSource isource = new InputSource(new FileInputStream(xmlFileName));
    isource.setSystemId(xmlSystemId.toString());
    XSSchema schema = xsp.parse(isource);

    // Print the names of all global elements:
    XSElement[] elements = schema.getElements();
    assertEquals(154, elements.length);
  }
View Full Code Here

    if (namespace == null  ||  namespace.length() == 0) {
      throw new IllegalStateException("Namespace is not set");
    }
    XSParser parser = new XSParser();
    parser.addImport(namespace, pSoapDataTypes);
    XSSchema schema = parser.parse(ele);
    assertNotNull(schema);
    assertTrue(schema.getElements().length > 0);
  }
View Full Code Here

*/
public class TableDetails extends ConnectionDetails {
  protected TableDetails(JaxMeJdbcSG pJdbcSG, XsObject pParent) throws SAXException {
    super(pJdbcSG, pParent);

    XSSchema schema = pParent.getXsESchema().getContext().getXSSchema();
    if (schema != null) {
      ConnectionDetails details = (ConnectionDetails)
        XSUtil.getSingleAppinfo(schema.getAnnotations(), ConnectionDetails.class);
      if (details != null) {
        cloneFrom(details);
      }
    }
  }
View Full Code Here

*/
public class TableDetails extends ConnectionDetails {
  protected TableDetails(JaxMeJdbcSG pJdbcSG, XsObject pParent) throws SAXException {
    super(pJdbcSG, pParent);

    XSSchema schema = pParent.getXsESchema().getContext().getXSSchema();
    if (schema != null) {
      ConnectionDetails details = (ConnectionDetails)
        XSUtil.getSingleAppinfo(schema.getAnnotations(), ConnectionDetails.class);
      if (details != null) {
        cloneFrom(details);
      }
    }
  }
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;
      mySchema.redefine(factory.newXSGroup(mySchema, group));
    } else if (pChild instanceof XsETopLevelSimpleType) {
      XsETopLevelSimpleType type = (XsETopLevelSimpleType) pChild;
      mySchema.redefine(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTComplexType) {
      XsTComplexType type = (XsTComplexType) pChild;
      mySchema.redefine(factory.newXSType(mySchema, type));
    } else {
      Locator locator = (pChild instanceof XsObject) ? ((XsObject) pChild).getLocator() : pRedefine.getLocator();
      throw new LocSAXException("Unknown type for redefinition: " + pChild.getClass().getName() +
                                   ", perhaps you should handle this in a subclass?", locator);
    }
View Full Code Here

  /** <p>Adds the given object to the schema.</p>
   *
   */
  protected void add(XsESchema pSyntaxSchema, Object pChild) throws SAXException {
    XSSchema mySchema = getSchema();
    XSContext data = getData();
    XSObjectFactory factory = data.getXSObjectFactory();
    if (pChild instanceof XsEAnnotation) {
      XsEAnnotation annotation = (XsEAnnotation) pChild;
      mySchema.add(factory.newXSAnnotation(mySchema, annotation));
    } else if (pChild instanceof XsETopLevelSimpleType) {
      XsETopLevelSimpleType type = (XsETopLevelSimpleType) pChild;
      mySchema.add(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTComplexType) {
      XsTComplexType type = (XsTComplexType) pChild;
      mySchema.add(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTNamedGroup) {
      XsTNamedGroup group = (XsTNamedGroup) pChild;
      mySchema.add(factory.newXSGroup(mySchema, group));
    } else if (pChild instanceof XsTAttributeGroup) {
      XsTAttributeGroup attributeGroup = (XsTAttributeGroup) pChild;
      mySchema.add(factory.newXSAttributeGroup(mySchema, attributeGroup));
    } else if (pChild instanceof XsTTopLevelElement) {
      XsTTopLevelElement element = (XsTTopLevelElement) pChild;
      mySchema.add(factory.newXSElement(mySchema, element));
    } else if (pChild instanceof XsTAttribute) {
      XsTAttribute attribute = (XsTAttribute) pChild;
      mySchema.add(factory.newXSAttribute(mySchema, attribute));
    } else if (pChild instanceof XsENotation) {
      XsENotation notation = (XsENotation) pChild;
      mySchema.add(factory.newXSNotation(mySchema, notation));
    } else {
      Locator locator = (pChild instanceof XsObject) ?
        ((XsObject) pChild).getLocator() : pSyntaxSchema.getLocator();
      throw new LocSAXException("Unknown child type: " + pChild.getClass().getName() +
                                   ", perhaps you should handle this in a subclass?", locator);
View Full Code Here

    log.finest(mName, "->", pSource.getSystemId());
    SGFactory factory = getSGFactory();
    XSParser parser = factory.newXSParser();
    log.finest(mName, "Parser = " + parser + ", validating = " + getGenerator().isValidating());
    parser.setValidating(getGenerator().isValidating());
    XSSchema schema = parser.parse(pSource);
    log.finest(mName, "Schema = " + schema);
    SchemaSG result = factory.getSchemaSG(schema);
    log.finest(mName, "<-", result);
    return result;
  }
View Full Code Here

    elementsByName.put(pName, objectSG);
    return objectSG;
  }

  public String getCollectionType(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        String result = globalBindings.getCollectionType();
View Full Code Here

  public ObjectSG[] getElements(SchemaSG pController) throws SAXException {
    return elementsByOrder;
  }

  public boolean isBindingStyleModelGroup(SchemaSG pController) {
    XSSchema schema = getXSSchema();
    if (schema instanceof JAXBSchema) {
      JAXBSchema jaxbSchema = (JAXBSchema) schema;
      JAXBGlobalBindings globalBindings = jaxbSchema.getJAXBGlobalBindings();
      if (globalBindings != null) {
        return globalBindings.isBindingStyleModelGroup();
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.XSSchema

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.