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 = 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 = 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

    {
        checkAttributeNameMatch(element, attributeName, child);

        for (final ChildType childrenType : childrenTypes)
        {
            final TypeInfo typeInfo = (TypeInfo) child;

            if (((childrenType.ns.equals(typeInfo.getTypeNamespace()) && childrenType.name.equals(typeInfo.getTypeName())))
                || typeInfo.isDerivedFrom(childrenType.ns, childrenType.name, TypeInfo.DERIVATION_EXTENSION))
            {

                throw new CheckExclusiveAttributesAndChildrenException(
                    "Element " + SpringXMLUtils.elementToString(element) + " can't contain child of type "
                                    + childrenType + " because it defines attribute " + attributeName);
View Full Code Here

     * <p>
     * Since DTD has a very limited type names, we can actually
     * cache the {@link TypeInfo} objects.
     */
    public static TypeInfo getDTDTypeInfo( String name ) {
        TypeInfo t = (TypeInfo)dtdCache.get(name);
        if(t==null) throw new IllegalArgumentException("Unknown DTD datatype "+name);
        return t;
    }
View Full Code Here

        /**
         * Receive notification of the start of an element.
         */
        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
            TypeInfo etype = provider.getElementTypeInfo();
            StringBuffer sb = new StringBuffer(100);
            for (int i=0; i<indent; i++) {
                sb.append("  ");
            }
            sb.append("Element " + qName);
            sb.append(" of type {" + etype.getTypeNamespace() + '}' + etype.getTypeName());
            System.out.println(sb.toString());
            for (int a=0; a<attributes.getLength(); a++) {
                TypeInfo atype = provider.getAttributeTypeInfo(a);
                boolean spec = provider.isSpecified(a);
                sb.setLength(0);
                for (int i=0; i<indent+2; i++) {
                    sb.append("  ");
                }
                sb.append("Attribute " + attributes.getQName(a) + (spec ? " (specified)" : (" (defaulted)")));
                if (atype == null) {
                    sb.append(" of unknown type");
                } else {
                    sb.append(" of type {" + atype.getTypeNamespace() + '}' + atype.getTypeName());
                }
                System.out.println(sb.toString());
            }
            indent++;
        }
View Full Code Here

     * <p>
     * Since DTD has a very limited type names, we can actually
     * cache the {@link TypeInfo} objects.
     */
    public static TypeInfo getDTDTypeInfo( String name ) {
        TypeInfo t = (TypeInfo)dtdCache.get(name);
        if(t==null) throw new IllegalArgumentException("Unknown DTD datatype "+name);
        return t;
    }
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

   
    /** 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

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.