com.groupdocs.redaction

Class MetadataSearchRedaction



  • public class MetadataSearchRedaction
    extends MetadataRedaction

    Searches and redacts metadata using regular expressions on keys and values

    • Constructor Detail

      • MetadataSearchRedaction

        public MetadataSearchRedaction(String valuePattern,
                               String replacement)

        Create new instance of redaction, 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)

        Create new instance of redaction, 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)

        Create new instance of redaction, 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)

        Create new instance of redaction, 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()

        Regular expression, used to match value of metadata item

      • getReplacement

        public final String getReplacement()

        Textual replacement

      • getKeyExpression

        public final Pattern getKeyExpression()

        Regular expression, used to match name (key) of metadata item

      • isApplicableTo

        protected boolean isApplicableTo(MetadataItem item)

        Checks if this redaction could be applied to given metadata item

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