com.groupdocs.redaction.redactions

Class MetadataSearchRedaction



  • public class MetadataSearchRedaction
    extends MetadataRedaction

    Represents a metadata redaction that searches and redacts metadata using regular expressions, matching keys and/or values.

    • Constructor Detail

      • MetadataSearchRedaction

        public MetadataSearchRedaction(String valuePattern,
                               String replacement)

        Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items.

        Parameters:
        valuePattern - Regular expression to search and replace
        replacement - Textual replacement
      • MetadataSearchRedaction

        public MetadataSearchRedaction(String valuePattern,
                               String replacement,
                               String keyPattern)

        Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items.

        Parameters:
        valuePattern - Regular expression to search and replace metadata item value
        replacement - Textual replacement
        keyPattern - Regular expression to search and replace metadata item name
      • MetadataSearchRedaction

        public MetadataSearchRedaction(Pattern valueRegex,
                               String replacement)

        Initializes a new instance of MetadataSearchRedaction class, using value to match redacted items.

        Parameters:
        valueRegex - Regular expression to search and replace
        replacement - Textual replacement
      • MetadataSearchRedaction

        public MetadataSearchRedaction(Pattern valueRegex,
                               String replacement,
                               Pattern keyRegex)

        Initializes a new instance of MetadataSearchRedaction class, using item name and value to match redacted items.

        Parameters:
        valueRegex - Regular expression to search and replace metadata item value
        replacement - Textual replacement
        keyRegex - Regular expression to search and replace metadata item name
    • Method Detail

      • getValueExpression

        public final Pattern getValueExpression()

        Gets the regular expression to match value text of a metadata item.

        Returns:
        The regular expression to match value text of a metadata item.
      • getReplacement

        public final String getReplacement()

        Gets the textual replacement value.

        Returns:
        The textual replacement value.
      • getKeyExpression

        public final Pattern getKeyExpression()

        Gets the regular expression to match name (key) of metadata item.

        Returns:
        The regular expression to match name (key) of metadata item.
      • isApplicableTo

        protected boolean isApplicableTo(MetadataItem item)

        Checks if this redaction could be applied to a given metadata item.

        Specified by:
        isApplicableTo in class MetadataRedaction
        Parameters:
        item - Metadata item
        Returns:
        True if redaction can be applied