Uses of Class
spoon.pattern.PatternParameterConfigurator
Packages that use PatternParameterConfigurator
-
Uses of PatternParameterConfigurator in spoon.pattern
Methods in spoon.pattern that return PatternParameterConfiguratorModifier and TypeMethodDescriptionPatternParameterConfigurator.byCondition(Class<T> type, Predicate<T> matchCondition)
Elements will be substituted by parameter valuePatternParameterConfigurator.byFieldAccessOnVariable(String varName)
Add parameters for each field reference to variable named `variableName` For example this pattern model class Params { int paramA; int paramB; } void matcher(Params p) { return p.paramA + p.paramB; } called with `byFieldRefOfVariable("p")` will create pattern parameters: `paramA` and `paramB`All elements matched byFilter
will be substituted by parameter valuePatternParameterConfigurator.byInvocation(CtMethod<?> method)
each invocation of `method` will be replaces by parameter valuePatternParameterConfigurator.byLocalType(CtType<?> searchScope, String localTypeSimpleName)
Searches for a type visible in scope `templateType`, whose simple name is equal to `localTypeSimpleName`PatternParameterConfigurator.byNamedElement(String simpleName)
Any named element by it's simple namePatternParameterConfigurator.byParameterValues(Map<String,Object> parameterValues)
Creates pattern parameter for each key of parameterValuesMap
.PatternParameterConfigurator.byReferenceName(String simpleName)
Any reference identified by it's simple name.Attribute defined by `role` of `element` will be substituted by parameter valueAttribute defined by `role` of all elements matched byFilter
will be substituted by parameter valueAll spoon model string attributes whose value is equal to `stringMarker` are subject for substitution by current parameterPatternParameterConfigurator.bySubstring(String stringMarker)
All spoon model string attributes whose value contains whole string or a substring equal to `stringMarker` are subject for substitution by current parameter.PatternParameterConfigurator.byTemplateParameter()
Creates pattern parameter for each field of typeTemplateParameter
PatternParameterConfigurator.byTemplateParameter(Map<String,Object> parameterValues)
Creates pattern parameter for each field of typeTemplateParameter
.
Note: This method is here for compatibility with obsolete legacyTemplate
based concept.PatternParameterConfigurator.byTemplateParameterReference(CtVariable<?> variable)
variable read/write of `variable` of typeTemplateParameter
`type` itself and all the references to the `type` are subject for substitution by current parametertype identified by `typeQualifiedName` itself and all the references (with arbitrary actual type arguments) to that type are subject for substitution by current parameterPatternParameterConfigurator.byType(CtTypeReference<?> type)
type referred byCtTypeReference
`type` and all the references (with same actual type arguments) to that type are subject for substitution by current parameterPatternParameterConfigurator.byVariable(String variableName)
variable read/write of `variable`PatternParameterConfigurator.byVariable(CtVariable<?> variable)
variable read/write of `variable`PatternParameterConfigurator.matchInlinedStatements()
marks a CtIf and CtForEach to be matched, even when inlined.Creates a parameter with name `paramName` and assigns it into context, so next calls on builder will be applied to this parameterPatternParameterConfigurator.setConflictResolutionMode(ConflictResolutionMode conflictResolutionMode)
PatternParameterConfigurator.setContainerKind(ContainerKind containerKind)
Defines type of parameter value (List/Set/Map/single).PatternParameterConfigurator.setMatchingStrategy(Quantifier quantifier)
PatternParameterConfigurator.setMaxOccurrence(int maxOccurrence)
PatternParameterConfigurator.setMinOccurrence(int minOccurrence)
PatternParameterConfigurator.setValueType(Class<?> valueType)
Set expected type of Parameter.Method parameters in spoon.pattern with type arguments of type PatternParameterConfiguratorModifier and TypeMethodDescriptionPatternBuilder.configurePatternParameters(Consumer<PatternParameterConfigurator> parametersBuilder)
Configure pattern parameters with aPatternParameterConfigurator