Class FieldBasedObjectInterpolator.InterpolateObjectAction
java.lang.Object
org.codehaus.plexus.interpolation.object.FieldBasedObjectInterpolator.InterpolateObjectAction
- All Implemented Interfaces:
PrivilegedAction
- Enclosing class:
FieldBasedObjectInterpolator
private static final class FieldBasedObjectInterpolator.InterpolateObjectAction
extends Object
implements PrivilegedAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Set
private final String[]
private final LinkedList
<FieldBasedObjectInterpolator.InterpolationTarget> private final BasicInterpolator
private final RecursionInterceptor
private final List
<ObjectInterpolationWarning> -
Constructor Summary
ConstructorsConstructorDescriptionInterpolateObjectAction
(Object target, BasicInterpolator interpolator, RecursionInterceptor recursionInterceptor, Set blacklistedFieldNames, Set blacklistedPackagePrefixes, List<ObjectInterpolationWarning> warningCollector) Setup an object graph traversal for the given target starting point. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
evaluateArray
(Object target, String basePath) Traverse the elements of an array, and interpolate any qualified objects or add them to the traversal queue.private boolean
interpolateCollection
(Object obj, String basePath, Field field) private void
interpolateMap
(Object obj, String basePath, Field field) private void
interpolateObject
(Object obj, String basePath, Field field) private void
interpolateString
(Object obj, Field field) private boolean
Using the package-prefix blacklist, determine whether the given class is qualified for interpolation, or whether it should be ignored.private boolean
isQualifiedForInterpolation
(Field field, Class fieldType) Using the field-name blacklist and the primitive-field cache, determine whether the given field in the given class is qualified for interpolation.run()
As long as the traversal queue is non-empty, traverse the next object in the queue.private void
Traverse the given object, interpolating any String fields and adding non-primitive field values to the interpolation queue for later processing.
-
Field Details
-
interpolationTargets
-
interpolator
-
blacklistedFieldNames
-
blacklistedPackagePrefixes
-
warningCollector
-
recursionInterceptor
-
-
Constructor Details
-
InterpolateObjectAction
public InterpolateObjectAction(Object target, BasicInterpolator interpolator, RecursionInterceptor recursionInterceptor, Set blacklistedFieldNames, Set blacklistedPackagePrefixes, List<ObjectInterpolationWarning> warningCollector) Setup an object graph traversal for the given target starting point. This will initialize a queue of objects to traverse and interpolate by adding the target object.
-
-
Method Details
-
run
As long as the traversal queue is non-empty, traverse the next object in the queue. If an interpolation error occurs, return it immediately.- Specified by:
run
in interfacePrivilegedAction
-
traverseObjectWithParents
private void traverseObjectWithParents(Class cls, FieldBasedObjectInterpolator.InterpolationTarget target) throws InterpolationException Traverse the given object, interpolating any String fields and adding non-primitive field values to the interpolation queue for later processing.- Throws:
InterpolationException
-
interpolateObject
private void interpolateObject(Object obj, String basePath, Field field) throws IllegalAccessException, InterpolationException -
interpolateMap
private void interpolateMap(Object obj, String basePath, Field field) throws IllegalAccessException, InterpolationException -
interpolateCollection
private boolean interpolateCollection(Object obj, String basePath, Field field) throws IllegalAccessException, InterpolationException -
interpolateString
private void interpolateString(Object obj, Field field) throws IllegalAccessException, InterpolationException -
isQualifiedForInterpolation
Using the package-prefix blacklist, determine whether the given class is qualified for interpolation, or whether it should be ignored. -
isQualifiedForInterpolation
Using the field-name blacklist and the primitive-field cache, determine whether the given field in the given class is qualified for interpolation. Primitive fields and fields listed in the blacklist will be ignored. The primitive-field cache is used to improve the performance of the reflective operations in this method, since this method is a hotspot. -
evaluateArray
Traverse the elements of an array, and interpolate any qualified objects or add them to the traversal queue.- Throws:
InterpolationException
-