Package org.apache.ws.jaxme.generator

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


    isource.setSystemId(pSystemId);
    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


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

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

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

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

      + "        <xs:element name='element_1' type='xs:string'/>\n"
      + "      </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

    isource.setSystemId(pSystemId);
    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:element name='element_1' type='xs:string'/>\n"
      + "      </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:group ref='params' maxOccurs='unbounded'/>\n"
      + "    </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) {
      assertTrue(e.getMessage().indexOf("Model groups with maxOccurs > 1 are not yet supported.") != -1);
View Full Code Here

    pDirectory.delete();
  }

  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);
    }
   
    pResponse.setContentType("application/zip");
View Full Code Here

    isource.setSystemId(pSystemId);
    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

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

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

TOP

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

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.