Package org.apache.ws.jaxme.generator.sg.impl

Examples of org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader


//            }

            File outputDir =
                    new File(configuration.getOutputLocation(), configuration.getSourceLocation());

            JAXBSchemaReader reader = new JAXBSchemaReader();
            reader.setSupportingExtensions(true);

            GeneratorImpl generator = new GeneratorImpl();
            generator.setTargetDirectory(outputDir);
            generator.setForcingOverwrite(false);
            generator.setSchemaReader(reader);
View Full Code Here


      + "      </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

  public SchemaReader getSchemaReader() {
    if (schemaReader == null) {
      if (isExtension()) {
        return new JaxMeSchemaReader();
      } else {
        return new JAXBSchemaReader();
      }
    } else {
      return (SchemaReader) schemaReader.getInstance(SchemaReader.class);
    }
  }
View Full Code Here

        System.err.println("Additional instances of " + SGFactoryChain.class.getName()
                           + " may be specified only, if the schema reader is an instance of "
                           + JAXBSchemaReader.class.getName());
        System.exit(1);
      }
      JAXBSchemaReader jsr = (JAXBSchemaReader) sr;
      for (int i = 0;  i < sgFactoryChains.size();  i++) {
        jsr.addSGFactoryChain((Class) sgFactoryChains.get(i));
      }
    }

    if (target != null) {
      g.setTargetDirectory(new File(target));
View Full Code Here

*/
public class ParserTest extends BaseTestCase {
  public ParserTest(String arg) { super(arg); }

  protected SchemaSG parse(String pSchema, String pSystemId) throws Exception {
    JAXBSchemaReader r = getSchemaReader();
    InputSource isource = new InputSource(new StringReader(pSchema));
    isource.setSystemId(pSystemId);
    return r.parse(isource);
  }
View Full Code Here

    return r.parse(isource);
  }

  protected JAXBSchemaReader getSchemaReader() {
      Generator generator = new GeneratorImpl();
      JAXBSchemaReader r = new JAXBSchemaReader();
      generator.setSchemaReader(r);
      r.setGenerator(generator);
      return r;
  }
View Full Code Here

        "  <xs:attribute name='id' type='xs:ID'/>\n" +
        "</xs:schema>\n";
     
      InputSource isource = new InputSource(new StringReader(schemaSpec));
      isource.setSystemId("jira46.xsd");
      JAXBSchemaReader r = getSchemaReader();
      XSParser parser = r.getSGFactory().newXSParser();
      parser.setValidating(false);
      XSSchema schema = parser.parse(isource);
      XSAttribute[] attrs = schema.getAttributes();
      assertEquals(1, attrs.length);
      XSAttribute idAttr = attrs[0];
View Full Code Here

      + "      </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

  protected void doCompile(boolean pValidating, File pTempDir, URL pURL, HttpServletResponse pResponse)
      throws ServletException, IOException {
    Generator gen = new GeneratorImpl();
    gen.setTargetDirectory(new File(pTempDir, "src"));
    gen.setValidating(pValidating);
    gen.setSchemaReader(new JAXBSchemaReader());
    gen.setEntityResolver(new StoringEntityResolver(new File(pTempDir, "schema")));
    try {
      gen.generate(pURL);
    } catch (Exception e) {
      throw new ServletException(e);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader

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.