Example usage for org.springframework.beans AbstractPropertyAccessor useConfigValueEditors

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

Introduction

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

Prototype

public void useConfigValueEditors() 

Source Link

Document

Activate config value editors which are only intended for configuration purposes, such as org.springframework.beans.propertyeditors.StringArrayPropertyEditor .

Usage

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

@Test
public void setStringArrayPropertyWithStringSplitting() throws Exception {
    PropsTester target = new PropsTester();
    AbstractPropertyAccessor accessor = createAccessor(target);
    accessor.useConfigValueEditors();
    accessor.setPropertyValue("stringArray", "a1,b2");
    assertTrue("stringArray length = 2", target.stringArray.length == 2);
    assertTrue("correct values", target.stringArray[0].equals("a1") && target.stringArray[1].equals("b2"));
}

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

@Test
public void setIntArrayPropertyWithStringSplitting() throws Exception {
    PropsTester target = new PropsTester();
    AbstractPropertyAccessor accessor = createAccessor(target);
    accessor.useConfigValueEditors();
    accessor.setPropertyValue("intArray", "4,5");
    assertTrue("intArray length = 2", target.intArray.length == 2);
    assertTrue("correct values", target.intArray[0] == 4 && target.intArray[1] == 5);
}