Package processing.mode.java.preproc
Class PdePreprocessor.PdePreprocessorBuilder
java.lang.Object
processing.mode.java.preproc.PdePreprocessor.PdePreprocessorBuilder
- Enclosing class:
- PdePreprocessor
Builder to help instantiate a PdePreprocessor.
The PdePreprocessor includes a number of parameters, including some behavioral parameters that
change how the parse tree is processed. This builder helps instantiate this object by providing
reasonable defaults for most values but allowing client to (especially modes) to override those
defaults.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the preprocessor.setCoreImports(List<String> newCoreImports) Indicate which imports are required by processing or the mode itself.setDefaultImports(List<String> newDefaultImports) Indicate which imports are provided on behalf of the user for convenience.setDestinationPackage(String newDestinationPackage) Specify to which package generated code should be assigned.setIsTesting(boolean newIsTesting) Indicate if this preprocessor is running within unittests.Specify how the parse tree listener should be built.setTabSize(int newTabSize) Set how large the tabs should be.
-
Field Details
-
BASE_CORE_IMPORTS
The imports required for the Java processing mode.The set of imports required by processing itself (in java mode) that are made public so that client code (like in modes) can modify and re-use this list.
-
BASE_DEFAULT_IMPORTS
The imports provided as a convenience for the user.The imports that are not strictly required by processing sketches but that are included on behalf of the user that are made public so that client code (like in modes) can modify and re-use this list.
-
-
Method Details
-
setTabSize
Set how large the tabs should be.- Parameters:
newTabSize- The number of spaces in a tab.- Returns:
- This builder for method chaining.
-
setIsTesting
Indicate if this preprocessor is running within unittests.- Parameters:
newIsTesting- Flag that, if true, will configure the preprocessor to run safely within a unit testing environment.- Returns:
- This builder for method chaining.
-
setParseTreeListenerFactory
public PdePreprocessor.PdePreprocessorBuilder setParseTreeListenerFactory(PdePreprocessor.ParseTreeListenerFactory newFactory) Specify how the parse tree listener should be built. The ANTLR parse tree listener is where the preprocessing edits are generated and some client code (like modes) may need to override some preprocessing edit behavior. Specifying this factory allows client code to replace the default PdeParseTreeListener used during preprocessing.- Parameters:
newFactory- The factory to use in building a parse tree listener.- Returns:
- This builder for method chaining.
-
setDefaultImports
Indicate which imports are provided on behalf of the user for convenience.- Parameters:
newDefaultImports- The new set of default imports.- Returns:
- This builder for method chaining.
-
setCoreImports
Indicate which imports are required by processing or the mode itself.- Parameters:
newCoreImports- The new set of core imports.- Returns:
- This builder for method chaining.
-
setDestinationPackage
Specify to which package generated code should be assigned.- Parameters:
newDestinationPackage- The package to which output code should be assigned.- Returns:
- This builder for method chaining.
-
build
Build the preprocessor.
-