Class PropertyAccessorUtils

java.lang.Object
org.springframework.beans.PropertyAccessorUtils

@Deprecated(since="7.1", forRemoval=true) public abstract class PropertyAccessorUtils extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
as of 7.1, in favor of PropertyPath. Use PropertyPath.parse(String) and PropertyPath.canonicalName() in place of canonicalPropertyName(String) and canonicalPropertyNames(String[]), and match a registered path against a property by comparing canonical names in place of matchesProperty(String, String). There is no direct replacement for getPropertyName(String), isNestedOrIndexedProperty(String), getFirstNestedPropertySeparatorIndex(String), or getLastNestedPropertySeparatorIndex(String), which operate on raw, unparsed property path text.
Utility methods for classes that perform bean property access according to the PropertyAccessor interface.
Since:
1.2.6
Author:
Juergen Hoeller, Sam Brannen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine the canonical name for the given property path.
    static String @Nullable []
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine the canonical names for the given property paths.
    static int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
    static int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
    static String
    getPropertyName(String propertyPath)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the actual property name for the given property path.
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Check whether the given property path indicates an indexed or nested property.
    static boolean
    matchesProperty(String registeredPath, String propertyPath)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PropertyAccessorUtils

      public PropertyAccessorUtils()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getPropertyName

      public static String getPropertyName(String propertyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the actual property name for the given property path.
      Parameters:
      propertyPath - the property path to determine the property name for (can include property keys, for example for specifying a map entry)
      Returns:
      the actual property name, without any key elements
    • isNestedOrIndexedProperty

      public static boolean isNestedOrIndexedProperty(@Nullable String propertyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Check whether the given property path indicates an indexed or nested property.
      Parameters:
      propertyPath - the property path to check
      Returns:
      whether the path indicates an indexed or nested property
    • getFirstNestedPropertySeparatorIndex

      public static int getFirstNestedPropertySeparatorIndex(String propertyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
      Parameters:
      propertyPath - the property path to check
      Returns:
      the index of the nested property separator, or -1 if none
    • getLastNestedPropertySeparatorIndex

      public static int getLastNestedPropertySeparatorIndex(String propertyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
      Parameters:
      propertyPath - the property path to check
      Returns:
      the index of the nested property separator, or -1 if none
    • matchesProperty

      public static boolean matchesProperty(String registeredPath, String propertyPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.
      Parameters:
      registeredPath - the registered path (potentially with index)
      propertyPath - the property path (typically without index)
      Returns:
      whether the paths match
    • canonicalPropertyName

      public static String canonicalPropertyName(@Nullable String propertyName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine the canonical name for the given property path. Removes surrounding quotes from map keys:
      map['key'] → map[key]
      map["key"] → map[key]
      Parameters:
      propertyName - the bean property path
      Returns:
      the canonical representation of the property path
    • canonicalPropertyNames

      public static String @Nullable [] canonicalPropertyNames(String @Nullable [] propertyNames)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine the canonical names for the given property paths.
      Parameters:
      propertyNames - the bean property paths (as array)
      Returns:
      the canonical representation of the property paths (as array of the same size)
      See Also: