Example usage for org.springframework.beans AbstractPropertyAccessor getPropertyTypeDescriptor

List of usage examples for org.springframework.beans AbstractPropertyAccessor getPropertyTypeDescriptor

Introduction

In this page you can find the example usage for org.springframework.beans AbstractPropertyAccessor getPropertyTypeDescriptor.

Prototype

@Nullable
TypeDescriptor getPropertyTypeDescriptor(String propertyName) throws BeansException;

Source Link

Document

Return a type descriptor for the specified property: preferably from the read method, falling back to the write method.

Usage

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

@Test
public void propertyTypeDescriptor() {
    Person target = createPerson("John", "Paris", "FR");
    AbstractPropertyAccessor accessor = createAccessor(target);

    assertThat(accessor.getPropertyTypeDescriptor("address.city"), is(notNullValue()));
}

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

@Test
public void propertyTypeDescriptorUnknownProperty() {
    Simple target = new Simple("John", 2);
    AbstractPropertyAccessor accessor = createAccessor(target);

    assertThat(accessor.getPropertyTypeDescriptor("foo"), is(nullValue()));
}