Package org.exolab.castor.xml.schema

Examples of org.exolab.castor.xml.schema.Structure


               
                    _schema = group.getSchema();
                    group = null;
                    break;
                case Structure.GROUP:
                    Structure parent = ((Group)_annotated).getParent();
                    short structure = parent.getStructureType();
                    while (structure == Structure.GROUP) {
                        parent = ((Group)parent).getParent();
                        structure = parent.getStructureType();
                    }
                    if (structure == Structure.COMPLEX_TYPE)
                        _schema = ((ComplexType)parent).getSchema();
                    else if (structure == Structure.MODELGROUP)
                        _schema = ((ModelGroup)parent).getSchema();
View Full Code Here


                         //-- need to do a little counting here.                        
                         if (!userSpecified) {
                            String refName = element.getReferenceName();
                            int count = 0;
                            int index = 0;
                            Structure structure = element.getParent();
                            if (structure instanceof ContentModelGroup) {
                                ContentModelGroup cmg = (ContentModelGroup)structure;
                                Enumeration enumeration = cmg.enumerate();
                                while (enumeration.hasMoreElements()) {
                                    Structure tmpStruct = (Structure)enumeration.nextElement();
                                    if (tmpStruct.getStructureType() == Structure.ELEMENT) {
                                        ElementDecl tmpDecl = (ElementDecl)tmpStruct;
                                        if (tmpDecl.isReference()) {
                                            if (tmpDecl.getReferenceName().equals(refName)) {
                                                ++count;
                                                if (tmpDecl == element) {
View Full Code Here

            case Structure.MODELGROUP:
            case Structure.GROUP:
                Group group = (Group)annotated;
                //-- if the group is top-level, then
                //-- we always return 0
                Structure parent = group.getParent();
                if (parent != null) {
                    if (parent.getStructureType() == Structure.SCHEMA)
                        return 0;
                }               
                int minOccurs = group.getMinOccurs();               
                //-- if minOccurs == 1, then check to see
                //-- if all elements inside group are
View Full Code Here

            throw new IllegalArgumentException("Structure cannot be null");

        if (location == null)
            throw new IllegalArgumentException("location cannot be null");

        Structure parent = null;
        switch (structure.getStructureType()) {

            case Structure.ELEMENT:
                parent = ((ElementDecl)structure).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                location.append(PATH_SEPARATOR);
                location.append(((ElementDecl)structure).getName());
                break;

            case Structure.COMPLEX_TYPE:
                ComplexType complexType = (ComplexType)structure;
                parent = (complexType).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                if (complexType.getName() != null) {
                    location.append(COMPLEXTYPE_ID);
                    location.append(((ComplexType)structure).getName());
                }
                break;

            case Structure.MODELGROUP:
                ModelGroup group = (ModelGroup)structure;
                parent = group.getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                if (group.getName() != null) {
                    location.append(GROUP_ID);
                    location.append(group.getName());
                }
                break;

            case Structure.ATTRIBUTE:
                parent = ((AttributeDecl)structure).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                location.append(PATH_SEPARATOR);
                location.append(ATTRIBUTE_PREFIX);
                location.append(((AttributeDecl)structure).getName());
                break;
View Full Code Here

        boolean enumeration = false;

        //-- class name information
        String typeName = simpleType.getName();
        if (typeName == null) {
            Structure struct = simpleType.getParent();
            FactoryState fstate = null;
            switch (struct.getStructureType()) {
                case Structure.ATTRIBUTE:
                    typeName = ((AttributeDecl)struct).getName();
                    fstate = sgState.getCurrentFactoryState();
                    break;
                case Structure.ELEMENT:
View Full Code Here

                        String typeName = simpleType.getName();

                        //-- anonymous type
                        if (typeName == null) {
                            Structure parent = simpleType.getParent();
                            if (parent instanceof ElementDecl) {
                                typeName = ((ElementDecl)parent).getName();
                            }
                            else if (parent instanceof AttributeDecl) {
                                typeName = ((AttributeDecl)parent).getName();
View Full Code Here

            throw new IllegalArgumentException("Structure cannot be null");

        if (location == null)
            throw new IllegalArgumentException("location cannot be null");

        Structure parent = null;
        switch (structure.getStructureType()) {

            case Structure.ELEMENT:
                parent = ((ElementDecl)structure).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                location.append(PATH_SEPARATOR);
                location.append(((ElementDecl)structure).getName());
                break;

            case Structure.COMPLEX_TYPE:
                ComplexType complexType = (ComplexType)structure;
                parent = (complexType).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                if (complexType.getName() != null) {
                    location.append(COMPLEXTYPE_ID);
                    location.append(((ComplexType)structure).getName());
                }
                break;

            case Structure.MODELGROUP:
                ModelGroup group = (ModelGroup)structure;
                parent = group.getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                if (group.getName() != null) {
                    location.append(GROUP_ID);
                    location.append(group.getName());
                }
                break;

            case Structure.ATTRIBUTE:
                parent = ((AttributeDecl)structure).getParent();
                if (parent.getStructureType() != Structure.SCHEMA)
                   getSchemaLocation(parent, location);
                location.append(PATH_SEPARATOR);
                location.append(ATTRIBUTE_PREFIX);
                location.append(((AttributeDecl)structure).getName());
                break;
View Full Code Here

               
                    _schema = group.getSchema();
                    group = null;
                    break;
                case Structure.GROUP:
                    Structure parent = ((Group)_annotated).getParent();
                    short structure = parent.getStructureType();
                    while (structure == Structure.GROUP) {
                        parent = ((Group)parent).getParent();
                        structure = parent.getStructureType();
                    }
                    if (structure == Structure.COMPLEX_TYPE)
                        _schema = ((ComplexType)parent).getSchema();
                    else if (structure == Structure.MODELGROUP)
                        _schema = ((ModelGroup)parent).getSchema();
View Full Code Here

                        String typeName = simpleType.getName();

                        //-- anonymous type
                        if (typeName == null) {
                            Structure parent = simpleType.getParent();
                            if (parent instanceof ElementDecl) {
                                typeName = ((ElementDecl)parent).getName();
                            }
                            else if (parent instanceof AttributeDecl) {
                                typeName = ((AttributeDecl)parent).getName();
View Full Code Here

        boolean enumeration = false;

        //-- class name information
        String typeName = simpleType.getName();
        if (typeName == null) {
            Structure struct = simpleType.getParent();
            FactoryState fstate = null;
            switch (struct.getStructureType()) {
                case Structure.ATTRIBUTE:
                    typeName = ((AttributeDecl)struct).getName();
                    fstate = sgState.getCurrentFactoryState();
                    break;
                case Structure.ELEMENT:
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.Structure

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.