Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSSimpleTypeDefinition


     * @param value
     * @param cell
     */
    private static void renderSimpleType(Object value, JLabel cell) {
        if (value instanceof XSSimpleTypeDefinition) {
            XSSimpleTypeDefinition xsSimple = ((XSSimpleTypeDefinition) value).getAnonymous() ? AnonymousTypeFactory.getProxy((XSSimpleTypeDefinition) value) : (XSSimpleTypeDefinition) value;
            StringBuilder sb = new StringBuilder();
            sb.append(xsSimple.getName());
            sb.append(", <");
            sb.append(xsSimple.getNamespace());
            sb.append(">");
            cell.setText(sb.toString());
            cell.setIcon(SimpleTypeCellRenderer.icon);
        }
    }
View Full Code Here


                baseType = onVisitComplexTypeDefinition(ctypedef, parent);

                break;
            case XSTypeDefinition.SIMPLE_TYPE:
                XsModelWalker.logger.debug("==> Found simple type definition");
                XSSimpleTypeDefinition stypedef = (XSSimpleTypeDefinition) type;
                baseType = onVisitSimpleTypeDefinition(stypedef, parent);
                break;
            default:
                baseType = null;
                break;
View Full Code Here

                XsModelWalker.logger.debug("==> Found simple type variety atomic");
                break;
            case XSSimpleTypeDefinition.VARIETY_LIST:
                // list
                XsModelWalker.logger.debug("==> Found simple type variety list");
                XSSimpleTypeDefinition itemType = stypedef.getItemType();
                visitComponent(itemType, stypedef);
                break;
            case XSSimpleTypeDefinition.VARIETY_UNION:
                // union
                XsModelWalker.logger.debug("==> Found simple type variety union");
