Class EscapeTextBuilderImpl

    • Constructor Detail

      • EscapeTextBuilderImpl

        public EscapeTextBuilderImpl​()
    • Method Detail

      • getEscapeTextMode

        public EscapeTextMode getEscapeTextMode​()
        Retrieves the escape text mode from the escape text mode property.
        Specified by:
        getEscapeTextMode in interface EscapeTextBuilder
        Returns:
        The escape text mode stored by the escape text mode property.
      • setEscapeTextMode

        public void setEscapeTextMode​(EscapeTextMode aEscapeTextMode)
        Sets the escape text mode for the escape text mode property.
        Specified by:
        setEscapeTextMode in interface EscapeTextBuilder
        Parameters:
        aEscapeTextMode - The escape text mode to be stored by the align text mode property.
      • getEscapeProperties

        public org.refcodes.structure.Property[] getEscapeProperties​()
        Gets the escape properties.
        Specified by:
        getEscapeProperties in interface EscapeTextBuilder
        Returns:
        the escape properties
      • setEscapeProperties

        public void setEscapeProperties​(org.refcodes.structure.Property... aProperties)
        Sets the escape properties.
        Specified by:
        setEscapeProperties in interface EscapeTextBuilder
        Parameters:
        aProperties - the new escape properties
      • addEscapeProperty

        public EscapeTextBuilder addEscapeProperty​(org.refcodes.structure.Property aProperty)
        Adds the escape property.
        Specified by:
        addEscapeProperty in interface EscapeTextBuilder
        Parameters:
        aProperty - the property
        Returns:
        the escape text builder
      • addEscapeProperty

        public EscapeTextBuilder addEscapeProperty​(java.lang.String aKey,
                                                   java.lang.String aValue)
        Adds the escape property.
        Specified by:
        addEscapeProperty in interface EscapeTextBuilder
        Parameters:
        aKey - the key
        aValue - the value
        Returns:
        the escape text builder
      • toStrings

        public java.lang.String[] toStrings​()
                                     throws java.lang.IllegalStateException
        The Strings being escaped by the builder upon the settings of the attributes.
        Specified by:
        toStrings in interface EscapeTextBuilder
        Specified by:
        toStrings in interface TextAccessor.TextProvider
        Returns:
        The according resulting String array
        Throws:
        java.lang.IllegalStateException
      • toEscaped

        protected java.lang.String[] toEscaped​(java.lang.String[] aText,
                                               java.util.List<org.refcodes.structure.Property> aProperties,
                                               EscapeTextMode aEscapeTextMode)
        To escaped.
        Parameters:
        aText - the text
        aProperties - the properties
        aEscapeTextMode - the escape text mode
        Returns:
        the string[]
      • toEscaped

        protected java.lang.String toEscaped​(java.lang.String aText,
                                             java.util.List<org.refcodes.structure.Property> aProperties,
                                             EscapeTextMode aEscapeTextMode)
        To escaped.
        Parameters:
        aText - the text
        aProperties - the properties
        aEscapeTextMode - the escape text mode
        Returns:
        the string
      • toEscaped

        public static java.lang.String toEscaped​(java.lang.String aUnEscaped,
                                                 java.lang.String[][] aEscapeMatrix)
        Escapes a text using the provided escape matrix which must be a two dimensional array with two elements per line and where the element at position 0 (of a line) represents the character and the element at position 1 (of a line) the escaped character.
        Parameters:
        aUnEscaped - The text to be escaped.
        aEscapeMatrix - The matrix to be used for escaping.
        Returns:
        The escape text as of the escape matrix.
      • toUnEscaped

        public static java.lang.String toUnEscaped​(java.lang.String aEscaped,
                                                   java.lang.String[][] aEscapeMatrix)
        Unescapes a text using the provided escape matrix which must be a two dimensional array with two elements per line and where the element at position 0 (of a line) represents the character and the element at position 1 (of a line) the escaped character.
        Parameters:
        aEscaped - The text to be unescaped.
        aEscapeMatrix - The matrix to be used for unescaping.
        Returns:
        The unescape text as of the escape matrix.
      • getText

        public java.lang.String[] getText​()
        Retrieves the text from the text property.
        Specified by:
        getText in interface TextAccessor
        Returns:
        The text stored by the text property.
      • setText

        public void setText​(java.lang.String... aText)
        Sets the text for the text property.
        Specified by:
        setText in interface TextAccessor.TextMutator
        Parameters:
        aText - The text to be stored by the text property.
      • withText

        public B withText​(java.lang.String... aText)
        With text.
        Specified by:
        withText in interface Text<B extends Text<B>>
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • withText

        public B withText​(java.util.Collection<java.lang.String> aText)
        With text.
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • toString

        public java.lang.String toString​()
        The String being build by the builder upon the settings of the attributes. In case more then one line has been set as input and the functionality of the builder is applied to each line in separate, then this method returns all of them lines concatenated with a line break between each of them (implementation depended).
        Specified by:
        toString in interface TextAccessor.TextProvider
        Overrides:
        toString in class java.lang.Object
        Returns:
        The according resulting String