Package org.w3c.dom

Examples of org.w3c.dom.TypeInfo


    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = attr.getSchemaTypeInfo();
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here


   
    /** Start element. */
    public void startElement(String uri, String localName, String qname,
                             Attributes attributes) throws SAXException {

        TypeInfo type;
        printIndent();
        fOut.print("startElement(");
        fOut.print("name=");
        printQName(uri, localName);
        fOut.print(',');
        fOut.print("type=");
        if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getElementTypeInfo()) != null) {
            printQName(type.getTypeNamespace(), type.getTypeName());
        }
        else {
            fOut.print("null");
        }
        fOut.print(',');
        fOut.print("attributes=");
        if (attributes == null) {
            fOut.println("null");
        }
        else {
            fOut.print('{');
            int length = attributes.getLength();
            for (int i = 0; i < length; i++) {
                if (i > 0) {
                    fOut.print(',');
                }
                String attrURI = attributes.getURI(i);
                String attrLocalName = attributes.getLocalName(i);
                fOut.print('{');
                fOut.print("name=");
                printQName(attrURI, attrLocalName);
                fOut.print(',');
                fOut.print("type=");
                if (fTypeInfoProvider != null && (type = fTypeInfoProvider.getAttributeTypeInfo(i)) != null) {
                    printQName(type.getTypeNamespace(), type.getTypeName());
                }
                else {
                    fOut.print("null");
                }
                fOut.print(',');
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = attr.getSchemaTypeInfo();
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

                }
            }
        }
       
        Attr attr = (Attr)attrs.get(0);
        TypeInfo typeInfo = null;
        String attrType = null;
       
        try {
          typeInfo = attr.getSchemaTypeInfo();
            if (typeInfo != null) {
            attrType = typeInfo.getTypeName();
            }
        } catch (Throwable t) {
          ;
        }
       
View Full Code Here

    }

    @Test
    public void testGetSchemaTypeInfo() throws Exception {
        final XAttr attr = new XAttr("a", "");
        final TypeInfo a = attr.getSchemaTypeInfo();
        assertThat(a.getTypeName(), is(nullValue()));
        assertThat(a.getTypeNamespace(), is(nullValue()));
    }
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

      * @see javax.xml.stream.XMLStreamReader#getAttributeType(int)
      */
    public String getAttributeType(int index) {
        String attrType = null;   
        Attr attr = (Attr)getAttributes().get(index);
        TypeInfo typeInfo = attr.getSchemaTypeInfo();
      if (typeInfo != null) {
        attrType = typeInfo.getTypeName();
        }
     
        if (attrType == null) {
            try {
                attrType = (String) attr.getUserData(SAAJConverter.OM_ATTRIBUTE_KEY);
View Full Code Here

    public String getAttributeType(int i) {
        Attr attr = getAttribute(i);
        if (attr.isId()) {
            return "ID";
        }
        TypeInfo schemaType = null;
        try {
            schemaType = attr.getSchemaTypeInfo();
        } catch (Throwable t) {
            //DOM level 2?
            schemaType = null;
        }
        return (schemaType == null) ? "CDATA"
            : schemaType.getTypeName() == null ? "CDATA" : schemaType.getTypeName();
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.TypeInfo

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.