|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.opensymphony.module.propertyset.AbstractPropertySet
Base implementation of PropertySet.
Performs necessary casting for get???/set??? methods which wrap around the
following 2 methods which are declared protected abstract
and need
to be implemented by subclasses:
The following methods are declared public abstract
and are the
remainder of the methods that need to be implemented at the very least:
exists(java.lang.String)
remove(java.lang.String)
getType(java.lang.String)
getKeys(java.lang.String,int)
The supports???
methods are implemented and all return true by default.
Override if necessary.
Field Summary | |
protected PropertySetSchema |
schema
|
Fields inherited from interface com.opensymphony.module.propertyset.PropertySet |
BOOLEAN, DATA, DATE, DOUBLE, INT, LONG, OBJECT, PROPERTIES, STRING, TEXT, XML |
Constructor Summary | |
AbstractPropertySet()
|
Method Summary | |
abstract boolean |
exists(java.lang.String key)
Determine if property exists. |
protected abstract java.lang.Object |
get(int type,
java.lang.String key)
|
boolean |
getBoolean(java.lang.String key)
|
byte[] |
getData(java.lang.String key)
Casts to Data and returns bytes. |
java.util.Date |
getDate(java.lang.String key)
|
double |
getDouble(java.lang.String key)
|
int |
getInt(java.lang.String key)
|
java.util.Collection |
getKeys()
Calls getKeys(null,0) |
java.util.Collection |
getKeys(int type)
Calls getKeys(null,type) |
java.util.Collection |
getKeys(java.lang.String prefix)
Calls getKeys(prefix,0) |
abstract java.util.Collection |
getKeys(java.lang.String prefix,
int type)
List all keys starting with supplied prefix of certain type. |
long |
getLong(java.lang.String key)
|
java.lang.Object |
getObject(java.lang.String key)
|
java.util.Properties |
getProperties(java.lang.String key)
|
PropertySetSchema |
getSchema()
|
java.lang.String |
getString(java.lang.String key)
String of maximum 255 chars. |
java.lang.String |
getText(java.lang.String key)
String of unlimited length. |
abstract int |
getType(java.lang.String key)
Returns type of value. |
org.w3c.dom.Document |
getXML(java.lang.String key)
|
boolean |
isSettable(java.lang.String property)
Returns true. |
abstract void |
remove(java.lang.String key)
Removes property. |
void |
setAsActualType(java.lang.String key,
java.lang.Object value)
|
void |
setBoolean(java.lang.String key,
boolean value)
|
void |
setData(java.lang.String key,
byte[] value)
Constructs Data wrapper around bytes. |
void |
setDate(java.lang.String key,
java.util.Date value)
|
void |
setDouble(java.lang.String key,
double value)
|
protected abstract void |
setImpl(int type,
java.lang.String key,
java.lang.Object value)
|
void |
setInt(java.lang.String key,
int value)
|
void |
setLong(java.lang.String key,
long value)
|
void |
setObject(java.lang.String key,
java.lang.Object value)
|
void |
setProperties(java.lang.String key,
java.util.Properties value)
|
void |
setSchema(PropertySetSchema schema)
|
void |
setString(java.lang.String key,
java.lang.String value)
Throws IllegalPropertyException if value length greater than 255. |
void |
setText(java.lang.String key,
java.lang.String value)
|
void |
setXML(java.lang.String key,
org.w3c.dom.Document value)
|
boolean |
supportsType(int type)
Returns true. |
boolean |
supportsTypes()
Returns true. |
java.lang.String |
toString()
Simple human readable representation of contents of PropertySet. |
protected java.lang.String |
type(int type)
|
protected int |
type(java.lang.String type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected PropertySetSchema schema
Constructor Detail |
public AbstractPropertySet()
Method Detail |
public abstract boolean exists(java.lang.String key) throws PropertyException
PropertySet
exists
in interface PropertySet
public abstract void remove(java.lang.String key) throws PropertyException
PropertySet
remove
in interface PropertySet
public abstract int getType(java.lang.String key) throws PropertyException
PropertySet
getType
in interface PropertySet
com.opensymphony.module.propertyset.PropertySet
public abstract java.util.Collection getKeys(java.lang.String prefix, int type) throws PropertyException
PropertySet
getKeys
in interface PropertySet
com.opensymphony.module.propertyset.PropertySet
prefix
- String that keys must start with. If null, than all
keys shall be returned.type
- Type to list. See static class variables. If null, then
all types shall be returned.Collection
of
String
s.protected abstract java.lang.Object get(int type, java.lang.String key) throws PropertyException
protected abstract void setImpl(int type, java.lang.String key, java.lang.Object value) throws PropertyException
public void setSchema(PropertySetSchema schema)
setSchema
in interface PropertySet
public PropertySetSchema getSchema()
getSchema
in interface PropertySet
public boolean getBoolean(java.lang.String key)
getBoolean
in interface PropertySet
public void setBoolean(java.lang.String key, boolean value)
setBoolean
in interface PropertySet
public int getInt(java.lang.String key)
getInt
in interface PropertySet
public void setInt(java.lang.String key, int value)
setInt
in interface PropertySet
public long getLong(java.lang.String key)
getLong
in interface PropertySet
public void setLong(java.lang.String key, long value)
setLong
in interface PropertySet
public double getDouble(java.lang.String key)
getDouble
in interface PropertySet
public void setDouble(java.lang.String key, double value)
setDouble
in interface PropertySet
public java.lang.String getString(java.lang.String key)
PropertySet
String
of maximum 255 chars.getString
in interface PropertySet
public void setString(java.lang.String key, java.lang.String value)
setString
in interface PropertySet
public java.lang.String getText(java.lang.String key)
PropertySet
String
of unlimited length.getText
in interface PropertySet
public void setText(java.lang.String key, java.lang.String value)
setText
in interface PropertySet
public java.util.Date getDate(java.lang.String key)
getDate
in interface PropertySet
public void setDate(java.lang.String key, java.util.Date value)
setDate
in interface PropertySet
public java.lang.Object getObject(java.lang.String key)
getObject
in interface PropertySet
public void setObject(java.lang.String key, java.lang.Object value)
setObject
in interface PropertySet
public org.w3c.dom.Document getXML(java.lang.String key)
getXML
in interface PropertySet
public void setXML(java.lang.String key, org.w3c.dom.Document value)
setXML
in interface PropertySet
public void setAsActualType(java.lang.String key, java.lang.Object value) throws PropertyException
setAsActualType
in interface PropertySet
public byte[] getData(java.lang.String key)
Data
and returns bytes.getData
in interface PropertySet
public void setData(java.lang.String key, byte[] value)
Data
wrapper around bytes.setData
in interface PropertySet
public java.util.Properties getProperties(java.lang.String key)
getProperties
in interface PropertySet
public void setProperties(java.lang.String key, java.util.Properties value)
setProperties
in interface PropertySet
public java.util.Collection getKeys() throws PropertyException
getKeys(null,0)
getKeys
in interface PropertySet
com.opensymphony.module.propertyset.PropertySet
Collection
of
String
s.public java.util.Collection getKeys(int type) throws PropertyException
getKeys(null,type)
getKeys
in interface PropertySet
com.opensymphony.module.propertyset.PropertySet
type
- Type to list. See static class variables. If null, then
all types shall be returned.Collection
of
String
s.public java.util.Collection getKeys(java.lang.String prefix) throws PropertyException
getKeys(prefix,0)
getKeys
in interface PropertySet
com.opensymphony.module.propertyset.PropertySet
prefix
- String that keys must start with. If null, than all
keys shall be returned.Collection
of
String
s.public boolean supportsTypes()
supportsTypes
in interface PropertySet
public boolean supportsType(int type)
supportsType
in interface PropertySet
public boolean isSettable(java.lang.String property)
isSettable
in interface PropertySet
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String type(int type)
protected int type(java.lang.String type)
|
See www.opensymphony.com for more information. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |