com.groupdocs.redaction.redactions

Class AnnotationRedaction



  • public class AnnotationRedaction
    extends Redaction

    Represents a redaction that replaces annotation text (comments, etc.) matching a given regular expression.

    • Constructor Detail

      • AnnotationRedaction

        public AnnotationRedaction(String pattern,
                           String replacement)

        Initializes a new instance of AnnotationRedaction class.

        Parameters:
        pattern - Regular expression to match
        replacement - Textual replacement for matched text
      • AnnotationRedaction

        public AnnotationRedaction(Pattern regex,
                           String replacement)

        Initializes a new instance of AnnotationRedaction class.

        Parameters:
        regex - Regular expression to match
        replacement - Textual replacement for matched text
    • Method Detail

      • getExpression

        public final Pattern getExpression()

        Gets the regular expression to match.

        Returns:
        The regular expression to match.
      • getReplacement

        public final String getReplacement()

        Gets a textual replacement for matched text.

        Returns:
        A textual replacement for matched text.
      • 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