Class BulkRedactorSettings
- java.lang.Object
-
- com.nuix.superutilities.annotations.BulkRedactorSettings
-
public class BulkRedactorSettings extends java.lang.ObjectProvides settings regarding bulk redaction performed byBulkRedactor.findAndMarkup(Case, BulkRedactorSettings, Collection, int).
-
-
Constructor Summary
Constructors Constructor Description BulkRedactorSettings()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExpression(java.lang.String regularExpression)Adds a regular expression to the list of expressions used to locate text to markup.voidaddNamedEntity(java.lang.String namedEntityType)Adds a named entity type to the list of types to be redacted.voidaddPhrase(java.lang.String phrase)Adds a phrase to the list of expressions used to find and markup text.voidaddPhrases(java.util.Collection<java.lang.String> phrases)Adds multiple phrases to the list of expressions used to find and markup text.static java.lang.StringescapeRegexSpecialCharacters(java.lang.String input)Escapes regular expression characters in the input string.booleangetApplyHighLights()booleangetApplyRedactions()java.util.Set<java.lang.String>getExpressions()Gets the regular expressions which will be used to locate text to markup.nuix.MarkupSetgetMarkupSet(nuix.Case nuixCase)Gets the Nuix MarkupSet object based on the markup set name as set bysetMarkupSetName(String).java.lang.StringgetMarkupSetName()Gets the name of the markup set to which markups will be recorded against.java.util.Set<java.lang.String>getNamedEntityTypes()Gets the list of named entity types to be redacted.java.io.FilegetTempDirectory()Gets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.static java.lang.StringphraseToExpression(java.lang.String phrase)Converts a phrase (string with potentially multiple terms) into a regular expression for used searching for text to redact in a PDF.voidsetApplyHighLights(boolean applyHighLights)voidsetApplyRedactions(boolean applyRedactions)voidsetExpressions(java.util.Collection<java.lang.String> expressions)Sets the regular expressions which will be used to locate text to markup.voidsetMarkupSetName(java.lang.String markupSetName)Sets the name of the markup set to which markup will be recorded against.voidsetNamedEntityTypes(java.util.Collection<java.lang.String> namedEntityTypes)Sets the list of named entity type to be redacted.voidsetTempDirectory(java.io.File tempDirectory)Sets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.voidsetTempDirectory(java.lang.String tempDirectory)Sets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.static java.util.List<java.lang.String>splitPhrase(java.lang.String phrase)Splits a string into tokens on whitespace using the regular expression: \s+static java.lang.StringtermToRegex(java.lang.String inputTerm)Converts a plain text term to a regular expression which is case insensitive.
-
-
-
Method Detail
-
getMarkupSetName
public java.lang.String getMarkupSetName()
Gets the name of the markup set to which markups will be recorded against.- Returns:
- The name of the markup set to use.
-
setMarkupSetName
public void setMarkupSetName(java.lang.String markupSetName)
Sets the name of the markup set to which markup will be recorded against.- Parameters:
markupSetName- The name of the markup set to use. If the name provided does not exist, a markup set will be created.
-
getTempDirectory
public java.io.File getTempDirectory()
Gets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.- Returns:
- The PDF export temp directory.
-
setTempDirectory
public void setTempDirectory(java.io.File tempDirectory)
Sets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.- Parameters:
tempDirectory- The PDF export temp directory.
-
setTempDirectory
public void setTempDirectory(java.lang.String tempDirectory)
Sets the temp directory to whichBulkRedactorwill export PDF files which will be provided to Aspose.- Parameters:
tempDirectory- The PDF export temp directory.
-
getExpressions
public java.util.Set<java.lang.String> getExpressions()
Gets the regular expressions which will be used to locate text to markup.- Returns:
- The regular expressions which will be used to locate text to markup.
-
setExpressions
public void setExpressions(java.util.Collection<java.lang.String> expressions)
Sets the regular expressions which will be used to locate text to markup.- Parameters:
expressions- The regular expressions which will be used to locate text to markup.
-
addExpression
public void addExpression(java.lang.String regularExpression)
Adds a regular expression to the list of expressions used to locate text to markup.- Parameters:
regularExpression- A regular expression to add
-
getNamedEntityTypes
public java.util.Set<java.lang.String> getNamedEntityTypes()
Gets the list of named entity types to be redacted.- Returns:
- The list of named entity types to be redacted.
-
setNamedEntityTypes
public void setNamedEntityTypes(java.util.Collection<java.lang.String> namedEntityTypes)
Sets the list of named entity type to be redacted.- Parameters:
namedEntityTypes- The named entity types to be redacted.
-
addNamedEntity
public void addNamedEntity(java.lang.String namedEntityType)
Adds a named entity type to the list of types to be redacted.- Parameters:
namedEntityType- The named entity type to be added to the list.
-
getMarkupSet
public nuix.MarkupSet getMarkupSet(nuix.Case nuixCase)
Gets the Nuix MarkupSet object based on the markup set name as set bysetMarkupSetName(String). If the markup set by the given name already exists, then this will yield that existing markup set. If it does not, a new markup set with the given name will be created.- Parameters:
nuixCase- The relevant Nuix Case- Returns:
- Either the existing markup set or a newly created markup set, based on the markup set name as set by
setMarkupSetName(String).
-
escapeRegexSpecialCharacters
public static java.lang.String escapeRegexSpecialCharacters(java.lang.String input)
Escapes regular expression characters in the input string.- Parameters:
input- String with regular expression characters to escape.- Returns:
- String with the regular expression characters escaped.
-
termToRegex
public static java.lang.String termToRegex(java.lang.String inputTerm)
Converts a plain text term to a regular expression which is case insensitive. This is done by generating a regular expression with a character class matching each letter in both lower case and upper case. For example if the input term is "cat", this returns a regular expression "[Cc][Aa][Tt]".- Parameters:
inputTerm- Term to convert to a case insensitive regular expression- Returns:
- String Regular expression that is case insensitive regular expression for input term
-
splitPhrase
public static java.util.List<java.lang.String> splitPhrase(java.lang.String phrase)
Splits a string into tokens on whitespace using the regular expression: \s+- Parameters:
phrase- The phrase to tokenize.- Returns:
- List of token strings.
-
phraseToExpression
public static java.lang.String phraseToExpression(java.lang.String phrase)
Converts a phrase (string with potentially multiple terms) into a regular expression for used searching for text to redact in a PDF.- Parameters:
phrase- The phrase to convert into a regular expression. May be single or multiple terms.- Returns:
- A regular expression to match that phrase in a case insensitive manner. Internally calls
splitPhrase(String)andtermToRegex(String).
-
addPhrase
public void addPhrase(java.lang.String phrase)
Adds a phrase to the list of expressions used to find and markup text. Phrase is converted to an expression usingphraseToExpression(String). Resulting expression is then surrounded '\b' to anchor it to word boundaries.- Parameters:
phrase- The phrase to add to the list of expressions used to find and markup text.
-
addPhrases
public void addPhrases(java.util.Collection<java.lang.String> phrases)
Adds multiple phrases to the list of expressions used to find and markup text. Internally callsaddPhrase(String)for each string in the provide value.- Parameters:
phrases- Multiple phrases to the list of expressions used to find and markup text.
-
getApplyRedactions
public boolean getApplyRedactions()
-
setApplyRedactions
public void setApplyRedactions(boolean applyRedactions)
-
getApplyHighLights
public boolean getApplyHighLights()
-
setApplyHighLights
public void setApplyHighLights(boolean applyHighLights)
-
-