Package spoon.pattern.internal
Class PatternPrinter
java.lang.Object
spoon.pattern.internal.DefaultGenerator
spoon.pattern.internal.PatternPrinter
- All Implemented Interfaces:
Generator
Generates the source code corresponding to a Pattern's RootNode
-
Field Summary
Fields inherited from class spoon.pattern.internal.DefaultGenerator
factory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> void
generateTargets(RootNode node, ResultHolder<T> result, ImmutableMap parameters)
Generates zero, one or more target depending on kind of thisRootNode
, expected `result` and input `parameters`<T> void
getValueAs(ParameterInfo parameterInfo, ResultHolder<T> result, ImmutableMap parameters)
Returns zero, one or more values into `result`.boolean
setPrintParametersAsComments(boolean printParametersAsComments)
Methods inherited from class spoon.pattern.internal.DefaultGenerator
applyGeneratedBy, generate, generate, generate, generateSingleTarget, generateTargets, getFactory, getGeneratedByComment, isAddGeneratedBy, setAddGeneratedBy
-
Constructor Details
-
PatternPrinter
public PatternPrinter()
-
-
Method Details
-
printNode
-
generateTargets
Description copied from class:DefaultGenerator
Generates zero, one or more target depending on kind of thisRootNode
, expected `result` and input `parameters`- Overrides:
generateTargets
in classDefaultGenerator
- Parameters:
node
- to be generated noderesult
- the holder which receives the generated nodeparameters
- the input parameters
-
getValueAs
public <T> void getValueAs(ParameterInfo parameterInfo, ResultHolder<T> result, ImmutableMap parameters)Description copied from class:DefaultGenerator
Returns zero, one or more values into `result`. The value comes from `parameters` from the location defined by `parameterInfo`- Overrides:
getValueAs
in classDefaultGenerator
- Parameters:
parameterInfo
- theParameterInfo
, which describes exact parameter from `parameters`result
- the holder which receives the generated nodeparameters
- the input parameters
-
setPrintParametersAsComments
-
isPrintParametersAsComments
public boolean isPrintParametersAsComments()
-