com.basistech.util
Class LanguageCodeEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by com.basistech.util.LanguageCodeEditor
All Implemented Interfaces:
PropertyEditor

public class LanguageCodeEditor
extends PropertyEditorSupport

This class provides notational convenience for users of the Spring IoC container, or any other facility that participates in the java.beans property editor discipline. JavaBeans automatically discovers PropertyEditor classes if they are in the same package as the class they handle, and have the same name but with an 'Editor' suffix. This class turns a String value into a valid value for a property of type LanguageCode. The string is converted via the function LanguageCode.lookupByISO639(java.lang.String).


Constructor Summary
LanguageCodeEditor()
           
 
Method Summary
 String getAsText()
          Get the language code.
 void setAsText(String text)
          Set the language code.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getCustomEditor, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setSource, setValue, supportsCustomEditor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageCodeEditor

public LanguageCodeEditor()
Method Detail

setAsText

public void setAsText(String text)
               throws IllegalArgumentException
Set the language code.

Specified by:
setAsText in interface PropertyEditor
Overrides:
setAsText in class PropertyEditorSupport
Parameters:
text - String representation of a language code.
Throws:
IllegalArgumentException

getAsText

public String getAsText()
Get the language code.

Specified by:
getAsText in interface PropertyEditor
Overrides:
getAsText in class PropertyEditorSupport
Returns:
String representation of the language code.


Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.