Class 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
    • 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 interface java.security.PrivilegedAction
      • 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