Package org.apache.ws.jaxme.xs.jaxb.impl

Examples of org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser


    parser.setValidating(false);
    return parser;
  }

  protected JAXBParser newJAXBParser() {
    JAXBParser parser = new JAXBParser();
    parser.setValidating(false);
    return parser;
  }
View Full Code Here


    result.init();
    return result;
  }

  public XSParser newXSParser(SGFactory pController) throws SAXException {
    XSParser parser = new JAXBParser();
    XSContext context = parser.getContext();
    context.setXsObjectFactory(pController.newXsObjectFactory());
    context.setXSObjectFactory(pController.newXSObjectFactory());
    return parser;
  }
View Full Code Here

  }

  public void testSimpleTypes() throws Exception {
    XSParser xsParser = newXSParser();
    testSimpleTypes(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testSimpleTypes(jaxbParser);
  }
View Full Code Here

  }

  public void testAttributes() throws Exception {
    XSParser xsParser = newXSParser();
    testAttributes(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testAttributes(jaxbParser);
  }
View Full Code Here

  }

  public void testAttributeGroups() throws Exception {
    XSParser xsParser = newXSParser();
    testAttributeGroups(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testAttributeGroups(jaxbParser);
  }
View Full Code Here

  }

  public void testElements() throws Exception {
    XSParser xsParser = newXSParser();
    testElements(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testElements(jaxbParser);
  }
View Full Code Here

  }

  public void testFacets() throws Exception {
    XSParser xsParser = newXSParser();
    testFacets(xsParser);
    JAXBParser jaxbParser = newJAXBParser();
    testFacets(jaxbParser);
  }
View Full Code Here

      "      <xsd:pattern value='\\d{3}-[A-Z]{2}'/>\n" +
      "    </xsd:restriction>\n" +
      "  </xsd:simpleType>\n" +
      "</xsd:schema>\n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testPurchaseOrder.xsd");
    JAXBSchema schema = (JAXBSchema) parser.parse(isource);
    JAXBGlobalBindings globalBindings = schema.getJAXBGlobalBindings();
    assertNotNull(globalBindings);

    XSType[] schemaTypes = schema.getTypes();
    assertNotNull(schemaTypes);
View Full Code Here

      "   </xsd:restriction> \n" +
      "  </xsd:simpleType> \n" +
      " </xsd:element> \n" +
      "</xsd:schema> \n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource));
    isource.setSystemId("testRestrictionMaxExclusive.xsd");
    parser.parse(isource);
  }
View Full Code Here

    final String schemaSource1 =
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://test.com/namespaces'>\n" +
      "  <xs:element name='foo' type='xs:string'/>\n" +
      "</xs:schema>\n";

    JAXBParser parser = newJAXBParser();
    InputSource isource = new InputSource(new StringReader(schemaSource1));
    isource.setSystemId("testTargetNamespace1.xsd");
    XSSchema schema = parser.parse(isource);
    XSElement[] schemaElements = schema.getElements();
    assertEquals(1, schemaElements.length);
    assertEquals(new XsQName("http://test.com/namespaces", "foo"), schemaElements[0].getName());
    assertNull(schemaElements[0].getName().getPrefix());

    final String schemaSource2 =
      "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:test='http://test.com/namespaces'" +
      " targetNamespace='http://test.com/namespaces'>\n" +
      "  <xs:element name='foo' type='xs:string'/>\n" +
      "</xs:schema>\n";

    parser = newJAXBParser();
    isource = new InputSource(new StringReader(schemaSource2));
    isource.setSystemId("testTargetNamespace1.xsd");
    schema = parser.parse(isource);
    schemaElements = schema.getElements();
    assertEquals(1, schemaElements.length);
    assertEquals(new XsQName("http://test.com/namespaces", "foo"), schemaElements[0].getName());
    assertEquals("test", schemaElements[0].getName().getPrefix());
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.jaxb.impl.JAXBParser

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.