public abstract class

PropertyAccessorUtils

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

Class Overview

Utility methods for classes that perform bean property access according to the PropertyAccessor interface.

Summary

Public Constructors
PropertyAccessorUtils()
Public Methods
static String canonicalPropertyName(String propertyName)
Determine the canonical name for the given property path.
static String[] canonicalPropertyNames(String[] propertyNames)
Determine the canonical names for the given property paths.
static int getFirstNestedPropertySeparatorIndex(String propertyPath)
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
static int getLastNestedPropertySeparatorIndex(String propertyPath)
Determine the first nested property separator in the given property path, ignoring dots in keys (like "map[my.key]").
static String getPropertyName(String propertyPath)
Return the actual property name for the given property path.
static boolean isNestedOrIndexedProperty(String propertyPath)
Check whether the given property path indicates an indexed or nested property.
static boolean matchesProperty(String registeredPath, String propertyPath)
Determine whether the given registered path matches the given property path, either indicating the property itself or an indexed element of the property.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PropertyAccessorUtils ()

Also: SpringBeans

Public Methods

public static String canonicalPropertyName (String propertyName)

Also: SpringBeans

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

public static String[] canonicalPropertyNames (String[] propertyNames)

Also: SpringBeans

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)

public static int getFirstNestedPropertySeparatorIndex (String propertyPath)

Also: SpringBeans

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

public static int getLastNestedPropertySeparatorIndex (String propertyPath)

Also: SpringBeans

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

public static String getPropertyName (String propertyPath)

Also: SpringBeans

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

public static boolean isNestedOrIndexedProperty (String propertyPath)

Also: SpringBeans

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

public static boolean matchesProperty (String registeredPath, String propertyPath)

Also: SpringBeans

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