Package org.xmlunit.diff
Enum ComparisonType
- java.lang.Object
-
- java.lang.Enum<ComparisonType>
-
- org.xmlunit.diff.ComparisonType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ComparisonType>
public enum ComparisonType extends java.lang.Enum<ComparisonType>
The kinds of comparisons XMLUnit performs.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ATTR_NAME_LOOKUP
Search for an attribute with a name matching a specific attribute of the other node.ATTR_VALUE
Compare attribute's value.ATTR_VALUE_EXPLICITLY_SPECIFIED
Compare explicit/implicit status of attributes.CHILD_LOOKUP
Search for a child node matching a specific child node of the other node.CHILD_NODELIST_LENGTH
Compare number of child nodes.CHILD_NODELIST_SEQUENCE
Compare order of child nodes.DOCTYPE_NAME
If the documents both have DOCTYPEs, compare the names.DOCTYPE_PUBLIC_ID
If the documents both have DOCTYPEs, compare the PUBLIC identifiers.DOCTYPE_SYSTEM_ID
If the documents both have DOCTYPEs, compare the SYSTEM identifiers.ELEMENT_NUM_ATTRIBUTES
Compare number of attributes.ELEMENT_TAG_NAME
Compare element names.HAS_DOCTYPE_DECLARATION
Do both documents have a DOCTYPE (or neither of each)?NAMESPACE_PREFIX
Compare the node's namespace prefixes.NAMESPACE_URI
Compare the node's namespace URIs.NO_NAMESPACE_SCHEMA_LOCATION
Check whether both documents provide the same values for xsi:noNamspaceSchemaLocation (may even be null).NODE_TYPE
Compare the node types.PROCESSING_INSTRUCTION_DATA
Compare data of processing instructions.PROCESSING_INSTRUCTION_TARGET
Compare targets of processing instructions.SCHEMA_LOCATION
Check whether both documents provide the same values for xsi:schemaLocation (may even be null).TEXT_VALUE
Compare content of text nodes, comments and CDATA sections.XML_ENCODING
Do both documents specify the same encoding in their XML declaration?XML_STANDALONE
Do both documents specify the same standalone declaration in their XML declaration?XML_VERSION
Do both documents specify the same version in their XML declaration?
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
private boolean
doctypeComparison
-
Constructor Summary
Constructors Modifier Constructor Description private
ComparisonType()
private
ComparisonType(boolean doctypeComparison)
private
ComparisonType(java.lang.String description)
private
ComparisonType(java.lang.String description, boolean doctypeComparison)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
(package private) boolean
isDoctypeComparison()
static ComparisonType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ComparisonType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
XML_VERSION
public static final ComparisonType XML_VERSION
Do both documents specify the same version in their XML declaration?
-
XML_STANDALONE
public static final ComparisonType XML_STANDALONE
Do both documents specify the same standalone declaration in their XML declaration?
-
XML_ENCODING
public static final ComparisonType XML_ENCODING
Do both documents specify the same encoding in their XML declaration?
-
HAS_DOCTYPE_DECLARATION
public static final ComparisonType HAS_DOCTYPE_DECLARATION
Do both documents have a DOCTYPE (or neither of each)?This difference is most likely masked by a
CHILD_NODELIST_LENGTH
difference as the number of children of the document node is tested before the presence of the document type declaration.
-
DOCTYPE_NAME
public static final ComparisonType DOCTYPE_NAME
If the documents both have DOCTYPEs, compare the names.
-
DOCTYPE_PUBLIC_ID
public static final ComparisonType DOCTYPE_PUBLIC_ID
If the documents both have DOCTYPEs, compare the PUBLIC identifiers.
-
DOCTYPE_SYSTEM_ID
public static final ComparisonType DOCTYPE_SYSTEM_ID
If the documents both have DOCTYPEs, compare the SYSTEM identifiers.
-
SCHEMA_LOCATION
public static final ComparisonType SCHEMA_LOCATION
Check whether both documents provide the same values for xsi:schemaLocation (may even be null).
-
NO_NAMESPACE_SCHEMA_LOCATION
public static final ComparisonType NO_NAMESPACE_SCHEMA_LOCATION
Check whether both documents provide the same values for xsi:noNamspaceSchemaLocation (may even be null).
-
NODE_TYPE
public static final ComparisonType NODE_TYPE
Compare the node types.
-
NAMESPACE_PREFIX
public static final ComparisonType NAMESPACE_PREFIX
Compare the node's namespace prefixes.
-
NAMESPACE_URI
public static final ComparisonType NAMESPACE_URI
Compare the node's namespace URIs.
-
TEXT_VALUE
public static final ComparisonType TEXT_VALUE
Compare content of text nodes, comments and CDATA sections.
-
PROCESSING_INSTRUCTION_TARGET
public static final ComparisonType PROCESSING_INSTRUCTION_TARGET
Compare targets of processing instructions.
-
PROCESSING_INSTRUCTION_DATA
public static final ComparisonType PROCESSING_INSTRUCTION_DATA
Compare data of processing instructions.
-
ELEMENT_TAG_NAME
public static final ComparisonType ELEMENT_TAG_NAME
Compare element names.
-
ATTR_VALUE_EXPLICITLY_SPECIFIED
public static final ComparisonType ATTR_VALUE_EXPLICITLY_SPECIFIED
Compare explicit/implicit status of attributes.
-
ELEMENT_NUM_ATTRIBUTES
public static final ComparisonType ELEMENT_NUM_ATTRIBUTES
Compare number of attributes.
-
ATTR_VALUE
public static final ComparisonType ATTR_VALUE
Compare attribute's value.
-
CHILD_NODELIST_LENGTH
public static final ComparisonType CHILD_NODELIST_LENGTH
Compare number of child nodes.
-
CHILD_NODELIST_SEQUENCE
public static final ComparisonType CHILD_NODELIST_SEQUENCE
Compare order of child nodes.
-
CHILD_LOOKUP
public static final ComparisonType CHILD_LOOKUP
Search for a child node matching a specific child node of the other node.
-
ATTR_NAME_LOOKUP
public static final ComparisonType ATTR_NAME_LOOKUP
Search for an attribute with a name matching a specific attribute of the other node.
-
-
Method Detail
-
values
public static ComparisonType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ComparisonType c : ComparisonType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ComparisonType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getDescription
public java.lang.String getDescription()
-
isDoctypeComparison
boolean isDoctypeComparison()
-
-