Class ReflectionContextState

java.lang.Object
org.apache.struts2.util.reflection.ReflectionContextState

public class ReflectionContextState extends Object
Manages variables in the reflection context and returns values to be used by the application.
Author:
Gabe
  • Field Details

    • CURRENT_PROPERTY_PATH

      public static final String CURRENT_PROPERTY_PATH
      See Also:
    • FULL_PROPERTY_PATH

      public static final String FULL_PROPERTY_PATH
      See Also:
    • CREATE_NULL_OBJECTS

      public static final String CREATE_NULL_OBJECTS
      See Also:
    • DENY_METHOD_EXECUTION

      public static final String DENY_METHOD_EXECUTION
      See Also:
    • DENY_INDEXED_ACCESS_EXECUTION

      @Deprecated(since="7.4.0", forRemoval=true) public static final String DENY_INDEXED_ACCESS_EXECUTION
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 7.4.0, no replacement. Struts core never sets this key, so it has no effect on framework-driven binding. Indexed property access is now identified by inspecting the target type rather than by trusting a method name prefix, which is the check the key was standing in for. Application or plugin code which sets the key itself does still suppress the fast path, which is why this is deprecated rather than removed outright. Scheduled for removal in 8.0.0 by WW-5699.
      See Also:
  • Constructor Details

    • ReflectionContextState

      public ReflectionContextState()
  • Method Details

    • isCreatingNullObjects

      public static boolean isCreatingNullObjects(Map<String,Object> context)
    • setCreatingNullObjects

      public static void setCreatingNullObjects(Map<String,Object> context, boolean creatingNullObjects)
    • isGettingByKeyProperty

      public static boolean isGettingByKeyProperty(Map<String,Object> context)
    • setDenyMethodExecution

      public static void setDenyMethodExecution(Map<String,Object> context, boolean denyMethodExecution)
    • isDenyMethodExecution

      public static boolean isDenyMethodExecution(Map<String,Object> context)
    • setGettingByKeyProperty

      public static void setGettingByKeyProperty(Map<String,Object> context, boolean gettingByKeyProperty)
    • isReportingConversionErrors

      public static boolean isReportingConversionErrors(Map<String,Object> context)
    • setReportingConversionErrors

      public static void setReportingConversionErrors(Map<String,Object> context, boolean reportingErrors)
    • getLastBeanClassAccessed

      public static Class getLastBeanClassAccessed(Map<String,Object> context)
    • setLastBeanPropertyAccessed

      public static void setLastBeanPropertyAccessed(Map<String,Object> context, String property)
    • getLastBeanPropertyAccessed

      public static String getLastBeanPropertyAccessed(Map<String,Object> context)
    • setLastBeanClassAccessed

      public static void setLastBeanClassAccessed(Map<String,Object> context, Class clazz)
    • getCurrentPropertyPath

      public static String getCurrentPropertyPath(Map<String,Object> context)

      Gets the current property path but not completely. It does not use the [ and ] used in some representations of Maps and Lists. The reason for this is that the current property path is only currently used for caching purposes so there is no real reason to have an exact replica.

      So if the real path is myProp.myMap['myKey'] this would return myProp.myMap.myKey.

      Parameters:
      context - context map
      Returns:
      current property path
    • getFullPropertyPath

      public static String getFullPropertyPath(Map<String,Object> context)
    • setFullPropertyPath

      public static void setFullPropertyPath(Map<String,Object> context, String path)
    • updateCurrentPropertyPath

      public static void updateCurrentPropertyPath(Map<String,Object> context, Object name)
    • setSetMap

      public static void setSetMap(Map<String,Object> context, Map<Object,Object> setMap, String path)
    • getSetMap

      public static Map<Object,Object> getSetMap(Map<String,Object> context, String path)
    • clearCurrentPropertyPath

      public static void clearCurrentPropertyPath(Map<String,Object> context)
      Parameters:
      context - the context map
    • clear

      public static void clear(Map<String,Object> context)