Class MicroText

    • Field Detail

      • DEFAULT_IGNORABLE_WHITESPACE

        public static final boolean DEFAULT_IGNORABLE_WHITESPACE
        By default the text is not ignorable whitespaces
        See Also:
        Constant Field Values
      • DEFAULT_ESCAPE

        public static final boolean DEFAULT_ESCAPE
        By default the text should be XML escaped when emitting to a file etc.
        See Also:
        Constant Field Values
    • Method Detail

      • getNodeName

        @Nonnull
        @Nonempty
        public String getNodeName()
        Specified by:
        getNodeName in interface IMicroNode
        Returns:
        Just an abstract name that depends on the implementing class. For IMicroElement nodes this is the same as the tag name.
      • appendData

        public void appendData​(@Nonnull
                               char[] aChars,
                               @Nonnegative
                               int nOfs,
                               @Nonnegative
                               int nLen)
        Description copied from interface: IMicroDataAware
        Append characters to the string.
        Specified by:
        appendData in interface IMicroDataAware
        Parameters:
        aChars - Base character array. May not be null.
        nOfs - Offset to start copying. Must be ≥ 0.
        nLen - Number of chars to take. Must be ≥ 0.
      • appendData

        public void appendData​(char cChar)
        Description copied from interface: IMicroDataAware
        Append a character to the string.
        Specified by:
        appendData in interface IMicroDataAware
        Parameters:
        cChar - The character to append
      • prependData

        public void prependData​(@Nonnull
                                char[] aChars,
                                @Nonnegative
                                int nOfs,
                                @Nonnegative
                                int nLen)
        Description copied from interface: IMicroDataAware
        Add characters to the beginning of the current data.
        Specified by:
        prependData in interface IMicroDataAware
        Parameters:
        aChars - Base character array. May not be null.
        nOfs - Offset to start copying. Must be ≥ 0.
        nLen - Number of chars to take. Must be ≥ 0.
      • prependData

        public void prependData​(char cChar)
        Description copied from interface: IMicroDataAware
        Add a character to the beginning of the current data.
        Specified by:
        prependData in interface IMicroDataAware
        Parameters:
        cChar - The character to preprend
      • setData

        public void setData​(@Nullable
                            CharSequence sData)
        Description copied from interface: IMicroDataAware
        Change the character sequence. Any previously set characters are lost.
        Specified by:
        setData in interface IMicroDataAware
        Parameters:
        sData - The new character sequence to be set.
      • isElementContentWhitespace

        public boolean isElementContentWhitespace()
        Description copied from interface: IMicroText
        Check whether the text node consists solely of whitespaces. This may be helpful in detecting XML that has been indented :)
        Specified by:
        isElementContentWhitespace in interface IMicroText
        Returns:
        true if the text node consists solely of whitespaces (blank, tab etc.).
      • isEscape

        public boolean isEscape()
        Specified by:
        isEscape in interface IMicroText
        Returns:
        true if the content of this text node should be masked, and false if not. By default a text node should always be masked.
      • isEqualContent

        public boolean isEqualContent​(@Nullable
                                      IMicroNode o)
        Description copied from interface: IMicroNode
        As instances of this class may not implement equals/hashCode we need a way to determine, if 2 nodes are equal by content.
        Specified by:
        isEqualContent in interface IMicroNode
        Parameters:
        o - The node to compare to this.
        Returns:
        true if the nodes are of the same type and the same content, false otherwise.