Package org.apache.ws.jaxme.generator

Examples of org.apache.ws.jaxme.generator.SchemaReader


      + "      </xs:all>\n"
      + "    </xs:complexType>\n"
      + "  </xs:element>\n"
      + "</xs:schema>\n";
    Generator g = new GeneratorImpl();
    SchemaReader sr = new JAXBSchemaReader();
    g.setSchemaReader(sr);
    sr.setGenerator(g);
    SchemaSG schema = g.getSchemaReader().parse(new InputSource(new StringReader(xsSchema)));
    assertEquals("Element1", JavaNamer.convert("element1", schema));
    assertEquals("Element_1", JavaNamer.convert("element_1", schema));
  }
View Full Code Here


      + "    </xs:complexType>\n"
      + "  </xs:element>\n"
      + "</xs:schema>";
    Generator g = new GeneratorImpl();
    g.setProperty("jaxme.package.name", "org.apache.ws.jaxme.test.jira.jaxme63");
    SchemaReader sr = new JAXBSchemaReader();
    g.setSchemaReader(sr);
    sr.setGenerator(g);
    SchemaSG schema = g.getSchemaReader().parse(new InputSource(new StringReader(xml)));
    try {
      schema.generate();
      fail("Expected exception");
    } catch (SAXException e) {
View Full Code Here

      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
          isSupportingExtensions = ((JAXBSchemaReader) schemaReader).isSupportingExtensions();
        }
        if (isSupportingExtensions) {
          XSWildcard wildcard = (XSWildcard) xsAttributes[i];
View Full Code Here

  public File getTargetDirectory() {
    return targetDirectory;
  }

  public SchemaSG generate(InputSource pSource) throws Exception {
    SchemaReader sr = getSchemaReader();
    sr.setGenerator(this);

    SchemaSG s = sr.parse(pSource);
    s.generate();
    File targetDir = getTargetDirectory();
    JavaSourceFactory jsf = s.getJavaSourceFactory();
    for (Iterator iter = jsf.getJavaSources();  iter.hasNext()) {
        ((JavaSource) iter.next()).setForcingFullyQualifiedName(true);
View Full Code Here

      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
          isSupportingExtensions = ((JAXBSchemaReader) schemaReader).isSupportingExtensions();
        }
        if (isSupportingExtensions) {
          XSWildcard wildcard = (XSWildcard) xsAttributes[i];
View Full Code Here

    /** Makes the class <code>pSource</code> implementing the
     * {@link Serializable} interface.
     */
    public static void makeSerializable(SchemaSG pSchema, JavaSource pSource) {
        SchemaReader sr = pSchema.getFactory().getGenerator().getSchemaReader();
        if (sr instanceof JaxMeSchemaReader) {
            JaxMeSchemaReader jsr = (JaxMeSchemaReader) sr;
            XjcSerializable xjcSerializable = jsr.getXjcSerializable();
            if (xjcSerializable != null) {
                if (!pSource.isImplementing(SERIALIZABLE_TYPE)) {
View Full Code Here

  }

  public void init(SGFactory pFactory) {
    super.init(pFactory);
    sgFactory = pFactory;
    SchemaReader schemaReader = pFactory.getGenerator().getSchemaReader();
    if (schemaReader instanceof JaxMeSchemaReader) {
      JaxMeSchemaReader jaxmeSchemaReader = (JaxMeSchemaReader) schemaReader;
      jaxmeSchemaReader.addXsObjectCreator(new XsObjectCreator(){
        public XsObject newBean(XsObject pParent, Locator pLocator, XsQName pQName) throws SAXException {
            if (pParent instanceof XsEAppinfo) {
            if (JAXME_JDBC_SCHEMA_URI.equals(pQName.getNamespaceURI())) {
              if ("table".equals(pQName.getLocalName())) {
                return new TableDetails(JaxMeJdbcSG.this, pParent);
              } else if ("connection".equals(pQName.getLocalName())) {
                return new ConnectionDetails(JaxMeJdbcSG.this, pParent);
              } else {
                throw new LocSAXException("Invalid element name: " + pQName, pLocator);
              }
            }
            }
            return null;
          }
      });
    } else {
      throw new IllegalStateException("The schema reader " + schemaReader.getClass().getName() +
                                       " is not an instance of " + JaxMeSchemaReader.class.getName());
    }

    String s = schemaReader.getGenerator().getProperty("jdbc.sqlFactory");
    if (s == null) {
      sqlFactory = new SQLFactoryImpl();
    } else {
      Class c;
      try {
View Full Code Here

  public File getTargetDirectory() {
    return targetDirectory;
  }

  public SchemaSG generate(InputSource pSource) throws Exception {
    SchemaReader sr = getSchemaReader();
    sr.setGenerator(this);

    SchemaSG s = sr.parse(pSource);
    s.generate();
    File targetDir = getTargetDirectory();
    JavaSourceFactory jsf = s.getJavaSourceFactory();
    for (Iterator iter = jsf.getJavaSources();  iter.hasNext()) {
        ((JavaSource) iter.next()).setForcingFullyQualifiedName(true);
View Full Code Here

      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
          isSupportingExtensions = ((JAXBSchemaReader) schemaReader).isSupportingExtensions();
        }
        if (isSupportingExtensions) {
          XSWildcard wildcard = (XSWildcard) xsAttributes[i];
View Full Code Here

      if (xsAttributes[i] instanceof XSAttribute) {
        XSAttribute attr = (XSAttribute) xsAttributes[i];
        attrChain = (AttributeSGChain) pController.newAttributeSG(attr);
      } else if (xsAttributes[i] instanceof XSWildcard) {
        boolean isSupportingExtensions = false;
        SchemaReader schemaReader = pController.getTypeSG().getFactory().getGenerator().getSchemaReader();
        if (schemaReader instanceof JAXBSchemaReader) {
          isSupportingExtensions = ((JAXBSchemaReader) schemaReader).isSupportingExtensions();
        }
        if (isSupportingExtensions) {
          XSWildcard wildcard = (XSWildcard) xsAttributes[i];
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.SchemaReader

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.