Package org.apache.ws.jaxme.xs

Examples of org.apache.ws.jaxme.xs.XSComplexType


  protected JAXBComplexTypeSG(TypeSG pTypeSG, XSType pType) throws SAXException {
    final String mName = "<init>(XSType)";
    log.finest(mName, "->", new Object[]{pTypeSG, pType});
    typeSG = pTypeSG;
    xsType = pType;
    XSComplexType complexType= pType.getComplexType();
    hasSimpleContent = complexType.hasSimpleContent();
    String suffix = pTypeSG.isGlobalType() ? null : "Type";
    classContext = new GlobalContext(pTypeSG.getName(), pType, null, suffix, pTypeSG.getSchema());
    log.finest(mName, "<-", classContext);
  }
View Full Code Here


  protected JAXBComplexTypeSG(TypeSG pTypeSG, XSType pType, Context pContext) throws SAXException {
    final String mName = "<init>(XSType)";
    log.finest(mName, "->", new Object[]{pTypeSG, pType, pContext});
    typeSG = pTypeSG;
    xsType = pType;
    XSComplexType complexType= pType.getComplexType();
    hasSimpleContent = complexType.hasSimpleContent();
    classContext = new LocalContext(pContext, pTypeSG.getName().getLocalName(), pType, null, "Type",
        pTypeSG.getSchema());
    log.finest(mName, "<-", classContext);
  }
View Full Code Here

        if (extendedType.isSimple()) {
          simpleContentType = getOwner().getXSSchema().getXSObjectFactory().newXSSimpleContentType(pOwner,
                                                                                     extendedType, extension);
          inheritedAttributes = new XSAttributable[0];
        } else {
          XSComplexType myComplexType = extendedType.getComplexType();
          if (!myComplexType.hasSimpleContent()) {
            throw new LocSAXException("Invalid 'extension': The base type " + extendedTypesName +
                                         " is neither a simple type nor a complex type with simple content.",
                                         extension.getLocator());
          }
          simpleContentType = myComplexType.getSimpleContent();
          inheritedAttributes = myComplexType.getAttributes();
        }
        XSAttributable[] myAttributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, extension);
        attributes = new XSAttributable[inheritedAttributes.length + myAttributes.length];
        System.arraycopy(inheritedAttributes, 0, attributes, 0, inheritedAttributes.length);
        System.arraycopy(myAttributes, 0, attributes, inheritedAttributes.length, myAttributes.length);
View Full Code Here

          throw new LocSAXException("Invalid 'extension': Unknown base type " + base, getLocator());
        }
        if (type.isSimple()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " is simple.", getLocator());
        }
        XSComplexType myComplexType = type.getComplexType();
        if (myComplexType.hasSimpleContent()) {
          throw new LocSAXException("Invalid 'extension': The base type " + base + " has simple content.",
                                       getLocator());
        }
        XsTTypeDefParticle particle = extension.getTypeDefParticle();
       
        XSGroup group = getGroupByParticle(particle);
        XsComplexContentType groupType = getContentTypeByParticle(particle, group);

        if (XsComplexContentType.EMPTY.equals(groupType)) {
          complexContentType = myComplexType.getComplexContentType();
          complexContentParticle = myComplexType.getParticle();
        } else if (myComplexType.isEmpty()) {
          complexContentType = groupType;
          complexContentParticle = new XSParticleImpl(group);
        } else {
          XSGroup sequenceGroup = new ExtensionGroup(pOwner, new XSParticle[]{myComplexType.getParticle(), new XSParticleImpl(group)});
          complexContentParticle = new XSParticleImpl(sequenceGroup);
          complexContentType = groupType;
        }

        XSAttributable[] inheritedAttributes = myComplexType.getAttributes();
        XSAttributable[] myAttributes = XSAttributeGroupImpl.getAttributes(XSTypeImpl.this, extension);
        attributes = new XSAttributable[inheritedAttributes.length + myAttributes.length];
        System.arraycopy(inheritedAttributes, 0, attributes, 0, inheritedAttributes.length);
        System.arraycopy(myAttributes, 0, attributes, inheritedAttributes.length, myAttributes.length);
        extendedType = type;
