Class ReplaceTextBuilder

    • Constructor Detail

      • ReplaceTextBuilder

        public ReplaceTextBuilder()
    • Method Detail

      • getReplaceText

        public String getReplaceText()
        Retrieves the replace text from the replace text property.
        Returns:
        The replace text stored by the replace text property.
      • setReplaceText

        public void setReplaceText​(String aReplaceText)
        Sets the replace text for the replace text property.
        Parameters:
        aReplaceText - The replace text to be stored by the text align mode property.
      • getFindText

        public String getFindText()
        Retrieves the find text from the find text property.
        Returns:
        The find text stored by the find text property.
      • setFindText

        public void setFindText​(String aFindText)
        Sets the find text for the find text property.
        Parameters:
        aFindText - The find text to be stored by the text align mode property.
      • withReplaceText

        public ReplaceTextBuilder withReplaceText​(String aReplaceText)
        Sets the replace text for the replace text property.
        Parameters:
        aReplaceText - The replace text to be stored by the text align mode property.
        Returns:
        The builder for applying multiple build operations.
      • withFindText

        public ReplaceTextBuilder withFindText​(String aFindText)
        Sets the find text for the find text property.
        Parameters:
        aFindText - The find text to be stored by the text align mode property.
        Returns:
        The builder for applying multiple build operations.
      • asReplaced

        public static String[] asReplaced​(String[] aText,
                                          String aFindText,
                                          String aReplaceText)
        Replaces a text by an other text in a String array.
        Parameters:
        aText - The text to be processed ('find-and-replace').
        aFindText - The text which has to be replaced.
        aReplaceText - The text that replaces the original.
        Returns:
        The number of replacements done.
      • asReplaced

        public static String asReplaced​(String aText,
                                        String aFindText,
                                        String aReplaceText)
        Replaces all occurrences of a find-String with a replace- String in a text and returns the find-and-replace String.
        Parameters:
        aText - The text to be processed ('find-and-replace').
        aFindText - The String to be searched and replaced.
        aReplaceText - The String which will replace the searched String.
        Returns:
        Description is currently not available!
      • asReplaced

        public static int asReplaced​(StringBuffer aTextBuffer,
                                     String aFindText,
                                     String aReplaceText)
        Replaces a text by an other text in a StringBuffer.
        Parameters:
        aTextBuffer - The text to be processed ('find-and-replace').
        aFindText - The text which has to be replaced.
        aReplaceText - The text that replaces the original.
        Returns:
        The number of replacements done.
      • getText

        public 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​(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.
      • toString

        public 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 Object
        Returns:
        The according resulting String