Interface PreProcessingStrategy
-
- All Known Implementing Classes:
PreProcessingStrategy.GenericAdvancedPreProcessingStrategy,PreProcessingStrategy.GenericGeneralPreProcessingStrategy
public interface PreProcessingStrategyA construct to specify a named set of preprocessing steps.
The preprocessors are executed in list order. The Stringifier can be set to allow for special output processing or tokenising.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPreProcessingStrategy.GenericAdvancedPreProcessingStrategyGeneric implementation of the PreProcessingStrategy interface for handling advanced preprocessorsstatic classPreProcessingStrategy.GenericGeneralPreProcessingStrategyGeneric implementation of the PreProcessingStrategy interface
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.StringgetName()Fetches the reference identifier for the strategyjava.util.List<java.lang.Class<? extends IPreProcessor>>getPreProcessorClasses()Fetches the ordered preprocessor classes in a list, to be run in order
If using an advanced preprocessor, this must return a singleton list (list with 1 element)default ITokenStringifiergetStringifier()Stringifier to use before passing the file to the detection algorithm, null for the default formatted codebooleanisAdvanced()Is the strategy using an IAdvancedPreProcessor instance?static PreProcessingStrategyof(java.lang.String name, boolean tokenise, java.lang.Class<? extends IGeneralPreProcessor>... preProcessor)A construction method for a generic preprocessing strategy
Output can be either formatted code or tokenised depending on the boolean flag valuestatic PreProcessingStrategyof(java.lang.String name, java.lang.Class<? extends IAdvancedPreProcessorGroup> preProcessor)A construction method for a generic preprocessing strategystatic PreProcessingStrategyof(java.lang.String name, java.lang.Class<? extends IGeneralPreProcessor>... preProcessor)A construction method for a generic preprocessing strategy
Output is always normal formatted code
-
-
-
Method Detail
-
of
@SafeVarargs static PreProcessingStrategy of(java.lang.String name, java.lang.Class<? extends IGeneralPreProcessor>... preProcessor)
A construction method for a generic preprocessing strategy
Output is always normal formatted code- Parameters:
name- the reference identifier to given to the strategypreProcessor- IPreprocessor instance(s) to be executed- Returns:
- Generic strategy for the passed parameters
-
of
@SafeVarargs static PreProcessingStrategy of(java.lang.String name, boolean tokenise, java.lang.Class<? extends IGeneralPreProcessor>... preProcessor)
A construction method for a generic preprocessing strategy
Output can be either formatted code or tokenised depending on the boolean flag value- Parameters:
name- the reference identifier to given to the strategytokenise- output will be tokenisedpreProcessor- IPreprocessor instance(s) to be executed- Returns:
- Generic strategy for the passed parameters
-
of
static PreProcessingStrategy of(java.lang.String name, java.lang.Class<? extends IAdvancedPreProcessorGroup> preProcessor)
A construction method for a generic preprocessing strategy- Parameters:
name- the reference identifier to given to the strategypreProcessor- IPreprocessor instance(s) to be executed- Returns:
- Generic strategy for the passed parameters
-
getName
java.lang.String getName()
Fetches the reference identifier for the strategy- Returns:
- identifier string
-
getPreProcessorClasses
java.util.List<java.lang.Class<? extends IPreProcessor>> getPreProcessorClasses()
Fetches the ordered preprocessor classes in a list, to be run in order
If using an advanced preprocessor, this must return a singleton list (list with 1 element)- Returns:
- ordered PreProcessor class(es)
-
getStringifier
default ITokenStringifier getStringifier()
Stringifier to use before passing the file to the detection algorithm, null for the default formatted code- Returns:
- instance of the stringifier
-
isAdvanced
boolean isAdvanced()
Is the strategy using an IAdvancedPreProcessor instance?- Returns:
- boolean is advanced
-
-