com.groupdocs.redaction.redactions

Class ExactPhraseRedaction



  • public class ExactPhraseRedaction
    extends TextRedaction

    Represents a text redaction that replaces exact phrase in the document's text, case insensitive by default.

    • Constructor Detail

      • ExactPhraseRedaction

        public ExactPhraseRedaction(String searchPhrase,
                            ReplacementOptions options)

        Initializes a new instance of ExactPhraseRedaction class in case insensitive mode.

        Parameters:
        searchPhrase - String to search and replace
        options - Replacement options (textual, color)
      • ExactPhraseRedaction

        public ExactPhraseRedaction(String searchPhrase,
                            boolean isCaseSensitive,
                            ReplacementOptions options)

        Initializes a new instance of ExactPhraseRedaction class.

        Parameters:
        searchPhrase - String to search and replace
        isCaseSensitive - True if case sensitive search is required
        options - Replacement options (textual, color)
    • Method Detail

      • getSearchPhrase

        public final String getSearchPhrase()

        Gets the string to search and replace.

        Returns:
        The string to search and replace.
      • isCaseSensitive

        public final boolean isCaseSensitive()

        Gets a value indicating whether the search is case-sensitive or not.

        Returns:
        A value indicating whether the search is case-sensitive or not.
      • applyTo

        public RedactorLogEntry applyTo(DocumentFormatInstance formatInstance)

        Applies the redaction to a given format instance.

        Specified by:
        applyTo in class Redaction
        Parameters:
        formatInstance - An instance of a document to apply redaction
        Returns:
        Status of the redaction: success/failure and error message if any