Example usage for org.springframework.beans AbstractNestablePropertyAccessor getLocalPropertyHandler

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

Introduction

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

Prototype

@Nullable
protected abstract PropertyHandler getLocalPropertyHandler(String propertyName);

Source Link

Document

Return a PropertyHandler for the specified local propertyName .

Usage

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

@Override
@Nullable//w  w w. j a  va  2 s .c  o m
public TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException {
    try {
        AbstractNestablePropertyAccessor nestedPa = getPropertyAccessorForPropertyPath(propertyName);
        String finalPath = getFinalPath(nestedPa, propertyName);
        PropertyTokenHolder tokens = getPropertyNameTokens(finalPath);
        PropertyHandler ph = nestedPa.getLocalPropertyHandler(tokens.actualName);
        if (ph != null) {
            if (tokens.keys != null) {
                if (ph.isReadable() || ph.isWritable()) {
                    return ph.nested(tokens.keys.length);
                }
            } else {
                if (ph.isReadable() || ph.isWritable()) {
                    return ph.toTypeDescriptor();
                }
            }
        }
    } catch (InvalidPropertyException ex) {
        // Consider as not determinable.
    }
    return null;
}

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

/**
 * Return the {@link PropertyHandler} for the specified {@code propertyName}, navigating
 * if necessary. Return {@code null} if not found rather than throwing an exception.
 * @param propertyName the property to obtain the descriptor for
 * @return the property descriptor for the specified property,
 * or {@code null} if not found//from   w ww. jav a2  s.c o  m
 * @throws BeansException in case of introspection failure
 */
@Nullable
protected PropertyHandler getPropertyHandler(String propertyName) throws BeansException {
    Assert.notNull(propertyName, "Property name must not be null");
    AbstractNestablePropertyAccessor nestedPa = getPropertyAccessorForPropertyPath(propertyName);
    return nestedPa.getLocalPropertyHandler(getFinalPath(nestedPa, propertyName));
}