public class

CachingPropertySet

extends Object
implements PropertySet Serializable
java.lang.Object
   ↳ com.opensymphony.module.propertyset.cached.CachingPropertySet

Class Overview

A PropertySet which decorates another PropertySet and caches the results.

This is only sensible to use in a situation where your application has exclusive access to the underlying PropertySet (otherwise it can be dangerous to use).

You can also use this property set to bulk load data from the decorated property set when the PS is created.

THINK BEFORE USING THIS - IT COULD HURT YOU ;)

Required Args

  • PropertySet - the PropertySet that will be cached

Optional Args

  • bulkload - Boolean that, when true, causes the cache to be bulk loaded
  • serializableName - the name that can be used to retrieve a SerializablePropertySet, defaults to "serializable"

Summary

[Expand]
Inherited Constants
From interface com.opensymphony.module.propertyset.PropertySet
Public Constructors
CachingPropertySet()
Public Methods
boolean exists(String key)
Determine if property exists.
Object getAsActualType(String key)
boolean getBoolean(String key)
byte[] getData(String key)
Date getDate(String key)
double getDouble(String key)
int getInt(String key)
Collection getKeys()
List all keys.
Collection getKeys(int type)
List all keys of certain type.
Collection getKeys(String prefix)
List all keys starting with supplied prefix.
Collection getKeys(String prefix, int type)
List all keys starting with supplied prefix of certain type.
long getLong(String key)
Object getObject(String key)
Properties getProperties(String key)
PropertySetSchema getSchema()
String getString(String key)
String of maximum 255 chars.
String getText(String key)
String of unlimited length.
int getType(String key)
Returns type of value.
Document getXML(String key)
void init(Map config, Map args)
boolean isSettable(String property)
Whether this PropertySet implementation allows values to be set (as opposed to read-only).
void remove()
Remove the propertyset and all it associated keys.
void remove(String key)
Removes property.
void setAsActualType(String key, Object value)
void setBoolean(String key, boolean value)
void setData(String key, byte[] value)
void setDate(String key, Date value)
void setDouble(String key, double value)
void setInt(String key, int value)
void setLong(String key, long value)
void setObject(String key, Object value)
void setProperties(String key, Properties value)
void setSchema(PropertySetSchema schema)
void setString(String key, String value)
void setText(String key, String value)
void setXML(String key, Document value)
boolean supportsType(int type)
Whether this PropertySet implementation allows the type specified to be stored or retrieved.
boolean supportsTypes()
Whether this PropertySet implementation supports types when storing values.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.opensymphony.module.propertyset.PropertySet

Public Constructors

public CachingPropertySet ()

Public Methods

public boolean exists (String key)

Determine if property exists.

public Object getAsActualType (String key)

public boolean getBoolean (String key)

public byte[] getData (String key)

public Date getDate (String key)

public double getDouble (String key)

public int getInt (String key)

public Collection getKeys ()

List all keys.

Returns

public Collection getKeys (int type)

List all keys of certain type.

Parameters
type Type to list. See static class variables. If null, then all types shall be returned.
Returns

public Collection getKeys (String prefix)

List all keys starting with supplied prefix.

Parameters
prefix String that keys must start with. If null, than all keys shall be returned.
Returns

public Collection getKeys (String prefix, int type)

List all keys starting with supplied prefix of certain type. See statics.

Parameters
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.
Returns

public long getLong (String key)

public Object getObject (String key)

public Properties getProperties (String key)

public PropertySetSchema getSchema ()

public String getString (String key)

String of maximum 255 chars.

public String getText (String key)

String of unlimited length.

public int getType (String key)

Returns type of value.

Returns
  • Type of value. See static class variables.

public Document getXML (String key)

public void init (Map config, Map args)

public boolean isSettable (String property)

Whether this PropertySet implementation allows values to be set (as opposed to read-only).

public void remove ()

Remove the propertyset and all it associated keys.

public void remove (String key)

Removes property.

public void setAsActualType (String key, Object value)

public void setBoolean (String key, boolean value)

public void setData (String key, byte[] value)

public void setDate (String key, Date value)

public void setDouble (String key, double value)

public void setInt (String key, int value)

public void setLong (String key, long value)

public void setObject (String key, Object value)

public void setProperties (String key, Properties value)

public void setSchema (PropertySetSchema schema)

public void setString (String key, String value)

public void setText (String key, String value)

public void setXML (String key, Document value)

public boolean supportsType (int type)

Whether this PropertySet implementation allows the type specified to be stored or retrieved.

public boolean supportsTypes ()

Whether this PropertySet implementation supports types when storing values. (i.e. the type of data is stored as well as the actual value).