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

Examples of org.apache.ws.jaxme.generator.sg.SchemaSG


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

    SchemaSG s = sr.parse(pSource);
    s.generate();
    File targetDir = getTargetDirectory();
    s.getJavaSourceFactory().write(targetDir);

    return s;
  }
View Full Code Here


       throw new java.io.FileNotFoundException("Not a file: " + path);
    }

    InputSource isource = new InputSource(new FileInputStream(pFile));
    isource.setSystemId(pFile.toURL().toString());
    SchemaSG s = generate(isource);
    log.finer(mName, "<-", s);
    return s;
  }
View Full Code Here

    log.entering(mName, pURL);
    java.net.URLConnection conn = pURL.openConnection();

    InputSource isource = new InputSource(conn.getInputStream());
    isource.setSystemId(pURL.toString());
    SchemaSG s = generate(isource);
    log.exiting(mName, s);
    return s;
  }
View Full Code Here

        }
      }

      for (int i = 0;  i < schemaFiles.length;  i++) {
        try {
          SchemaSG schemaSG = generator.generate(schemaFiles[i]);
          if (producesFilesSet != null) {
            JavaSourceFactory jsf = schemaSG.getJavaSourceFactory();
            File targetDirectory = getTarget();
            for (Iterator iter = jsf.getJavaSources();  iter.hasNext()) {
              JavaSource js = (JavaSource) iter.next();
              File f = jsf.getLocation(targetDirectory, js).getAbsoluteFile();
              producesFilesSet.remove(f);
View Full Code Here

      "  <xs:simpleType name='c'>\n" +
      "    <xs:union memberTypes='a b'/>\n" +
      "  </xs:simpleType>\n" +
      "</xs:schema>\n";

    SchemaSG schemaSG = parse(schema, "testSimpleTypes.xsd");

    TypeSG[] st = schemaSG.getTypes();
    assertEquals(3, st.length);

    TypeSG st1 = st[0];
    assertTrue(!st1.isComplex());
    SimpleTypeSG sst1 = st1.getSimpleTypeSG();
View Full Code Here

      "    <xs:attribute ref='b'/>\n" +
      "    <xs:attribute name='c' type='xs:int'/>\n" +
      "  </xs:complexType>\n" +
      "</xs:schema>\n";

    SchemaSG jschema = parse(schema, "testAttributes.xsd");

    TypeSG[] types = jschema.getTypes();
    assertEquals(1, types.length);
    assertTrue(types[0].isComplex());

    AttributeSG[] attr = types[0].getComplexTypeSG().getAttributes();
    assertEquals(3, attr.length);
View Full Code Here

      "      <xs:attributeGroup ref='f'/>\n" +
      "    </xs:complexType>\n" +
      "  </xs:element>\n" +
      "</xs:schema>\n";

    SchemaSG jschema = parse(schema, "testAttributeGroups.xsd");

    ObjectSG[] elements = jschema.getElements();
    assertNotNull(elements);
    assertEquals(2, elements.length);

    ObjectSG ea = elements[0];
    assertTrue(ea.getTypeSG().isComplex());
View Full Code Here

      "    </xs:complexType>\n" +
      "  </xs:element>\n" +
      "</xs:schema>\n";

    System.err.println("testElements: ->");
    SchemaSG jschema = parse(schema, "testElements.xsd");

    ObjectSG[] elements = jschema.getElements();
    assertEquals(4, elements.length);

    ObjectSG e1 = elements[0];
    assertEquals(new XsQName((String) null, "a"), e1.getName());
    TypeSG t1 = e1.getTypeSG();
View Full Code Here

      "    </xs:restriction>\n" +
      "  </xs:simpleType>\n" +
      "  <xs:element name='a' type='USState'/>\n" +
      "</xs:schema>\n";
   
    SchemaSG jschema = parse(schema, "testFacets.xsd");

    ObjectSG[] elements = jschema.getElements();
    assertEquals(1, elements.length);
    ObjectSG se1 = elements[0];
    assertEquals(new XsQName((String) null, "a"), se1.getName());
    assertTrue(!se1.getTypeSG().isComplex());
    SimpleTypeSG sst1 = se1.getTypeSG().getSimpleTypeSG();
View Full Code Here

    // settings.
    final String schema =
      "<?xml version='1.0'?>\n" +
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'/>\n";
   
    SchemaSG jschema = parse(schema, "testGlobalBindingsDefaults.xsd");

    String collectionType = jschema.getCollectionType();
    assertStringEquals(ArrayList.class.getName(), collectionType);
    JAXBJavaType[] javaTypes = jschema.getJAXBJavaTypes();
    assertNotNull(javaTypes);
    assertEquals(0, javaTypes.length);
    XsQName[] typesafeEnumBase = jschema.getTypesafeEnumBase();
    assertNotNull(typesafeEnumBase);
    assertEquals(1, typesafeEnumBase.length);
    assertEquals(new XsQName(XSParser.XML_SCHEMA_URI, "NCName"), typesafeEnumBase[0]);
    boolean isBindingStyleModelGroup = jschema.isBindingStyleModelGroup();
    assertTrue(!isBindingStyleModelGroup);
    boolean choiceContentProperty = jschema.isChoiceContentProperty();
    assertTrue(!choiceContentProperty);
    boolean enableFailFastCheck = jschema.isFailFastCheckEnabled();
    assertTrue(!enableFailFastCheck);
    boolean isJavaNamingConventionsEnabled = jschema.isJavaNamingConventionsEnabled();
    assertTrue(isJavaNamingConventionsEnabled);
    boolean isFixedAttributeConstantProperty = jschema.isFixedAttributeConstantProperty();
    assertTrue(!isFixedAttributeConstantProperty);
    boolean generatingIsSetMethod = jschema.isGeneratingIsSetMethod();
    assertTrue(!generatingIsSetMethod);
    boolean underscoreWordSeparator = jschema.isUnderscoreWordSeparator();
    assertTrue(underscoreWordSeparator);
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.generator.sg.SchemaSG

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.