public interface PersistentState
Modifier and Type | Method and Description |
---|---|
void |
derelativizeFiles(java.io.File rootFolder)
Make absolutes all files, urls and uris that are in this state from the
folder specified.
|
java.lang.Object |
get(java.lang.String name)
Gets an
Object property. |
java.lang.Object[] |
getArray(java.lang.String name,
java.lang.Class valueClass)
Returns an array whose elements are of the class given.
|
boolean |
getBoolean(java.lang.String name)
Gets a
boolean property. |
boolean |
getBoolean(java.lang.String name,
boolean defaultValue) |
boolean[] |
getBooleanArray(java.lang.String name)
Returns an array whose elements are of boolean basic type.
|
PersistentContext |
getContext() |
java.util.Date |
getDate(java.lang.String name)
Gets a
Date property. |
java.util.Date[] |
getDateArray(java.lang.String name)
Returns an array whose elements are of Date type.
|
DynStruct |
getDefinition()
Returns the struct definition associated to this state
|
double |
getDouble(java.lang.String name)
Gets a
double property. |
double |
getDouble(java.lang.String name,
double defaultValue) |
double[] |
getDoubleArray(java.lang.String name)
Returns an array whose elements are of double basic type.
|
java.io.File |
getFile(java.lang.String name) |
float |
getFloat(java.lang.String name)
Gets a
float property. |
float |
getFloat(java.lang.String name,
float defaultValue) |
float[] |
getFloatArray(java.lang.String name)
Returns an array whose elements are of float basic type.
|
int |
getInt(java.lang.String name)
Gets an
int property. |
int |
getInt(java.lang.String name,
int defaultValue) |
int[] |
getIntArray(java.lang.String name)
Returns an array whose elements are of int basic type.
|
java.util.Iterator |
getIterator(java.lang.String name)
Gets an
Iterator over properties of types List ,
Set or Map . |
java.util.List |
getList(java.lang.String name)
Gets a
List property. |
long |
getLong(java.lang.String name)
Gets an
long property. |
long |
getLong(java.lang.String name,
long defaultValue) |
long[] |
getLongArray(java.lang.String name)
Returns an array whose elements are of long basic type.
|
java.util.Map |
getMap(java.lang.String name)
Gets a
Map property. |
java.util.Iterator |
getNames()
Gets an iterator over the names of the properties contained in this
PersistentState.
|
java.util.Set |
getSet(java.lang.String name)
Gets a
Set property. |
java.lang.String |
getString(java.lang.String name)
Gets a
String property. |
java.lang.String[] |
getStringArray(java.lang.String name)
Returns an array whose elements are of String type.
|
java.lang.String |
getTheClassName()
Gets the name of the java class corresponding to this persistent state
|
java.net.URI |
getURI(java.lang.String name) |
java.net.URL |
getURL(java.lang.String name) |
boolean |
hasValue(java.lang.String name)
Informs that a property is set or not.
|
boolean |
isNull(java.lang.String name) |
void |
relativizeFiles(java.io.File rootFolder)
Make relatives all files, urls and uris that are in this state from the
folder specified.
|
void |
set(java.lang.String name,
boolean value)
Sets a property of type boolean.
|
void |
set(java.lang.String name,
java.lang.Boolean value)
Sets a property of type
Boolean . |
void |
set(java.lang.String name,
boolean[] value)
Sets a property of type
List with an array of boolean. |
void |
set(java.lang.String name,
java.util.Date value)
Sets a property of type
Date . |
void |
set(java.lang.String name,
java.util.Date[] value)
Sets a property of type
List with an array of Date. |
void |
set(java.lang.String name,
double value)
Sets a property of type double.
|
void |
set(java.lang.String name,
java.lang.Double value)
Sets a property of type
Double . |
void |
set(java.lang.String name,
double[] value)
Sets a property of type
List with an array of double. |
void |
set(java.lang.String name,
java.io.File value) |
void |
set(java.lang.String name,
float value)
Sets a property of type float.
|
void |
set(java.lang.String name,
java.lang.Float value)
Sets a property of type
Float . |
void |
set(java.lang.String name,
float[] value)
Sets a property of type
List with an array of float. |
void |
set(java.lang.String name,
int value)
Sets a property of type int.
|
void |
set(java.lang.String name,
int[] value)
Sets a property of type
List with an array of int. |
void |
set(java.lang.String name,
java.lang.Integer value)
Sets a property of type
Integer . |
void |
set(java.lang.String name,
java.util.Iterator it)
Sets a property of type
List (like do
set(String, List) ) filled with the values provided by a
Iterator
The items of the iteration must be persistence supported types instance. |
void |
set(java.lang.String name,
java.util.List value)
Sets a property of type
List . |
void |
set(java.lang.String name,
long value)
Sets a property of type long.
|
void |
set(java.lang.String name,
java.lang.Long value)
Sets a property of type
Long . |
void |
set(java.lang.String name,
long[] value)
Sets a property of type
List with an array of long. |
void |
set(java.lang.String name,
java.util.Map value)
Sets a property of type
Map . |
void |
set(java.lang.String name,
java.lang.Object value)
Sets a property.
|
void |
set(java.lang.String name,
java.lang.Object[] value)
Sets a property of type
List with an array. |
void |
set(java.lang.String name,
Persistent obj)
Sets a property of type Persistent.
|
void |
set(java.lang.String name,
java.util.Set value)
Sets a property of type
Set . |
void |
set(java.lang.String name,
java.lang.String value)
Sets a property of type String.
|
void |
set(java.lang.String name,
java.lang.String[] value)
Sets a property of type
List with an array of String. |
void |
set(java.lang.String name,
java.net.URI value) |
void |
set(java.lang.String name,
java.net.URL value) |
void |
setNull(java.lang.String name) |
java.lang.String getTheClassName()
DynStruct getDefinition()
PersistentContext getContext()
int getInt(java.lang.String name) throws PersistenceException
int
property.name
- The name of the property to getint
property associated to the provided namePersistenceException
int getInt(java.lang.String name, int defaultValue) throws PersistenceException
PersistenceException
long getLong(java.lang.String name) throws PersistenceException
long
property.name
- The name of the property to getlong
property associated to the provided namePersistenceException
long getLong(java.lang.String name, long defaultValue) throws PersistenceException
PersistenceException
java.util.Date getDate(java.lang.String name) throws PersistenceException
Date
property.name
- Date
property associated to the provided namePersistenceException
double getDouble(java.lang.String name) throws PersistenceException
double
property.name
- The name of the property to getdouble
property associated to the provided namePersistenceException
double getDouble(java.lang.String name, double defaultValue) throws PersistenceException
PersistenceException
float getFloat(java.lang.String name) throws PersistenceException
float
property.name
- The name of the property to getfloat
property associated to the provided namePersistenceException
float getFloat(java.lang.String name, float defaultValue) throws PersistenceException
PersistenceException
boolean getBoolean(java.lang.String name) throws PersistenceException
boolean
property.name
- The name of the property to getboolean
property associated to the provided namePersistenceException
boolean getBoolean(java.lang.String name, boolean defaultValue) throws PersistenceException
PersistenceException
java.lang.String getString(java.lang.String name) throws PersistenceException
String
property.name
- The name of the property to getString
property associated to the provided namePersistenceException
java.util.List getList(java.lang.String name) throws PersistenceException
List
property.
Don't use the returned List as it is, as it may not work as you
expect. Instead, choose you own implementation and do something
like:
List myAttribute = new ArrayList(state.getList("prop"))
name
- The name of the property to getList
property value associated to the provided namePersistenceException
- if there is an error getting the property
valuejava.lang.Object[] getArray(java.lang.String name, java.lang.Class valueClass) throws PersistenceException
DynStruct
must be List.
Ex:
Color[] colors = (Color[])state.getArray("colors", Color.class);
name
- The name of the property to getvalueClass
- the class of the array elementsPersistenceException
- if there is an error getting the property
valueboolean[] getBooleanArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property
valueint[] getIntArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property
valuelong[] getLongArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property
valuefloat[] getFloatArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property
valuedouble[] getDoubleArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property
valuejava.util.Date[] getDateArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- PersistenceException
java.lang.String[] getStringArray(java.lang.String name) throws PersistenceException
DynStruct
must be List.name
- PersistenceException
java.util.Map getMap(java.lang.String name) throws PersistenceException
Map
property. Don't use the returned Map as is, as
it may not be a real usable Map implementation.
Don't use the returned Map as it is, as it may not work as you
expect. Instead, choose you own implementation and do something
like:
Map myAttribute = new HashMap(state.getSet("prop"))
name
- The name of the property to getMap
property value associated to the provided namePersistenceException
- if there is an error getting the property
valuejava.util.Set getSet(java.lang.String name) throws PersistenceException
Set
property.
Don't use the returned Set as it is, as it may not work as you
expect. Instead, choose you own implementation and do something
like:
Set myAttribute = new HashSet(state.getSet("prop"))
name
- The name of the property to getSet
property value associated to the provided namePersistenceException
- if there is an error getting the property
valuejava.net.URL getURL(java.lang.String name) throws PersistenceException
PersistenceException
java.net.URI getURI(java.lang.String name) throws PersistenceException
PersistenceException
java.io.File getFile(java.lang.String name) throws PersistenceException
PersistenceException
java.lang.Object get(java.lang.String name) throws PersistenceException
Object
property.name
- The name of the property to getObject
property associated to the provided namePersistenceException
boolean isNull(java.lang.String name)
java.util.Iterator getIterator(java.lang.String name) throws PersistenceException
Gets an Iterator
over properties of types List
,
Set
or Map
.
name
- The name of the property to getIterator
associated to the property value of
provided namePersistenceException
void set(java.lang.String name, java.lang.String value) throws PersistenceException
Sets a property of type String.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.io.File value) throws PersistenceException
PersistenceException
void set(java.lang.String name, java.net.URL value) throws PersistenceException
PersistenceException
void set(java.lang.String name, java.net.URI value) throws PersistenceException
PersistenceException
void set(java.lang.String name, int value) throws PersistenceException
Sets a property of type int.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, long value) throws PersistenceException
Sets a property of type long.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, double value) throws PersistenceException
Sets a property of type double.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, float value) throws PersistenceException
Sets a property of type float.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, boolean value) throws PersistenceException
Sets a property of type boolean.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, Persistent obj) throws PersistenceException
Sets a property of type Persistent.
name
- The name of the property to store (must be a valid Java
identifier)obj
- The Persistent object to be stored in the state.PersistenceException
void set(java.lang.String name, java.util.List value) throws PersistenceException
Sets a property of type List
.
The items of the list must be persistence supported types instance.
get(String)
return an read only List
instance after
#load(Reader)
name
- The name of the property to store (must be a valid Java
identifier)value
- The List
object to be stored in the state.PersistenceException
void set(java.lang.String name, java.lang.Object[] value) throws PersistenceException
List
with an array. To be able to store
and load a property as an array, the type of the property defined in the
DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, int[] value) throws PersistenceException
List
with an array of int. To be able to
store and load a property as an array, the type of the property defined
in the DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, long[] value) throws PersistenceException
List
with an array of long. To be able to
store and load a property as an array, the type of the property defined
in the DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, float[] value) throws PersistenceException
List
with an array of float. To be able
to store and load a property as an array, the type of the property
defined in the DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, double[] value) throws PersistenceException
List
with an array of double. To be able
to store and load a property as an array, the type of the property
defined in the DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, java.util.Date[] value) throws PersistenceException
List
with an array of Date.
To be able to store and load a property as an array, the type of the
property defined in the DynStruct
must be List.name
- value
- the Date array to set.PersistenceException
void set(java.lang.String name, java.lang.String[] value) throws PersistenceException
List
with an array of String.
To be able to store and load a property as an array, the type of the
property defined in the DynStruct
must be List.name
- value
- PersistenceException
void set(java.lang.String name, boolean[] value) throws PersistenceException
List
with an array of boolean. To be able
to store and load a property as an array, the type of the property
defined in the DynStruct
must be List.name
- The name of the property to setvalue
- the value to setPersistenceException
- if there is an error setting the property
valuevoid set(java.lang.String name, java.util.Set value) throws PersistenceException
Sets a property of type Set
.
The items of the set must be persistence supported type instances.
get(String)
return an read only Set
instance after
#load(Reader)
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.util.Map value) throws PersistenceException
Sets a property of type Map
.
The values and keys of the map must be persistence supported type instances.
get(String)
return an read only Map
instance after
#load(Reader)
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.lang.Boolean value) throws PersistenceException
Sets a property of type Boolean
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.util.Date value) throws PersistenceException
Sets a property of type Date
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.lang.Integer value) throws PersistenceException
Sets a property of type Integer
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.lang.Long value) throws PersistenceException
Sets a property of type Long
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.lang.Float value) throws PersistenceException
Sets a property of type Float
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.lang.Double value) throws PersistenceException
Sets a property of type Double
.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void set(java.lang.String name, java.util.Iterator it) throws PersistenceException
Sets a property of type List
(like do
set(String, List)
) filled with the values provided by a
Iterator
The items of the iteration must be persistence supported types instance.
name
- The name of the property to store (must be a valid Java
identifier)it
- The iterator to get values to store in the list property.PersistenceException
#set(String, List)}
void set(java.lang.String name, java.lang.Object value) throws PersistenceException
Sets a property.
value
must be a supported type or manager must have a
PersistenceFactory
that know how persist it.
name
- The name of the property to store (must be a valid Java
identifier)value
- PersistenceException
void setNull(java.lang.String name) throws PersistenceException
PersistenceException
java.util.Iterator getNames()
Gets an iterator over the names of the properties contained in this PersistentState.
boolean hasValue(java.lang.String name)
name
- void relativizeFiles(java.io.File rootFolder)
rootFolder
- void derelativizeFiles(java.io.File rootFolder)
rootFolder
-