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.SubjectPropositions 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 XMLSubjectexpandingEntityReferences()Expand entity references; same asexpandingEntityReferences(true).XMLSubjectexpandingEntityReferences(boolean value)Specifies if entity references should be expanded.voidhasSameContentAs(Object other)Fails unless the subject represents the same XML as the given object.XMLSubjectignoringComments()Ignore comments; same asignoringComments(true).XMLSubjectignoringComments(boolean value)Specifies if comments should be ignored.XMLSubjectignoringElementContentWhitespace()Ignore element content whitespace; same asignoringElementContentWhitespace(true).XMLSubjectignoringElementContentWhitespace(boolean value)Specifies if element content whitespace should be ignored.XMLSubjectignoringNamespaceDeclarations()Ignore all namespace declarations; same asignoringNamespaceDeclarations(true).XMLSubjectignoringNamespaceDeclarations(boolean value)Specifies if namespace declarations should be ignored.XMLSubjectignoringNamespacePrefixes()Ignore namespace prefixes; same asignoringNamespacePrefixes(true).XMLSubjectignoringNamespacePrefixes(boolean value)Specifies if namespace prefixes should be ignored.XMLSubjectignoringPrologAndEpilog()Ignore the prolog and epilog entirely; same asignoringPrologAndEpilog(true).XMLSubjectignoringPrologAndEpilog(boolean value)Specifies if the prolog and epilog should be ignored entirely.XMLSubjectignoringRedundantNamespaceDeclarations()Ignore redundant namespace declarations; same asignoringRedundantNamespaceDeclarations(true).XMLSubjectignoringRedundantNamespaceDeclarations(boolean value)Specify if redundant namespace declarations should be ignored.XMLSubjectignoringWhitespace()Ignore all whitespace; same asignoringWhitespace(true).XMLSubjectignoringWhitespace(boolean value)Specifies if whitespace should be ignored.XMLSubjectignoringWhitespaceInPrologAndEpilog()Ignore whitespace in the prolog and epilog; same asignoringWhitespaceInPrologAndEpilog(true).XMLSubjectignoringWhitespaceInPrologAndEpilog(boolean value)Specifies if whitespace in the prolog and epilog should be ignored.XMLSubjecttreatingElementContentWhitespaceAsText()Treat element content whitespace as simple text nodes; same astreatingElementContentWhitespaceAsText(true).XMLSubjecttreatingElementContentWhitespaceAsText(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-trueif comments should be ignored,falseotherwise- 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-trueif element content whitespace should be ignored,falseotherwise- 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-trueif all text nodes that contain only whitespace should be ignored,falseotherwise- 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-trueif whitespace in the prolog and epilog should be ignored,falseotherwise- 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-trueif (text, comment and document type declaration) nodes in the prolog and epilog should be ignored,falseotherwise- 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-trueif namespace declarations should be ignored,falseotherwise- 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-trueif namespace prefixes are ignored when comparing elements and attributes,falseotherwise- 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-trueif redundant namespace declarations should be ignored,falseif 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-trueif entity references should be expanded and their replacement compared,falseif 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-trueif element whitespace should be considered as text nodes,falseif 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
-
-