View Full Code Here

    return parser;
  }

  protected XSComplexType assertComplexType(XSType pType) throws SAXException {
    assertTrue(!pType.isSimple());
    XSComplexType result = pType.getComplexType();
    assertNotNull(result);
    boolean haveException = false;
    try {
      pType.getSimpleType();
    } catch (IllegalStateException e) {
View Full Code Here

          + "  </xs:complexType>\n"
          + "</xs:schema>";
        XSSchema schema = parse(schemaSpec, "jira34.xsd");
        XSType[] types = schema.getTypes();
        assertEquals(1, types.length);
        XSComplexType ct = assertComplexType(types[0]);
        assertTrue(ct.isMixed());
    }
View Full Code Here

        assertEquals("3", threeOrFourTypeEnums[0].getValue());
        assertEquals("4", threeOrFourTypeEnums[1].getValue());
        assertEquals(XSString.getInstance(), restrictedType);
        XSType outerType1 = types[1];
        assertEquals(new XsQName((XsAnyURI) null, "outerType1"), outerType1.getName());
        XSComplexType outerType1complexType = assertComplexType(outerType1);
        XSSimpleContentType outerType1simpleContentType = assertSimpleContent(outerType1complexType);
        XSType outerType1contentType = outerType1simpleContentType.getType();
        assertEquals(threeOrFourType, outerType1contentType);
        XSType outerType2 = types[2];
        assertEquals(new XsQName((XsAnyURI) null, "outerType2"), outerType2.getName());
        XSComplexType outerType2complexType = assertComplexType(outerType2);
        XSSimpleContentType outerType2simpleContentType = assertSimpleContent(outerType2complexType);
        XSType outerType2contentType = outerType2simpleContentType.getType();
        assertEquals(threeOrFourType, assertRestriction(outerType2contentType.getSimpleType()));
        XSEnumeration[] outerType2Enums = outerType2contentType.getSimpleType().getEnumerations();
        assertEquals(1, outerType2Enums.length);
View Full Code Here

        assertEquals(XSID.getInstance(), idAttr.getType());
        assertTrue(idAttr.isOptional());
        XSElement[] elements = schema.getElements();
        assertEquals(1, elements.length);
        XSElement rifElem = elements[0];
        XSComplexType ct = assertComplexType(rifElem.getType());
        XSAttributable[] rifAttrs = ct.getAttributes();
        assertEquals(1, rifAttrs.length);
        XSAttribute idRef = (XSAttribute) rifAttrs[0];
        assertFalse(idRef.equals(idAttr));
        assertEquals(new XsQName(uri, "id"), idAttr.getName());
        assertEquals(XSID.getInstance(), idAttr.getType());
View Full Code Here

        XSSchema schema = parse(xml, "jaxme63.xsd");
        XSElement[] elements = schema.getElements();
        assertEquals(1, elements.length);
        XSElement call = elements[0];
        assertEquals(new XsQName((String) null, "call"), call.getName());
        XSComplexType type = assertComplexType(call.getType());
        XSParticle particle = assertComplexContent(type);
        assertTrue(particle.isGroup());
        assertChoice(particle.getGroup());
        assertEquals(1, particle.getMinOccurs());
        assertEquals(-1, particle.getMaxOccurs());
View Full Code Here

        assertEquals(1, elements.length);
        XSElement xdwsResponseElement = elements[0];
        XSParticle[] xdwsResponseParticles = assertGroup(assertComplexContent(assertComplexType(xdwsResponseElement.getType()))).getParticles();
        assertEquals(2, xdwsResponseParticles.length);
        XSElement responseElement = assertElement(xdwsResponseParticles[0]);
        XSComplexType responseType = assertComplexType(responseElement.getType());
        XSParticle particle = responseType.getParticle();
        assertEquals(0, particle.getMinOccurs());
        assertEquals(1, particle.getMaxOccurs());
        XSParticle[] particles = assertGroup(particle).getParticles();
        assertEquals(2, particles.length);
        XSElement a = assertElement(particles[0]);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.xs.XSComplexType

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.