/** * Get the type annotation to use for a given schema type * @param schemaType the schema type * @return the corresponding numeric type annotation */ public int getTypeAnnotation(SchemaType schemaType) { if (schemaType != null) { return schemaType.getFingerprint(); } else { return -1; } }
/** * 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 int getTypeAnnotation(int nodeNr) { if (typeArray == null) { return StandardNames.XS_UNTYPED; } return typeArray[nodeNr].getFingerprint(); }
/** * Get the type annotation to use for a given schema type * @param schemaType the schema type * @return the corresponding numeric type annotation */ public int getTypeAnnotation(SchemaType schemaType) { if (schemaType != null) { return schemaType.getFingerprint(); } else { return -1; } }
/** * 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 int getTypeAnnotation(int nodeNr) { if (typeArray == null) { return StandardNames.XS_UNTYPED; } return typeArray[nodeNr].getFingerprint(); }
/** * Create a ContentTypeTest * @param nodeKind the kind of nodes to be matched: always elements or attributes * @param schemaType the required type annotation, as a simple or complex schema type * @param config the Configuration, supplied because this KindTest needs access to schema information */ public ContentTypeTest(int nodeKind, SchemaType schemaType, Configuration config) { this.kind = nodeKind; this.schemaType = schemaType; this.requiredType = schemaType.getFingerprint(); if (requiredType == -1) { requiredType = StandardNames.XS_UNTYPED; // probably doesn't happen } this.config = config; }
/** * Create a ContentTypeTest * @param nodeKind the kind of nodes to be matched: always elements or attributes * @param schemaType the required type annotation, as a simple or complex schema type * @param config the Configuration, supplied because this KindTest needs access to schema information */ public ContentTypeTest(int nodeKind, SchemaType schemaType, Configuration config) { this.kind = nodeKind; this.schemaType = schemaType; this.requiredType = schemaType.getFingerprint(); if (requiredType == -1) { requiredType = StandardNames.XS_UNTYPED; // probably doesn't happen } this.config = config; }
/** * Check that the schema type of a node is a built-in type * @param type the type to be checked * @throws UnsupportedOperationException if the type is a user-defined type */ private void checkType(SchemaType type) { if ((type.getFingerprint() & NamePool.USER_DEFINED_MASK) != 0) { throw new UnsupportedOperationException("Cannot convert a user-typed node to a different name pool"); } }
/** * Check that the schema type of a node is a built-in type * @param type the type to be checked * @throws UnsupportedOperationException if the type is a user-defined type */ private void checkType(SchemaType type) { if ((type.getFingerprint() & NamePool.USER_DEFINED_MASK) != 0) { throw new UnsupportedOperationException("Cannot convert a user-typed node to a different name pool"); } }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return (other.getFingerprint() == getFingerprint()); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(/*@NotNull*/ SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return (other.getFingerprint() == getFingerprint()); }
/** * Get the type annotation */ public int getTypeAnnotation() { SchemaType st = getSchemaType(); return (st == null ? -1 : st.getFingerprint()); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Test whether this is the same type as another type. They are considered to be the same type * if they are derived from the same type definition in the original XML representation (which * can happen when there are multiple includes of the same file) */ public boolean isSameType(/*@NotNull*/ SchemaType other) { return other.getFingerprint() == getFingerprint(); }
/** * Get the name of the required type of the top-level element of the document to be validated. * @return the name of the required type of the document element, or null if no value has been set. */ public QName getDocumentElementTypeName() { if (documentElementType == null) { return null; } else { int fp = documentElementType.getFingerprint(); return new QName(new StructuredQName(config.getNamePool(), fp)); } }