How will you wire a string value to a property whose type is a non-string?

How will you wire a string value to a property whose type is a non-string?

Yes. You can wire a string value to a property whose type is a non-string. The java.beans.PropertyEditor interface provides a means to customize how String values are mapped to non-String types. 7

This interface is implemented by java.beans.PropertyEditorSupport that has two methods:

getAsText() : returns the String representation of a property\'s value.
setAsText(String value) : sets a bean property value from the String value passed in.

If you want to map the non-string property to a String value, the setAsText() method is called to perform the conversion.

By:Jalees
Date:2031-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher