Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.SchemaField


                    {
                        writeString("_XT_" + QNameHelper.pretty(type.getName()));
                    }
                    else
                    {
                        SchemaField sf = type.getContainerField();
                        assert (sf != null);
                        if (sf.isAttribute())
                        {
                            writeString("_XR_" + QNameHelper.pretty(sf.getName()));
                        }
                        else
                        {
                            writeString("_XS_" + QNameHelper.pretty(sf.getName()));
                        }
                    }

                    return;
View Full Code Here


  public Class qname2class(QName qname) {
    logger.debug("Get XMLBeans class for Qname: " + qname);
          SchemaTypeLoader stl = XmlBeans.getContextTypeLoader();
          SchemaType st = stl.findType(qname);
          if (st == null) {
              SchemaField sf = stl.findElement(qname);
              if (sf != null) {
                  st = sf.getType();
              }
          }

          if (st != null) {
              Class xmlClass = st.getJavaClass();
View Full Code Here

     */
    private Class q2UserClass(QName qname) {
        SchemaTypeLoader stl = XmlBeans.getContextTypeLoader();
        SchemaType st = stl.findType(qname);
        if (st == null) {
            SchemaField sf = stl.findElement(qname);
            if (sf != null)
                st = sf.getType();
        }

        if (st != null && !st.isBuiltinType())
            return st.getJavaClass();
        else
View Full Code Here

    public Class q2Class(QName qType) {

        SchemaTypeLoader stl = XmlBeans.getContextTypeLoader();
        SchemaType st = stl.findType(qType);
        if (st == null) {
            SchemaField sf = stl.findElement(qType);
            if (sf != null) {
                st = sf.getType();
            }
        }

        if (st != null) {
            Class xmlClass = st.getJavaClass();
View Full Code Here

        {
            return "invalid type";
        }
       
        SchemaType outerType = sType.getOuterType();
        SchemaField container = sType.getContainerField();
       
        if (outerType.isAttributeType())
        {
            return "type of attribute " + readable(container.getName(), nsPrefix);
        }
        else if (outerType.isDocumentType())
        {
            return "type of element " + readable(container.getName(), nsPrefix);
        }
           
        if (container != null)
        {
            if (container.isAttribute())
            {
                return "type of " + container.getName().getLocalPart() + " attribute in " + readable(outerType, nsPrefix);
            }
            else
            {
                return "type of " + container.getName().getLocalPart() + " element in " + readable(outerType, nsPrefix);
            }
        }
       
        if (outerType.getBaseType() == sType)
            return "base type of " + readable(outerType, nsPrefix);
View Full Code Here

                            return null;
                        SchemaType[] subTypes = curType.getAnonymousTypes();
                        String localName = part.substring(offset);
                        for (int j = 0; j < subTypes.length; j++)
                        {
                            SchemaField field = subTypes[j].getContainerField();
                            if (field != null && !field.isAttribute() && field.getName().getLocalPart().equals(localName))
                            {
                                curType = subTypes[j];
                                break cases;
                            }
                        }
                        return null;
                    }
                    else
                    {
                        SchemaGlobalElement elt = findElement(QNameHelper.forLNS(part.substring(offset), uri));
                        if (elt == null)
                            return null;
                        curType = elt.getType();
                    }
                    break;

                case 'A':
                case 'Q': // distinguish qualified/unqualified TBD
                    if (curType != null)
                    {
                        if (curType.isSimpleType())
                            return null;
                        SchemaType[] subTypes = curType.getAnonymousTypes();
                        String localName = part.substring(offset);
                        for (int j = 0; j < subTypes.length; j++)
                        {
                            SchemaField field = subTypes[j].getContainerField();
                            if (field != null && field.isAttribute() && field.getName().getLocalPart().equals(localName))
                            {
                                curType = subTypes[j];
                                break cases;
                            }
                        }
View Full Code Here

                            return null;
                        SchemaType[] subTypes = curType.getAnonymousTypes();
                        String localName = part.substring(offset);
                        for (int j = 0; j < subTypes.length; j++)
                        {
                            SchemaField field = subTypes[j].getContainerField();
                            if (field != null && !field.isAttribute() && field.getName().getLocalPart().equals(localName))
                            {
                                curType = subTypes[j];
                                break cases;
                            }
                        }
                        return null;
                    }
                    else
                    {
                        SchemaGlobalElement elt = findElement(QNameHelper.forLNS(part.substring(offset), uri));
                        if (elt == null)
                            return null;
                        curType = elt.getType();
                    }
                    break;

                case 'A':
                case 'Q': // distinguish qualified/unqualified TBD
                    if (curType != null)
                    {
                        if (curType.isSimpleType())
                            return null;
                        SchemaType[] subTypes = curType.getAnonymousTypes();
                        String localName = part.substring(offset);
                        for (int j = 0; j < subTypes.length; j++)
                        {
                            SchemaField field = subTypes[j].getContainerField();
                            if (field != null && field.isAttribute() && field.getName().getLocalPart().equals(localName))
                            {
                                curType = subTypes[j];
                                break cases;
                            }
                        }
View Full Code Here

                    {
                        writeString("_XT_" + QNameHelper.pretty(type.getName()));
                    }
                    else
                    {
                        SchemaField sf = type.getContainerField();
                        assert (sf != null);
                        if (sf.isAttribute())
                        {
                            writeString("_XR_" + QNameHelper.pretty(sf.getName()));
                        }
                        else
                        {
                            writeString("_XS_" + QNameHelper.pretty(sf.getName()));
                        }
                    }

                    return;
View Full Code Here

        if (_filename != null)
            return _filename;
        if (getOuterType() != null)
            return getOuterType().getSourceName();

        SchemaField field = getContainerField();
        if (field != null)
        {
            if (field instanceof SchemaGlobalElement)
                return ((SchemaGlobalElement)field).getSourceName();
            if (field instanceof SchemaGlobalAttribute)
View Full Code Here

    public SchemaType instanceType()
        { synchronized (monitor()) { return isNil() ? null : schemaType(); } }

    private SchemaField schemaField() {
        SchemaType st = schemaType();
        SchemaField field;

        // First check if this field has an anonymous type
        field = st.getContainerField();

        if (field == null)
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.SchemaField

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.