Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSComplexTypeDefinition


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


      }
      buf.append(newline);
      XSTypeDefinition baseType = null;
      if (type instanceof XSComplexTypeDefinition)
      {
         XSComplexTypeDefinition t = (XSComplexTypeDefinition)type;

         baseType = t.getBaseType();
         //Check baseType is xsd:anyType
         if (baseType != null)
         {
            if (baseType.getNamespace() == Constants.NS_SCHEMA_XSD && baseType.getName().equals("anyType"))
               baseType = null; //Ignore this baseType
         }
         if (XSComplexTypeDefinition.CONTENTTYPE_SIMPLE == t.getContentType())
         {
            baseType = null; //ComplexType has a simplecontent
         }
      }
View Full Code Here

   public static XSElementDeclaration unwrapArrayType(XSTypeDefinition xst)
   {
      if (xst instanceof XSComplexTypeDefinition == false)
         return null;

      XSComplexTypeDefinition xc = (XSComplexTypeDefinition)xst;
      if (xc.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_EMPTY)
         return null;

      XSParticle xsp = xc.getParticle();
      if (xsp == null)
         return null;

      XSTerm xsterm = xsp.getTerm();
      if (xsterm instanceof XSModelGroup == false)
View Full Code Here

      /*xsp.setType(XSConstants.ELEMENT_DECLARATION);
       xsp.setMaxOccurs(-1);
       JBossXSElementDeclaration xsel = (JBossXSElementDeclaration)createXSElementDeclaration("name", utils.getSchemaBasicType("string"),  true);

       xsp.setTerm(xsel); */
      XSComplexTypeDefinition ct = new JBossXSComplexTypeDefinition(exname, ns);

      ((JBossXSComplexTypeDefinition)ct).setParticle(xsp);
      return ct;
   }
View Full Code Here

      StringBuilder buf = new StringBuilder();

      //Handle Complex Type
      if (xstype instanceof XSComplexTypeDefinition)
      {
         XSComplexTypeDefinition jxstype = (XSComplexTypeDefinition)xstype;
         String jxsTypeName = jxstype.getName();
         boolean isSimple = jxstype.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE;

         if (xstype.getAnonymous())
            buf.append("<complexType>");
         else buf.append("<complexType name='" + jxsTypeName + "'>");

         XSTypeDefinition xsbase = (XSTypeDefinition)jxstype.getBaseType();
         String baseType = null;
         if (xsbase != null && !("anyType".equals(xsbase.getName())))
            baseType = getPrefix(xsbase.getNamespace()) + ":" + xsbase.getName();

         if (baseType != null)
         {
            buf.append((isSimple) ? "<simpleContent>" : "<complexContent>");
            buf.append("<extension base='" + baseType + "'>");
         }

         XSParticle xsp = jxstype.getParticle();
         if (xsp != null)
            appendComplexTypeDefinition(buf, jxstype);

         XSObjectList list = jxstype.getAttributeUses();
         for (int i = 0; i < list.getLength(); i++)
         {
            XSAttributeUse use = (XSAttributeUse)list.item(i);
            XSAttributeDeclaration decl = use.getAttrDeclaration();
            buf.append(write(decl));
View Full Code Here

            short btype, dtype;
            if (eb.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                btype = ((XSSimpleTypeDefinition)eb.fType).getPrimitiveType().getBuiltInKind();
            }
            else {
                XSComplexTypeDefinition complex = (XSComplexTypeDefinition)eb.fType;
                if (complex.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
                    btype = complex.getSimpleType().getPrimitiveType().getBuiltInKind();
                }
                else {
                    btype = XSConstants.STRING_DT;
                }
            }
            if (ed.fType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                dtype = ((XSSimpleTypeDefinition)ed.fType).getPrimitiveType().getBuiltInKind();
            }
            else {
                XSComplexTypeDefinition complex = (XSComplexTypeDefinition)ed.fType;
                if (complex.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
                    dtype = complex.getSimpleType().getPrimitiveType().getBuiltInKind();
                }
                else {
                    dtype = XSConstants.STRING_DT;
                }
            }
View Full Code Here

     */
    private XSObjectListImpl getAssertsFromComplexType(XSTypeDefinition typeDef, XMLAttributes attributes) {
       
        XSObjectListImpl complexTypeAsserts = new XSObjectListImpl();

        XSComplexTypeDefinition complexTypeDef = (XSComplexTypeDefinition) typeDef;

        XSObjectList primaryAssertions = complexTypeDef.getAssertions();
        if (primaryAssertions.getLength() > 0) {
            for (int i = 0; i < primaryAssertions.getLength(); i++) {
                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) {
View Full Code Here

      if (!isComposite(decl, false))
      {
         return false;
      }

      XSComplexTypeDefinition typeDef = XSDUtil.getComplexTypeDef(decl);

      XSNamedMap namedMap = m_xsModel.getComponents(XSConstants.ELEMENT_DECLARATION);

      for (int i = 0; i < namedMap.getLength(); ++i)
      {
         XSElementDeclaration elemDecl = (XSElementDeclaration)namedMap.item(i);
        
         if (elemDecl.getTypeDefinition() == typeDef)
         {
            return true;
         }
      }

      if ("anyType".equals(typeDef.getName()))
      {
         return false;
      }

      if (!typeDef.getAnonymous())
      {
         if (getMessageRegistry().get(typeDef) == null)
         {
            createCompositeMessagePart(null, parseDescription(decl.getAnnotation()), null, typeDef, typeDef.getName(), decl.getNamespace(), decl.getNillable(), null);
         }

         return true;
      }
     
View Full Code Here

      namedMap = m_xsModel.getComponents(XSTypeDefinition.COMPLEX_TYPE);
     
      for (int i = 0; i < namedMap.getLength(); ++i)
      {
         XSComplexTypeDefinition typeDef = (XSComplexTypeDefinition)namedMap.item(i);
        
         if (!isComposite(typeDef, true))
         {
            continue;
         }
        
         if (!isRegistered(typeDef))
         {
            boolean bCreate = m_bAnyTypeFound;

            if (!bCreate)
            {
               // search for base types that have messages
               for (XSTypeDefinition baseType = typeDef.getBaseType(); baseType instanceof XSComplexTypeDefinition; baseType = baseType.getBaseType())
               {
                  if (isRegistered((XSComplexTypeDefinition)baseType))
                  {
                     bCreate = true;
                     break;
View Full Code Here

      assert isComposite(complexDef, parent == null);

      CompositeMessagePartInstance newInstance;
      Message newMsg = null;
      String sMsgName = sNodeName;
      XSComplexTypeDefinition base = findBase(complexDef);

      if (parent == null)
      {
         sMsgName = generateMessageName(sMsgName);
View Full Code Here

TOP

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

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.