Package org.exolab.castor.xml.schema

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


                        substitutionGroup);
            }
        }

        //-- @form
        Form form = element.getForm();
        if (form != null) {
            _atts.addAttribute(SchemaNames.FORM, CDATA, form.toString());
        }

        //-- @id
        String id = element.getId();
        if (id != null) {
View Full Code Here


        String value = schema.getTargetNamespace();
        if (value != null)
            _atts.addAttribute(SchemaNames.TARGET_NS_ATTR, CDATA, value);

        //-- attributeFormDefault
        Form form = schema.getAttributeFormDefault();
        if (form != null) {
            _atts.addAttribute(SchemaNames.ATTR_FORM_DEFAULT_ATTR, CDATA,
                form.toString());
        }
        //-- elementFormDefault
        form = schema.getElementFormDefault();
        if (form != null) {
            _atts.addAttribute(SchemaNames.ELEM_FORM_DEFAULT_ATTR, CDATA,
                form.toString());
        }

        //-- blockDefault
        BlockList blockList = schema.getBlockDefault();
        if (blockList != null) {
View Full Code Here

     * @return the targetNamespace of the parent schema of the wrapped structure.
     */
    public String getTargetNamespace() {
        String result = null;
        Schema schema = null;
        Form   form   = null;

        switch (_annotated.getStructureType()) {
            case Structure.ATTRIBUTE:
                AttributeDecl attribute = (AttributeDecl) _annotated;
                //-- resolve reference
                if (attribute.isReference()) {
                    attribute = attribute.getReference();
                }

                schema = attribute.getSchema();

                //-- top-level (use targetNamespace of schema)
                if (attribute.getParent() == schema) {
                    break;
                }

                //-- check form (qualified or unqualified)
                form = attribute.getForm();
                if (form == null) {
                    form = schema.getAttributeFormDefault();
                }

                if ((form == null) || form.isUnqualified()) {
                    //-- no targetNamespace by default
                    return null;
                }
                //-- use targetNamespace of schema
                break;
            case Structure.ELEMENT:
                //--resolve reference?
                ElementDecl element = (ElementDecl) _annotated;
                if (element.isReference()) {
                    element = element.getReference();
                }

                schema = element.getSchema();
                //-- top-level (use targetNamespace of schema)
                if (element.getParent() == schema) {
                    break;
                }

                //-- check form (qualified or unqualified)
                form = element.getForm();
                if (form == null) {
                    form = schema.getElementFormDefault();
                }

                //-- no targetNamespace by default
                if ((form == null) || form.isUnqualified()) {
                    return null;
                }
                //-- use targetNamespace of schema
                break;
            case Structure.COMPLEX_TYPE:
View Full Code Here

     * @return the targetNamespace of the parent schema of the wrapped structure.
     */
    public String getTargetNamespace() {
        String result = null;
        Schema schema = null;
        Form form = null;
       
        switch (_annotated.getStructureType()) {
            case Structure.ATTRIBUTE:
                AttributeDecl attribute = (AttributeDecl)_annotated;
                //-- resolve reference
                if (attribute.isReference())
                    attribute = attribute.getReference();
               
                schema = attribute.getSchema();
               
                //-- top-level (use targetNamespace of schema)
                if (attribute.getParent() == schema)
                    break;
               
                //-- check form (qualified or unqualified)
                form = attribute.getForm();
                if (form == null) {
                    form = schema.getAttributeFormDefault();
                }
                if ((form == null) || form.isUnqualified()) {
                    //-- no targetNamespace by default
                    return null;
                }
                //-- use targetNamespace of schema
                break;
            case Structure.ELEMENT:
                //--resolve reference?
                ElementDecl element = (ElementDecl)_annotated;
                if (element.isReference())
                    element = element.getReference();
                
                schema = element.getSchema();
                //-- top-level (use targetNamespace of schema)
                if (element.getParent() == schema)
                    break;
               
                //-- check form (qualified or unqualified)
                form = element.getForm();
                if (form == null) {
                    form = schema.getElementFormDefault();
                }
                if ((form == null) || form.isUnqualified()) {
                    //-- no targetNamespace by default
                    return null;
                }
                //-- use targetNamespace of schema
                break;
View Full Code Here

     * @return the targetNamespace of the parent schema of the wrapped structure.
     */
    public String getTargetNamespace() {
        String result = null;
        Schema schema = null;
        Form form = null;
       
        switch (_annotated.getStructureType()) {
            case Structure.ATTRIBUTE:
                AttributeDecl attribute = (AttributeDecl)_annotated;
                //-- resolve reference
                if (attribute.isReference())
                    attribute = attribute.getReference();
               
                schema = attribute.getSchema();
               
                //-- top-level (use targetNamespace of schema)
                if (attribute.getParent() == schema)
                    break;
               
                //-- check form (qualified or unqualified)
                form = attribute.getForm();
                if (form == null) {
                    form = schema.getAttributeFormDefault();
                }
                if ((form == null) || form.isUnqualified()) {
                    //-- no targetNamespace by default
                    return null;
                }
                //-- use targetNamespace of schema
                break;
            case Structure.ELEMENT:
                //--resolve reference?
                ElementDecl element = (ElementDecl)_annotated;
                if (element.isReference())
                    element = element.getReference();
                
                schema = element.getSchema();
                //-- top-level (use targetNamespace of schema)
                if (element.getParent() == schema)
                    break;
               
                //-- check form (qualified or unqualified)
                form = element.getForm();
                if (form == null) {
                    form = schema.getElementFormDefault();
                }
                if ((form == null) || form.isUnqualified()) {
                    //-- no targetNamespace by default
                    return null;
                }
                //-- use targetNamespace of schema
                break;
View Full Code Here

TOP

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

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.