Example usage for org.springframework.beans AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath

List of usage examples for org.springframework.beans AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath

Introduction

In this page you can find the example usage for org.springframework.beans AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath.

Prototype

@SuppressWarnings("unchecked") 
protected AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath(String propertyPath) 

Source Link

Document

Recursively navigate to return a property accessor for the nested property path.

Usage

From source file:org.springframework.beans.AbstractNestablePropertyAccessor.java

/**
 * Recursively navigate to return a property accessor for the nested property path.
 * @param propertyPath property path, which may be nested
 * @return a property accessor for the target bean
 */// w w  w  . j  ava  2s  . c o m
@SuppressWarnings("unchecked") // avoid nested generic
protected AbstractNestablePropertyAccessor getPropertyAccessorForPropertyPath(String propertyPath) {
    int pos = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(propertyPath);
    // Handle nested properties recursively.
    if (pos > -1) {
        String nestedProperty = propertyPath.substring(0, pos);
        String nestedPath = propertyPath.substring(pos + 1);
        AbstractNestablePropertyAccessor nestedPa = getNestedPropertyAccessor(nestedProperty);
        return nestedPa.getPropertyAccessorForPropertyPath(nestedPath);
    } else {
        return this;
    }
}