View Full Code Here

      {
         // Simple types are not neccessary mapped in jaxrpc-mapping.xml, lazily add the mapping here
         XSTypeDefinition xsType = schemaModel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
         if (xsType instanceof XSSimpleTypeDefinition)
         {
            XSSimpleTypeDefinition xsSimpleType = (XSSimpleTypeDefinition)xsType;
            String javaTypeName = null;
           
            // <simpleType name="FooStringListType">
            //   <list itemType="string"/>
            // </simpleType>
            if (xsSimpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST)
            {
               XSSimpleTypeDefinition itemType = xsSimpleType.getItemType();
               QName xmlBaseType = new QName(itemType.getNamespace(), itemType.getName());
               javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
               if (javaTypeName != null)
               {
                  javaTypeName += "[]";
               }
View Full Code Here

         ct.setContentType(XSComplexTypeDefinition.CONTENTTYPE_EMPTY);
         xt = ct;
      }
      else
      {
         XSSimpleTypeDefinition xstype = (new SchemaDVFactoryImpl()).getBuiltInType(localpart);
         xt = new JBossXSSimpleTypeDefinition(xstype);

      }
      return xt;
   }
View Full Code Here

        processPSVIAttributeWildcard(type.getAttributeWildcard());
        sendIndentedElement("psv:contentType");
        sendElementEvent(
            "psv:variety",
            this.translateContentType(type.getContentType()));
        XSSimpleTypeDefinition simpleType = type.getSimpleType();
        if(simpleType == null || (!simpleType.getAnonymous() || fDefined.contains(this.getID(simpleType)))) {
            processPSVIElementRef("psv:simpleTypeDefinition", simpleType);
        }
        else {
            processPSVISimpleTypeDefinition(simpleType);
        }
View Full Code Here

            }
        }
        if (type != base) {
            // If the base is a union, check if "derived" is allowed through any of the member types.
            if (base.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                XSSimpleTypeDefinition st = (XSSimpleTypeDefinition) base;
                if (st.getVariety() ==  XSSimpleTypeDefinition.VARIETY_UNION) {
                    XSObjectList memberTypes = st.getMemberTypes();
                    final int length = memberTypes.getLength();
                    for (int i = 0; i < length; ++i) {
                        if (typeDerivationOK(derived, (XSTypeDefinition) memberTypes.item(i), blockingConstraint)) {
                            return true;
                        }
View Full Code Here

                complexTypeAsserts.addXSObject((XSAssert) primaryAssertions.get(i));
            }
        }

        // add assertion facets from "complexType -> simpleContent -> restriction"
        XSSimpleTypeDefinition simpleContentType = complexTypeDef.getSimpleType();
        if (simpleContentType != null) {
            XSObjectList complexTypeFacets = simpleContentType.getMultiValueFacets();
            for (int i = 0; i < complexTypeFacets.getLength(); i++) {
                XSMultiValueFacet facet = (XSMultiValueFacet) complexTypeFacets.item(i);
                if (facet.getFacetKind() == XSSimpleTypeDefinition.FACET_ASSERT) {
                    Vector simpleContentAsserts = facet.getAsserts();
                    for (int simpleAssertIdx = 0; simpleAssertIdx < simpleContentAsserts.size(); simpleAssertIdx++) {
View Full Code Here

        XSObjectListImpl attrAssertList = new XSObjectListImpl();
       
        for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) {
            Augmentations attrAugs = attributes.getAugmentations(attrIndx);
            AttributePSVImpl attrPSVI = (AttributePSVImpl) attrAugs.getItem(Constants.ATTRIBUTE_PSVI);
            XSSimpleTypeDefinition attrType = (XSSimpleTypeDefinition) attrPSVI.getTypeDefinition();
            if (attrType != null) {
                // this accumulates assertions only for "simpleType -> restriction"
                XSObjectList facets = attrType.getMultiValueFacets();

                // simpleType variety is 'unknown/absent' at the moment                   
                short attrTypeVariety = XSSimpleTypeDefinition.VARIETY_ABSENT;

                if (facets.getLength() == 0 && attrType.getItemType() != null) {
                    // facets for "simpleType -> list"
                    attrTypeVariety = XSSimpleTypeDefinition.VARIETY_LIST;
                    facets = (XSObjectListImpl) attrType.getItemType().getMultiValueFacets();   
                }
                else if (attrType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                    attrTypeVariety = XSSimpleTypeDefinition.VARIETY_UNION;
                    // Special handling for assertions on "simpleType -> union" cases. Adding an assertion here,
                    // for determining the XSModel NamespaceContext. This particular assertion object is not
                    // actually evaluated. For simpleType's with variety union, assertions are later again determined
                    // in XMLAssertPsychopathImpl, which are evaluated to determine validity of an XML instance.              
                    XSAssertImpl assertImpl = getFirstAssertFromUnionMemberTypes(attrType.getMemberTypes());
                    if (assertImpl != null) {
                        assertImpl.setTypeDefinition(attrType);
                        assertImpl.setVariety(attrTypeVariety);
                        assertImpl.setAttrName(attributes.getLocalName(attrIndx));
                        assertImpl.setAttrValue(attributes.getValue(attrIndx));
View Full Code Here

     */
    private List getAssertsFromSimpleType(XSTypeDefinition typeDef) {
       
        List simpleTypeAsserts = null;

        XSSimpleTypeDefinition simpleTypeDef = (XSSimpleTypeDefinition) typeDef;                    

        XSObjectListImpl facets = (XSObjectListImpl) simpleTypeDef.getMultiValueFacets();

        if (facets.getLength() == 0 && simpleTypeDef.getItemType() != null) {
            // facets for "simpleType -> list"
            facets = (XSObjectListImpl) simpleTypeDef.getItemType().getMultiValueFacets();   
        }
        else if (simpleTypeDef.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
            // Special handling for assertions on "simpleType -> union" cases. Adding an assertion here,
            // for determining the NamespaceContext.
            XSAssertImpl assertImpl = getFirstAssertFromUnionMemberTypes(simpleTypeDef.getMemberTypes());
            if (assertImpl != null) {
                simpleTypeAsserts = new Vector();
                simpleTypeAsserts.add(assertImpl);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSSimpleTypeDefinition

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.