/** * Get the type annotation * * @return the type annotation of the base node */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the schema type information for this node. * * @return the type information. Returns null for an untyped node. */ /*@Nullable*/ public TypeInfo getSchemaTypeInfo() { SchemaType type = node.getSchemaType(); if (type == null || Untyped.getInstance().equals(type) || BuiltInAtomicType.UNTYPED_ATOMIC.equals(type)) { return null; } return new TypeInfoImpl(node.getConfiguration(), type); }
/** * Get the schema type information for this node. * * @return the type information. Returns null for an untyped node. */ /*@Nullable*/ public TypeInfo getSchemaTypeInfo() { SchemaType type = node.getSchemaType(); if (type == null || Untyped.getInstance().equals(type) || BuiltInAtomicType.UNTYPED_ATOMIC.equals(type)) { return null; } return new TypeInfoImpl(node.getConfiguration(), type); }
/** * Get the type annotation of a node. Applies only to document, element, text, * processing instruction, and comment nodes. * * @param nodeNr the node whose type annotation is required * @return the fingerprint of the type annotation for elements and attributes, otherwise undefined. */ public SchemaType getSchemaType(int nodeNr) { if (typeArray == null) { return Untyped.getInstance(); } return typeArray[nodeNr]; }
/** * Get the type annotation * * @return the type annotation of the base node */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of a node. Applies only to document, element, text, * processing instruction, and comment nodes. * * @param nodeNr the node whose type annotation is required * @return the fingerprint of the type annotation for elements and attributes, otherwise undefined. */ public SchemaType getSchemaType(int nodeNr) { if (typeArray == null) { return Untyped.getInstance(); } return typeArray[nodeNr]; }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of the current attribute or element node, or atomic value. * The result of this method is undefined unless the most recent event was START_ELEMENT, * ATTRIBUTE, or ATOMIC_VALUE. * * @return the type annotation. */ public SchemaType getSchemaType() { if (currentEvent == START_ELEMENT) { return Untyped.getInstance(); } else if (currentEvent == ATTRIBUTE) { return BuiltInAtomicType.UNTYPED_ATOMIC; } else { return null; } }
/** * Get the type annotation of the current attribute or element node, or atomic value. * The result of this method is undefined unless the most recent event was START_ELEMENT, * ATTRIBUTE, or ATOMIC_VALUE. * * @return the type annotation. */ public SchemaType getSchemaType() { if (currentEvent == START_ELEMENT) { return Untyped.getInstance(); } else if (currentEvent == ATTRIBUTE) { return BuiltInAtomicType.UNTYPED_ATOMIC; } else { return null; } }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p/> * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p/> * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p/> * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { return Untyped.getInstance(); }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { if (typeAnnotation == null) { if (kind == Type.ELEMENT) { return Untyped.getInstance(); } else if (kind == Type.ATTRIBUTE) { return BuiltInAtomicType.UNTYPED_ATOMIC; } } return typeAnnotation; }
/** * Get the type annotation of this node, if any. The type annotation is represented as * SchemaType object. * <p>Types derived from a DTD are not reflected in the result of this method.</p> * * @return For element and attribute nodes: the type annotation derived from schema * validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema * validation). For comments, text nodes, processing instructions, and namespaces: null. * For document nodes, either xs:untyped if the document has not been validated, or * xs:anyType if it has. * @since 9.4 */ public SchemaType getSchemaType() { if (typeAnnotation == null) { if (kind == Type.ELEMENT) { return Untyped.getInstance(); } else if (kind == Type.ATTRIBUTE) { return BuiltInAtomicType.UNTYPED_ATOMIC; } } return typeAnnotation; }
/** * Set the type annotation of an element node * * @param nodeNr the node whose type annotation is to be set * @param type the type annotation */ void setElementAnnotation(int nodeNr, SchemaType type) { if (!type.equals(Untyped.getInstance())) { if (typeArray == null) { typeArray = new SchemaType[nodeKind.length]; Arrays.fill(typeArray, 0, nodeKind.length, Untyped.getInstance()); } assert typeArray != null; typeArray[nodeNr] = type; } }
/** * Set the type annotation of an element node * * @param nodeNr the node whose type annotation is to be set * @param type the type annotation */ void setElementAnnotation(int nodeNr, SchemaType type) { if (!type.equals(Untyped.getInstance())) { if (typeArray == null) { typeArray = new SchemaType[nodeKind.length]; Arrays.fill(typeArray, 0, nodeKind.length, Untyped.getInstance()); } assert typeArray != null; typeArray[nodeNr] = type; } }
/** * Ask whether the document contains any nodes whose type annotation is anything other than * UNTYPED * * @return true if the document contains elements whose type is other than UNTYPED */ public boolean isTyped() { return documentElement != null && documentElement.getSchemaType() != Untyped.getInstance(); }
/** * Get the type annotation * * @return the type annotation of the base node */ public SchemaType getSchemaType() { if (documentElement == null || documentElement.getSchemaType() == Untyped.getInstance()) { return Untyped.getInstance(); } else { return AnyType.getInstance(); } }
/** * Get the type annotation * * @return the type annotation of the base node */ public SchemaType getSchemaType() { if (documentElement == null || documentElement.getSchemaType() == Untyped.getInstance()) { return Untyped.getInstance(); } else { return AnyType.getInstance(); } }