org.apache.xbean.propertyeditor
Class ClassEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by org.apache.xbean.propertyeditor.AbstractConverter
          extended by org.apache.xbean.propertyeditor.ClassEditor
All Implemented Interfaces:
PropertyEditor, Converter

public class ClassEditor
extends AbstractConverter

A property editor for converting class names into class object instances

Version:
$Rev: 6680 $

Constructor Summary
ClassEditor()
           
 
Method Summary
protected  Object toObjectImpl(String text)
          Return a resolved class using the text value of the property as the name.
protected  String toStringImpl(Object value)
          Converts the supplied object to text.
 
Methods inherited from class org.apache.xbean.propertyeditor.AbstractConverter
getAsText, getType, getValue, setAsText, setValue, toObject, toString
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource, supportsCustomEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, getCustomEditor, getJavaInitializationString, getTags, isPaintable, paintValue, removePropertyChangeListener, supportsCustomEditor
 

Constructor Detail

ClassEditor

public ClassEditor()
Method Detail

toObjectImpl

protected Object toObjectImpl(String text)
Return a resolved class using the text value of the property as the name. The class is loading using the current context class loader, using the resolution rules defined by ClassLoading.java.

Specified by:
toObjectImpl in class AbstractConverter
Parameters:
text - the text to convert
Returns:
a Class object created from the text value of the name.
Throws:
PropertyEditorException - Unable to resolve the Class object from the name.

toStringImpl

protected String toStringImpl(Object value)
Description copied from class: AbstractConverter
Converts the supplied object to text. The supplied object will always be an instance of the editor type, and specifically will never be null or a String (unless this is the String editor).

Overrides:
toStringImpl in class AbstractConverter
Parameters:
value - an instance of the editor type
Returns:
the text equivalent of the value


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.