|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.joda.property.impl.AbstractModelElement | +--org.joda.property.impl.AbstractProperty | +--org.joda.property.impl.type.DefaultLocaleProperty
Default implementation of a Locale property.
Data is stored in the associated PropertyData object as a Locale object. This is immutable so can be directly returned.
Nested Class Summary |
Nested classes inherited from class org.joda.property.Property |
Property.Internal |
Constructor Summary | |
DefaultLocaleProperty()
Constructor |
Method Summary | |
protected java.util.Locale |
convertObjectToLocale(java.lang.Object object)
Convert an Object to a Locale, throwing an exception if unable to convert. |
java.util.Locale |
get()
Get the property's value as a Locale. |
protected java.util.Locale |
getInternal()
Get the property as a Locale |
java.lang.Class |
getPropertyType()
Get the type of the property. |
void |
set(java.lang.Object propertyValue)
Set the property's value as an object. |
void |
set(java.lang.String language,
java.lang.String country)
Set the property's value to a specific language and country. |
protected void |
setInternal(java.util.Locale newValue)
Set the property value as a Locale |
java.util.Locale |
toLocale()
Get the property's value as a Locale. |
java.lang.Object |
toObject()
Get the property's value as an object. |
Methods inherited from class org.joda.property.impl.AbstractProperty |
addPropertyChangeListener, bean, checkArgumentNotNull, checkModifiable, checkValueNotNull, checkValueNotNull, cloneDeep, convertObject, createClonedProperty, data, equals, equalsValue, firePropertyChange, firePropertyChange, getContentName, getContentType, getPropertyName, getThis, hashCode, initBeanCreated, initPropertyCreated, isModifiable, isNull, isReadOnly, populateClonedProperty, removePropertyChangeListener, setModifiable, setReadOnly, toDataString, toString |
Methods inherited from class org.joda.property.impl.AbstractModelElement |
getAttribute, getAttributeCount, getAttributeMap, setAttribute |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.joda.property.type.DataProperty |
toDataString |
Methods inherited from interface org.joda.property.Property |
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, setModifiable, setReadOnly, toString |
Methods inherited from interface org.joda.property.ModelElement |
getAttribute, getAttributeCount, getAttributeMap, setAttribute |
Constructor Detail |
public DefaultLocaleProperty()
Method Detail |
public java.lang.Class getPropertyType()
getPropertyType
in interface Property
protected java.util.Locale getInternal()
protected void setInternal(java.util.Locale newValue)
newValue
- the value to storepublic java.lang.Object toObject()
Property
This method has strong semantics such that where a and b are
properties of the same type, it must be true that:
b.set( a.toObject() );
a.equals(b);
In other words, the object contains all the data necessary to
recreate the property's value.
toObject
in interface Property
toObject
in class AbstractProperty
Property#toObject()
public java.util.Locale toLocale()
LocaleProperty
toLocale
in interface LocaleProperty
LocaleProperty.toLocale()
public java.util.Locale get()
LocaleProperty
get
in interface LocaleProperty
LocaleProperty.get()
protected java.util.Locale convertObjectToLocale(java.lang.Object object)
object
- the value to convert
public void set(java.lang.Object propertyValue)
Property
If a String is passed in, it can be parsed in various ways. If the results of toDataString() are passed in, it must reconstitute the original value.
set
in interface Property
set
in class AbstractProperty
propertyValue
- an Object to set the property's value toProperty#set(Object)
public void set(java.lang.String language, java.lang.String country)
LocaleProperty
set
in interface LocaleProperty
language
- the language to set the locale tocountry
- the country to set the locale toLocaleProperty.set(String, String)
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |