org.sonatype.gshell.util.converter.basic
Class ClassConverter
java.lang.Object
java.beans.PropertyEditorSupport
org.sonatype.gshell.util.converter.ConverterSupport
org.sonatype.gshell.util.converter.basic.ClassConverter
- All Implemented Interfaces:
- PropertyEditor, Converter
public class ClassConverter
- extends ConverterSupport
Converter for Class types.
- Since:
- 2.0
| 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 |
ClassConverter
public ClassConverter()
convertToObject
protected Object convertToObject(String text)
throws Exception
- Description copied from class:
ConverterSupport
- Converts the supplied text in to an instance of the editor type. The text will never be null, and trim() will
already have been called.
- Specified by:
convertToObject in class ConverterSupport
- Parameters:
text - The text to convertToObject
- Returns:
- An instance of the converted type
- Throws:
Exception - Conversion failed
convertToString
protected String convertToString(Object value)
- Description copied from class:
ConverterSupport
- 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:
convertToString in class ConverterSupport
- Parameters:
value - an instance of the editor type
- Returns:
- the text equivalent of the value
Copyright © 2008-2011 Sonatype. All Rights Reserved.