Package org.apache.axiom.truth.xml
Class XMLSubject
- java.lang.Object
-
- com.google.common.truth.Subject
-
- org.apache.axiom.truth.xml.XMLSubject
-
public final class XMLSubject extends com.google.common.truth.Subject
Propositions for objects representing XML data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
com.google.common.truth.Subject.Factory<SubjectT extends com.google.common.truth.Subject,ActualT extends Object>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMLSubject
expandingEntityReferences()
Expand entity references; same asexpandingEntityReferences(true)
.XMLSubject
expandingEntityReferences(boolean value)
Specifies if entity references should be expanded.void
hasSameContentAs(Object other)
Fails unless the subject represents the same XML as the given object.XMLSubject
ignoringComments()
Ignore comments; same asignoringComments(true)
.XMLSubject
ignoringComments(boolean value)
Specifies if comments should be ignored.XMLSubject
ignoringElementContentWhitespace()
Ignore element content whitespace; same asignoringElementContentWhitespace(true)
.XMLSubject
ignoringElementContentWhitespace(boolean value)
Specifies if element content whitespace should be ignored.XMLSubject
ignoringNamespaceDeclarations()
Ignore all namespace declarations; same asignoringNamespaceDeclarations(true)
.XMLSubject
ignoringNamespaceDeclarations(boolean value)
Specifies if namespace declarations should be ignored.XMLSubject
ignoringNamespacePrefixes()
Ignore namespace prefixes; same asignoringNamespacePrefixes(true)
.XMLSubject
ignoringNamespacePrefixes(boolean value)
Specifies if namespace prefixes should be ignored.XMLSubject
ignoringPrologAndEpilog()
Ignore the prolog and epilog entirely; same asignoringPrologAndEpilog(true)
.XMLSubject
ignoringPrologAndEpilog(boolean value)
Specifies if the prolog and epilog should be ignored entirely.XMLSubject
ignoringRedundantNamespaceDeclarations()
Ignore redundant namespace declarations; same asignoringRedundantNamespaceDeclarations(true)
.XMLSubject
ignoringRedundantNamespaceDeclarations(boolean value)
Specify if redundant namespace declarations should be ignored.XMLSubject
ignoringWhitespace()
Ignore all whitespace; same asignoringWhitespace(true)
.XMLSubject
ignoringWhitespace(boolean value)
Specifies if whitespace should be ignored.XMLSubject
ignoringWhitespaceInPrologAndEpilog()
Ignore whitespace in the prolog and epilog; same asignoringWhitespaceInPrologAndEpilog(true)
.XMLSubject
ignoringWhitespaceInPrologAndEpilog(boolean value)
Specifies if whitespace in the prolog and epilog should be ignored.XMLSubject
treatingElementContentWhitespaceAsText()
Treat element content whitespace as simple text nodes; same astreatingElementContentWhitespaceAsText(true)
.XMLSubject
treatingElementContentWhitespaceAsText(boolean value)
Specifies how element content whitespace is to be treated.-
Methods inherited from class com.google.common.truth.Subject
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
-
-
-
-
Method Detail
-
ignoringComments
public XMLSubject ignoringComments()
Ignore comments; same asignoringComments(true)
.- Returns:
this
-
ignoringComments
public XMLSubject ignoringComments(boolean value)
Specifies if comments should be ignored.- Parameters:
value
-true
if comments should be ignored,false
otherwise- Returns:
this
-
ignoringElementContentWhitespace
public XMLSubject ignoringElementContentWhitespace()
Ignore element content whitespace; same asignoringElementContentWhitespace(true)
.- Returns:
this
-
ignoringElementContentWhitespace
public XMLSubject ignoringElementContentWhitespace(boolean value)
Specifies if element content whitespace should be ignored. Note that this only has an effect for documents that have a DTD.- Parameters:
value
-true
if element content whitespace should be ignored,false
otherwise- Returns:
this
-
ignoringWhitespace
public XMLSubject ignoringWhitespace()
Ignore all whitespace; same asignoringWhitespace(true)
.- Returns:
this
-
ignoringWhitespace
public XMLSubject ignoringWhitespace(boolean value)
Specifies if whitespace should be ignored.- Parameters:
value
-true
if all text nodes that contain only whitespace should be ignored,false
otherwise- Returns:
this
-
ignoringWhitespaceInPrologAndEpilog
public XMLSubject ignoringWhitespaceInPrologAndEpilog()
Ignore whitespace in the prolog and epilog; same asignoringWhitespaceInPrologAndEpilog(true)
.- Returns:
this
-
ignoringWhitespaceInPrologAndEpilog
public XMLSubject ignoringWhitespaceInPrologAndEpilog(boolean value)
Specifies if whitespace in the prolog and epilog should be ignored. This is especially useful when working with DOM documents because DOM strips whitespace from the prolog and epilog.- Parameters:
value
-true
if whitespace in the prolog and epilog should be ignored,false
otherwise- Returns:
this
-
ignoringPrologAndEpilog
public XMLSubject ignoringPrologAndEpilog()
Ignore the prolog and epilog entirely; same asignoringPrologAndEpilog(true)
.- Returns:
this
-
ignoringPrologAndEpilog
public XMLSubject ignoringPrologAndEpilog(boolean value)
Specifies if the prolog and epilog should be ignored entirely.- Parameters:
value
-true
if (text, comment and document type declaration) nodes in the prolog and epilog should be ignored,false
otherwise- Returns:
this
-
ignoringNamespaceDeclarations
public XMLSubject ignoringNamespaceDeclarations()
Ignore all namespace declarations; same asignoringNamespaceDeclarations(true)
.- Returns:
this
-
ignoringNamespaceDeclarations
public XMLSubject ignoringNamespaceDeclarations(boolean value)
Specifies if namespace declarations should be ignored.- Parameters:
value
-true
if namespace declarations should be ignored,false
otherwise- Returns:
this
-
ignoringNamespacePrefixes
public XMLSubject ignoringNamespacePrefixes()
Ignore namespace prefixes; same asignoringNamespacePrefixes(true)
.- Returns:
this
-
ignoringNamespacePrefixes
public XMLSubject ignoringNamespacePrefixes(boolean value)
Specifies if namespace prefixes should be ignored.- Parameters:
value
-true
if namespace prefixes are ignored when comparing elements and attributes,false
otherwise- Returns:
this
-
ignoringRedundantNamespaceDeclarations
public XMLSubject ignoringRedundantNamespaceDeclarations()
Ignore redundant namespace declarations; same asignoringRedundantNamespaceDeclarations(true)
.- Returns:
this
-
ignoringRedundantNamespaceDeclarations
public XMLSubject ignoringRedundantNamespaceDeclarations(boolean value)
Specify if redundant namespace declarations should be ignored. A namespace declaration is considered redundant if its presence doesn't modify the namespace context.- Parameters:
value
-true
if redundant namespace declarations should be ignored,false
if all namespace declarations should be compared- Returns:
this
-
expandingEntityReferences
public XMLSubject expandingEntityReferences()
Expand entity references; same asexpandingEntityReferences(true)
.- Returns:
this
-
expandingEntityReferences
public XMLSubject expandingEntityReferences(boolean value)
Specifies if entity references should be expanded.- Parameters:
value
-true
if entity references should be expanded and their replacement compared,false
if the entity references themselves should be compared- Returns:
this
-
treatingElementContentWhitespaceAsText
public XMLSubject treatingElementContentWhitespaceAsText()
Treat element content whitespace as simple text nodes; same astreatingElementContentWhitespaceAsText(true)
.- Returns:
this
-
treatingElementContentWhitespaceAsText
public XMLSubject treatingElementContentWhitespaceAsText(boolean value)
Specifies how element content whitespace is to be treated. Use this when comparing a document that has a DTD with a document that doesn't.- Parameters:
value
-true
if element whitespace should be considered as text nodes,false
if element whitespace should be considered as a distinct node type- Returns:
this
-
hasSameContentAs
public void hasSameContentAs(Object other)
Fails unless the subject represents the same XML as the given object.- Parameters:
other
- the object to compare with
-
-