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

Examples of org.apache.ws.jaxme.xs.jaxb.JAXBElement


  protected JAXBPropertySG(ObjectSG pElement, XSElement pXSElement) {
    typeSG = pElement.getTypeSG();
    String myPropertyName = null;
    boolean myGeneratedIsSetMethod = pElement.getSchema().isGeneratingIsSetMethod();
    JAXBElement jaxbElement = null;
    if (pXSElement instanceof JAXBElement) {
      jaxbElement = (JAXBElement) pXSElement;
      JAXBProperty jaxbProperty = jaxbElement.getJAXBProperty();
      if (jaxbProperty != null) {
        myPropertyName = jaxbProperty.getName();
        Boolean jaxbGeneratedIsSetMethod = jaxbProperty.isGenerateIsSetMethod();
        if (jaxbGeneratedIsSetMethod != null) {
          myGeneratedIsSetMethod = jaxbGeneratedIsSetMethod.booleanValue();
View Full Code Here


    jaxbProperty = (JAXBProperty) XSUtil.getSingleAppinfo(getAnnotations(), JAXBProperty.class);

    if (jaxbProperty == null) {
      XsTElement elem = (XsTElement) getXsObject();
      if (elem.getRef() != null) {
        JAXBElement refElem = (JAXBElement) getXSSchema().getAttribute(elem.getRef());
        if (refElem != null) {
          jaxbProperty = refElem.getJAXBProperty();
        }
      }
    } else {
      if (isGlobal()) {
        if (jaxbProperty != null  &&  jaxbProperty.getBaseType() != null) {
View Full Code Here

      assertEquals("com.b.c", jaxbClass.getImplClass());
      XSParticle p1 = assertComplexContent(assertComplexType(a));
      XSGroup group = assertGroup(p1);
      XSParticle[] particles = group.getParticles();
      assertEquals(2, particles.length);
      JAXBElement f = (JAXBElement) assertElement(particles[1]);
      jaxbClass = f.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("x", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());


      JAXBElement g = (JAXBElement) schema.getElement(new XsQName((String) null, "g"));
      assertNotNull(g);
      assertNull(g.getJAXBClass());

      JAXBGroup m = (JAXBGroup) schema.getGroup(new XsQName((String) null, "m"));
      jaxbClass = m.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("k", jaxbClass.getName());
      assertEquals("com.b.i", jaxbClass.getImplClass());
    }

    {
      final String schemaSource =
        "<?xml version='1.0'?>\n" +
        "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'" +
        "           xmlns:jaxb='" + JAXBParser.JAXB_SCHEMA_URI + "'>\n" +
        "  <xs:complexType name='d'>\n" +
        "    <xs:sequence>\n" +
        "      <xs:element name='e'>\n" +
        "        <xs:complexType name='a'>\n" +
        "          <xs:annotation>\n" +
        "            <xs:appinfo>\n" +
        "              <jaxb:class name='b'/>\n" +
        "            </xs:appinfo>\n" +
        "          </xs:annotation>\n" +
        "          <xs:sequence>\n" +
        "            <xs:element name='x' type='xs:int'/>\n" +
        "          </xs:sequence>\n" +
        "          <xs:attribute name='y' type='xs:string'/>\n" +
        "        </xs:complexType>\n" +
        "      </xs:element>\n" +
        "      <xs:element name='f' type='xs:string'>\n" +
        "        <xs:annotation>\n" +
        "          <xs:appinfo>\n" +
        "            <jaxb:class name='x'/>\n" +
        "          </xs:appinfo>\n" +
        "        </xs:annotation>\n" +
        "      </xs:element>\n" +
        "      <xs:element name='g' type='xs:string'/>\n" +
        "    </xs:sequence>\n" +
        "  </xs:complexType>\n" +
        "</xs:schema>";
 
      JAXBParser parser = newJAXBParser();
      InputSource isource = new InputSource(new StringReader(schemaSource));
      isource.setSystemId("testJAXBClass2.xsd");
      JAXBSchema schema = (JAXBSchema) parser.parse(isource);
      JAXBType d = (JAXBType) schema.getType(new XsQName((String) null, "d"));
      assertNotNull(d);
      XSGroup dGroup = assertGroup(assertComplexContent(assertComplexType(d)));
      assertSequence(dGroup);
      XSParticle[] particles = dGroup.getParticles();
      assertEquals(3, particles.length);
      JAXBElement e = (JAXBElement) assertElement(particles[0]);
      JAXBType a = (JAXBType) e.getType();
      JAXBClass jaxbClass = a.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("b", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());

      JAXBElement f = (JAXBElement) assertElement(particles[1]);
      assertEquals(new XsQName((String) null, "f"), f.getName());
      assertNotNull(f);
      jaxbClass = f.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("x", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());

      JAXBElement g = (JAXBElement) assertElement(particles[2]);
      assertEquals(new XsQName((String) null, "g"), g.getName());
      assertNotNull(g);
      assertNull(g.getJAXBClass());
    }

    {
      final String schemaSource =
        "<?xml version='1.0'?>\n" +
View Full Code Here

    jaxbProperty = (JAXBProperty) XSUtil.getSingleAppinfo(getAnnotations(), JAXBProperty.class);

    if (jaxbProperty == null) {
      XsTElement elem = (XsTElement) getXsObject();
      if (elem.getRef() != null) {
        JAXBElement refElem = (JAXBElement) getXSSchema().getElement(elem.getRef());
        if (refElem != null) {
          jaxbProperty = refElem.getJAXBProperty();
        }
      }
    } else {
      if (isGlobal()) {
        if (jaxbProperty != null  &&  jaxbProperty.getBaseType() != null) {
View Full Code Here

      assertEquals("com.b.c", jaxbClass.getImplClass());
      XSParticle p1 = assertComplexContent(assertComplexType(a));
      XSGroup group = assertGroup(p1);
      XSParticle[] particles = group.getParticles();
      assertEquals(2, particles.length);
      JAXBElement f = (JAXBElement) assertElement(particles[1]);
      jaxbClass = f.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("x", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());


      JAXBElement g = (JAXBElement) schema.getElement(new XsQName((String) null, "g"));
      assertNotNull(g);
      assertNull(g.getJAXBClass());

      JAXBGroup m = (JAXBGroup) schema.getGroup(new XsQName((String) null, "m"));
      jaxbClass = m.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("k", jaxbClass.getName());
      assertEquals("com.b.i", jaxbClass.getImplClass());
    }

    {
      final String schemaSource =
        "<?xml version='1.0'?>\n" +
        "<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'" +
        "           xmlns:jaxb='" + JAXBParser.JAXB_SCHEMA_URI + "'>\n" +
        "  <xs:complexType name='d'>\n" +
        "    <xs:sequence>\n" +
        "      <xs:element name='e'>\n" +
        "        <xs:complexType name='a'>\n" +
        "          <xs:annotation>\n" +
        "            <xs:appinfo>\n" +
        "              <jaxb:class name='b'/>\n" +
        "            </xs:appinfo>\n" +
        "          </xs:annotation>\n" +
        "          <xs:sequence>\n" +
        "            <xs:element name='x' type='xs:int'/>\n" +
        "          </xs:sequence>\n" +
        "          <xs:attribute name='y' type='xs:string'/>\n" +
        "        </xs:complexType>\n" +
        "      </xs:element>\n" +
        "      <xs:element name='f' type='xs:string'>\n" +
        "        <xs:annotation>\n" +
        "          <xs:appinfo>\n" +
        "            <jaxb:class name='x'/>\n" +
        "          </xs:appinfo>\n" +
        "        </xs:annotation>\n" +
        "      </xs:element>\n" +
        "      <xs:element name='g' type='xs:string'/>\n" +
        "    </xs:sequence>\n" +
        "  </xs:complexType>\n" +
        "</xs:schema>";
 
      JAXBParser parser = newJAXBParser();
      InputSource isource = new InputSource(new StringReader(schemaSource));
      isource.setSystemId("testJAXBClass2.xsd");
      JAXBSchema schema = (JAXBSchema) parser.parse(isource);
      JAXBType d = (JAXBType) schema.getType(new XsQName((String) null, "d"));
      assertNotNull(d);
      XSGroup dGroup = assertGroup(assertComplexContent(assertComplexType(d)));
      assertSequence(dGroup);
      XSParticle[] particles = dGroup.getParticles();
      assertEquals(3, particles.length);
      JAXBElement e = (JAXBElement) assertElement(particles[0]);
      JAXBType a = (JAXBType) e.getType();
      JAXBClass jaxbClass = a.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("b", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());

      JAXBElement f = (JAXBElement) assertElement(particles[1]);
      assertEquals(new XsQName((String) null, "f"), f.getName());
      assertNotNull(f);
      jaxbClass = f.getJAXBClass();
      assertNotNull(jaxbClass);
      assertEquals("x", jaxbClass.getName());
      assertNull(jaxbClass.getImplClass());

      JAXBElement g = (JAXBElement) assertElement(particles[2]);
      assertEquals(new XsQName((String) null, "g"), g.getName());
      assertNotNull(g);
      assertNull(g.getJAXBClass());
    }

    {
      final String schemaSource =
        "<?xml version='1.0'?>\n" +
View Full Code Here

    jaxbProperty = (JAXBProperty) XSUtil.getSingleAppinfo(getAnnotations(), JAXBProperty.class);

    if (jaxbProperty == null) {
      XsTElement elem = (XsTElement) getXsObject();
      if (elem.getRef() != null) {
        JAXBElement refElem = (JAXBElement) getXSSchema().getAttribute(elem.getRef());
        if (refElem != null) {
          jaxbProperty = refElem.getJAXBProperty();
        }
      }
    } else {
      if (isGlobal()) {
        if (jaxbProperty != null  &&  jaxbProperty.getBaseType() != null) {
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.jaxb.JAXBElement

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.