|
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.DefaultStringProperty
Default implementation of a String property.
Data is stored in the associated PropertyData object as a String object. This is immutable so can be directly returned.
Nested Class Summary |
Nested classes inherited from class org.joda.property.Property |
Property.Internal |
Field Summary |
Fields inherited from interface org.joda.property.type.StringProperty |
DEFAULT_TYPE |
Constructor Summary | |
DefaultStringProperty()
Constructor |
Method Summary | |
void |
append(java.lang.Object appendValue)
Append another string to this property's value. |
char |
charAt(int index)
Returns the character at a particular index. |
int |
compareTo(java.lang.Object object)
|
boolean |
contains(java.lang.String searchString)
Check for the presence of a particular string. |
protected java.lang.String |
convertObjectToString(java.lang.Object object)
Convert an Object to a String, throwing an exception if unable to convert. |
void |
delete(int startIndex,
int endIndex)
Delete part of the string. |
void |
deleteCharAt(int index)
Delete a character at a particular index. |
boolean |
endsWith(java.lang.String searchString)
Check whether the property starts with particular string. |
boolean |
equalsValueIgnoreCase(java.lang.Object object)
Check whether this string equals the one passed in ignoring case. |
java.lang.String |
get()
Get the property's value. |
protected java.lang.String |
getInternal()
Get the property as a string |
java.lang.Class |
getPropertyType()
Get the type of the property. |
int |
indexOf(java.lang.String searchString)
Get the index of a particular string, or -1 if not found |
int |
indexOf(java.lang.String searchString,
int fromIndex)
Get the index of a particular string, or -1 if not found |
void |
insert(int insertIndex,
java.lang.Object insertValue)
Insert another string into this property's value. |
boolean |
isEmpty()
Is the string currently null or zero length |
int |
lastIndexOf(java.lang.String searchString)
Get the last index of a particular string, or -1 if not found |
java.lang.String |
left(int length)
Returns a string that is the leftmost characters of this string. |
int |
length()
Get the length of the string. |
java.lang.String |
mid(int beginIndex,
int length)
Returns a string that is a substring of this string. |
java.lang.Class |
propertyType()
Get the type of the property |
void |
replace(java.lang.String searchString,
java.lang.String replaceString)
Replace one string with another in the property's value. |
java.lang.String |
right(int length)
Returns a string that is the rightmost characters of this string. |
void |
set(java.lang.Object propertyValue)
Set the property's value as an object. |
void |
setCharAt(int index,
char character)
Set a character at a particular index. |
protected void |
setInternal(char[] chars)
Set the value of the string |
protected void |
setInternal(java.lang.String newValue)
Set the property value as a String |
void |
setToLowerCase()
Set the property's value to lower case. |
void |
setToLowerCase(java.util.Locale locale)
Set the property's value to lower case using the locale's rules. |
void |
setToUpperCase()
Set the property's value to upper case. |
void |
setToUpperCase(java.util.Locale locale)
Set the property's value to upper case using the locale's rules. |
boolean |
startsWith(java.lang.String searchString)
Check whether the property ends with particular string. |
java.lang.String |
substring(int beginIndex)
Returns a string that is a substring of this string. |
java.lang.String |
substring(int beginIndex,
int endIndex)
Returns a string that is a substring of this string. |
java.lang.String |
toDataString()
Override for efficiency |
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, 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.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 DefaultStringProperty()
Method Detail |
public java.lang.Class getPropertyType()
getPropertyType
in interface Property
protected java.lang.String getInternal()
protected void setInternal(java.lang.String newValue)
newValue
- the value to storeprotected void setInternal(char[] chars)
public 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.lang.String get()
StringProperty
get
in interface StringProperty
StringProperty.get()
public java.lang.String toDataString()
toDataString
in interface DataProperty
toDataString
in class AbstractProperty
DataProperty#toDataString()
public boolean equalsValueIgnoreCase(java.lang.Object object)
StringProperty
equalsValueIgnoreCase
in interface StringProperty
StringProperty.equalsValueIgnoreCase(Object)
public int compareTo(java.lang.Object object)
compareTo
in interface java.lang.Comparable
Comparable.compareTo(Object)
public boolean isEmpty()
StringProperty
isEmpty
in interface StringProperty
StringProperty.isEmpty()
public int length()
StringProperty
length
in interface StringProperty
StringProperty.length()
public boolean contains(java.lang.String searchString)
StringProperty
contains
in interface StringProperty
searchString
- the string to search for
StringProperty.contains(String)
public boolean endsWith(java.lang.String searchString)
StringProperty
endsWith
in interface StringProperty
searchString
- the string to search for
StringProperty.endsWith(String)
public boolean startsWith(java.lang.String searchString)
StringProperty
startsWith
in interface StringProperty
searchString
- the string to search for
StringProperty.startsWith(String)
public int indexOf(java.lang.String searchString)
StringProperty
indexOf
in interface StringProperty
searchString
- the string to search for
StringProperty.indexOf(String)
public int indexOf(java.lang.String searchString, int fromIndex)
StringProperty
indexOf
in interface StringProperty
searchString
- the string to search forfromIndex
- the index to start the search at
StringProperty.indexOf(String, int)
public int lastIndexOf(java.lang.String searchString)
StringProperty
lastIndexOf
in interface StringProperty
searchString
- the string to search for
StringProperty.lastIndexOf(String)
public char charAt(int index)
StringProperty
charAt
in interface StringProperty
index
- the index to obtain
StringProperty.charAt(int)
public java.lang.String substring(int beginIndex)
StringProperty
substring
in interface StringProperty
beginIndex
- the beginning index, inclusive
StringProperty.substring(int)
public java.lang.String substring(int beginIndex, int endIndex)
StringProperty
substring
in interface StringProperty
beginIndex
- the beginning index, inclusiveendIndex
- the ending index, exclusive
StringProperty.substring(int, int)
public java.lang.String left(int length)
StringProperty
left
in interface StringProperty
length
- the length of string to obtain
StringProperty.left(int)
public java.lang.String mid(int beginIndex, int length)
StringProperty
mid
in interface StringProperty
beginIndex
- the beginning index, inclusivelength
- the length of string to obtain
StringProperty.mid(int, int)
public java.lang.String right(int length)
StringProperty
right
in interface StringProperty
length
- the length of string to obtain
StringProperty.right(int)
protected java.lang.String convertObjectToString(java.lang.Object object)
object
- the value to convert
public java.lang.Class propertyType()
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 setCharAt(int index, char character)
StringProperty
setCharAt
in interface StringProperty
index
- the index to set the value atcharacter
- the character to set toStringProperty.setCharAt(int, char)
public void deleteCharAt(int index)
StringProperty
deleteCharAt
in interface StringProperty
index
- the index to set the value atStringProperty.deleteCharAt(int)
public void append(java.lang.Object appendValue)
StringProperty
append
in interface StringProperty
appendValue
- a value to append to the propertyStringProperty.append(Object)
public void insert(int insertIndex, java.lang.Object insertValue)
StringProperty
insert
in interface StringProperty
insertIndex
- the index at which to insertStringProperty.insert(int, Object)
public void delete(int startIndex, int endIndex)
StringProperty
delete
in interface StringProperty
startIndex
- the index at which to start, inclusiveendIndex
- the index at which to end deleting, exclusiveStringProperty.delete(int, int)
public void replace(java.lang.String searchString, java.lang.String replaceString)
StringProperty
replace
in interface StringProperty
searchString
- the string to search forreplaceString
- the string to replace it withStringProperty.replace(String, String)
public void setToLowerCase()
StringProperty
setToLowerCase
in interface StringProperty
StringProperty.setToLowerCase()
public void setToLowerCase(java.util.Locale locale)
StringProperty
setToLowerCase
in interface StringProperty
locale
- the locale to use for conversionStringProperty.setToLowerCase(Locale)
public void setToUpperCase()
StringProperty
setToUpperCase
in interface StringProperty
StringProperty.setToUpperCase()
public void setToUpperCase(java.util.Locale locale)
StringProperty
setToUpperCase
in interface StringProperty
locale
- the locale to use for conversionStringProperty.setToUpperCase(Locale)
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |