Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSObject


     * @return List of siblings.
     */
    public static List<XSParticle> splitParticlesForChoice(XSModelGroup modelGroup, XSParticle particle) {
        List<XSParticle> siblings = new ArrayList<XSParticle>();
        for (int i = 0; i < modelGroup.getParticles().getLength(); i++) {
            XSObject item = modelGroup.getParticles().item(i);
            if (item instanceof XSParticle) {
                XSParticle currentParticle = (XSParticle) item;
                if (currentParticle != particle) {
                    siblings.add(currentParticle);
                }
View Full Code Here


     */
    public static void splitParticlesForSequence(XSModelGroup modelGroup, XSParticle particle,
            List<XSParticle> previousSiblings, List<XSParticle> followingSiblings) {
        boolean foundSelf = false;
        for (int i = 0; i < modelGroup.getParticles().getLength(); i++) {
            XSObject item = modelGroup.getParticles().item(i);
            if (item instanceof XSParticle) {
                XSParticle currentParticle = (XSParticle) item;
                if (!foundSelf) {
                    if (currentParticle == particle) {
                        foundSelf = true;
View Full Code Here

     * @return Root element.
     */
    public XSElementDeclaration findRootElement(XSModel model, String rootElementName) {
        XSNamedMap elementMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
        for (int i = 0; i < elementMap.getLength(); i++) {
            XSObject item = elementMap.item(i);
            if (item.getType() == XSConstants.ELEMENT_DECLARATION) {
                if (item.getName().equals(rootElementName)) {
                    return (XSElementDeclaration) item;
                }
            }
        }
        return null;
View Full Code Here

     */
    public void start(XSModel model) {
        this.model = model;
        XSNamedMap elementMap = model.getComponents(XSConstants.ELEMENT_DECLARATION);
        for (int i = 0; i < elementMap.getLength(); i++) {
            XSObject item = elementMap.item(i);
            if (item.getType() == XSConstants.ELEMENT_DECLARATION) {
                handleElement((XSElementDeclaration) item);
            }
        }
    }
View Full Code Here

    *   name and namespace URI, or <code>null</code> if they do not
    *   identify any object in this map.
    */
   public XSObject itemByName(String namespace, String localName)
   {
      XSObject xso = null;
      //Since our list may contain types from xerces implementation
      for(XSObject obj: list)
      {
         if(localName.equals(obj.getName()) &&
               namespace.equals(obj.getNamespace()))
View Full Code Here

      //Now that we have the schema, lets build the types for the schema
      XSNamedMap xsnamedmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
      int len = xsnamedmap != null ? xsnamedmap.getLength() : 0;
      for (int i = 0; i < len; i++)
      {
         XSObject type = xsnamedmap.item(i);
         if (type instanceof XSComplexTypeDefinition)
         {
            XSComplexTypeDefinition ctype = (XSComplexTypeDefinition)type;
            //Ignore xsd:anyType
            String nsuri = type.getNamespace();
            String tname = type.getName();
            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            xsdJava.createJavaFile(ctype, dirloc, packageName, xsmodel);
         }
         else if (type instanceof XSSimpleTypeDefinition)
         {
            XSSimpleTypeDefinition stype = (XSSimpleTypeDefinition)type;
            //Ignore xsd:anyType
            String nsuri = type.getNamespace();
            String tname = type.getName();
            if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
            xsdJava.createJavaFile(stype, dirloc, packageName, xsmodel);
         }
      }
View Full Code Here

        // do not add null ;)
        final XSObjectListImpl xsoList;
        if (typesWithSameName.containsKey(qname)) {
            xsoList = typesWithSameName.get(qname);
            for (int i = 0; i < xsoList.getLength(); ++i) {
                XSObject object = xsoList.item(i);
                // check for duplicate types
                if (XSModelHelper.isSameTypeDefinition(object, type)) { return; }
            }
            xsoList.add(type);
        }
View Full Code Here

        if (XSModelHelper.isSameTypeDefinition(element, type)) { return; }

        if (usedBy.containsKey(type)) {
            final XSObjectListImpl objectList = usedBy.get(type);
            for (int i = 0; i < objectList.getLength(); ++i) {
                XSObject object = objectList.item(i);
                // check for duplicate types
                if (XSModelHelper.isSameTypeDefinition(object, element)) { return; }
            }
            objectList.add(element);
        }
View Full Code Here

    }

    private static List<XSObject> createModel(XSObject object) {
        List<XSObject> list = new ArrayList<XSObject>();
        list.add(object);
        XSObject parent = object;
        while (null != (parent = XSModelHelper.getBaseType(parent))) {
            if (list.contains(parent)) {
                break;
            }
            list.add(parent);
View Full Code Here

        // do not add null ;)
        final XSObjectListImpl xsoList;
        if (similarTypes.containsKey(signatureDigest)) {
            xsoList = similarTypes.get(signatureDigest);
            for (int i = 0; i < xsoList.getLength(); ++i) {
                XSObject object = xsoList.item(i);
                // check for duplicate types
                if (XSModelHelper.isSameTypeDefinition(object, type)) { return; }
            }
            xsoList.add(type);
        }
View Full Code Here

TOP

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

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.