Class XMLSubject


  • public final class XMLSubject
    extends com.google.common.truth.Subject
    Propositions for objects representing XML data.
    • Method Detail

      • ignoringComments

        public XMLSubject ignoringComments()
        Ignore comments; same as ignoringComments(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 as ignoringElementContentWhitespace(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 as ignoringWhitespace(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 as ignoringWhitespaceInPrologAndEpilog(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 as ignoringPrologAndEpilog(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 as ignoringNamespaceDeclarations(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 as ignoringNamespacePrefixes(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 as ignoringRedundantNamespaceDeclarations(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 as expandingEntityReferences(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 as treatingElementContentWhitespaceAsText(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