Class FieldBasedObjectInterpolator.InterpolateObjectAction
- java.lang.Object
-
- org.codehaus.plexus.interpolation.object.FieldBasedObjectInterpolator.InterpolateObjectAction
-
- All Implemented Interfaces:
java.security.PrivilegedAction
- Enclosing class:
- FieldBasedObjectInterpolator
private static final class FieldBasedObjectInterpolator.InterpolateObjectAction extends java.lang.Object implements java.security.PrivilegedAction
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set
blacklistedFieldNames
private java.lang.String[]
blacklistedPackagePrefixes
private java.util.LinkedList<FieldBasedObjectInterpolator.InterpolationTarget>
interpolationTargets
private BasicInterpolator
interpolator
private RecursionInterceptor
recursionInterceptor
private java.util.List<ObjectInterpolationWarning>
warningCollector
-
Constructor Summary
Constructors Constructor Description InterpolateObjectAction(java.lang.Object target, BasicInterpolator interpolator, RecursionInterceptor recursionInterceptor, java.util.Set blacklistedFieldNames, java.util.Set blacklistedPackagePrefixes, java.util.List<ObjectInterpolationWarning> warningCollector)
Setup an object graph traversal for the given target starting point.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
evaluateArray(java.lang.Object target, java.lang.String basePath)
Traverse the elements of an array, and interpolate any qualified objects or add them to the traversal queue.private boolean
interpolateCollection(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field)
private void
interpolateMap(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field)
private void
interpolateObject(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field)
private void
interpolateString(java.lang.Object obj, java.lang.reflect.Field field)
private boolean
isQualifiedForInterpolation(java.lang.Class cls)
Using the package-prefix blacklist, determine whether the given class is qualified for interpolation, or whether it should be ignored.private boolean
isQualifiedForInterpolation(java.lang.reflect.Field field, java.lang.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.java.lang.Object
run()
As long as the traversal queue is non-empty, traverse the next object in the queue.private void
traverseObjectWithParents(java.lang.Class cls, FieldBasedObjectInterpolator.InterpolationTarget target)
Traverse the given object, interpolating any String fields and adding non-primitive field values to the interpolation queue for later processing.
-
-
-
Field Detail
-
interpolationTargets
private final java.util.LinkedList<FieldBasedObjectInterpolator.InterpolationTarget> interpolationTargets
-
interpolator
private final BasicInterpolator interpolator
-
blacklistedFieldNames
private final java.util.Set blacklistedFieldNames
-
blacklistedPackagePrefixes
private final java.lang.String[] blacklistedPackagePrefixes
-
warningCollector
private final java.util.List<ObjectInterpolationWarning> warningCollector
-
recursionInterceptor
private final RecursionInterceptor recursionInterceptor
-
-
Constructor Detail
-
InterpolateObjectAction
public InterpolateObjectAction(java.lang.Object target, BasicInterpolator interpolator, RecursionInterceptor recursionInterceptor, java.util.Set blacklistedFieldNames, java.util.Set blacklistedPackagePrefixes, java.util.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 Detail
-
run
public java.lang.Object 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 interfacejava.security.PrivilegedAction
-
traverseObjectWithParents
private void traverseObjectWithParents(java.lang.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(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field) throws java.lang.IllegalAccessException, InterpolationException
- Throws:
java.lang.IllegalAccessException
InterpolationException
-
interpolateMap
private void interpolateMap(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field) throws java.lang.IllegalAccessException, InterpolationException
- Throws:
java.lang.IllegalAccessException
InterpolationException
-
interpolateCollection
private boolean interpolateCollection(java.lang.Object obj, java.lang.String basePath, java.lang.reflect.Field field) throws java.lang.IllegalAccessException, InterpolationException
- Throws:
java.lang.IllegalAccessException
InterpolationException
-
interpolateString
private void interpolateString(java.lang.Object obj, java.lang.reflect.Field field) throws java.lang.IllegalAccessException, InterpolationException
- Throws:
java.lang.IllegalAccessException
InterpolationException
-
isQualifiedForInterpolation
private boolean isQualifiedForInterpolation(java.lang.Class cls)
Using the package-prefix blacklist, determine whether the given class is qualified for interpolation, or whether it should be ignored.
-
isQualifiedForInterpolation
private boolean isQualifiedForInterpolation(java.lang.reflect.Field field, java.lang.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. 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
private void evaluateArray(java.lang.Object target, java.lang.String basePath) throws InterpolationException
Traverse the elements of an array, and interpolate any qualified objects or add them to the traversal queue.- Throws:
InterpolationException
-
-