public interface PersistentState
Modifier and Type | Method and Description |
---|---|
void |
derelativizeFiles(File rootFolder)
Make absolutes all files, urls and uris that are in this state
from the folder specified.
|
Object |
get(String name)
Gets an
Object property. |
Object[] |
getArray(String name,
Class valueClass)
Returns an array whose elements are of the class given.
|
boolean |
getBoolean(String name)
Gets a
boolean property. |
boolean[] |
getBooleanArray(String name)
Returns an array whose elements are of boolean basic type.
|
PersistentContext |
getContext() |
Date |
getDate(String name)
Gets a
Date property. |
Date[] |
getDateArray(String name)
Returns an array whose elements are of Date type.
|
DynStruct |
getDefinition()
Returns the struct definition associated to this state
|
double |
getDouble(String name)
Gets a
double property. |
double[] |
getDoubleArray(String name)
Returns an array whose elements are of double basic type.
|
File |
getFile(String name) |
float |
getFloat(String name)
Gets a
float property. |
float[] |
getFloatArray(String name)
Returns an array whose elements are of float basic type.
|
int |
getInt(String name)
Gets an
int property. |
int[] |
getIntArray(String name)
Returns an array whose elements are of int basic type.
|
Iterator |
getIterator(String name)
|
List |
getList(String name)
Gets a
List property. |
long |
getLong(String name)
Gets an
long property. |
long[] |
getLongArray(String name)
Returns an array whose elements are of long basic type.
|
Map |
getMap(String name)
Gets a
Map property. |
Iterator |
getNames()
Gets an iterator over the names of the properties contained
in this PersistentState.
|
Set |
getSet(String name)
Gets a
Set property. |
String |
getString(String name)
Gets a
String property. |
String[] |
getStringArray(String name)
Returns an array whose elements are of String type.
|
String |
getTheClassName()
Gets the name of the java class corresponding to this persistent state
|
URI |
getURI(String name) |
URL |
getURL(String name) |
boolean |
hasValue(String name)
Informs that a property is set or not.
|
void |
relativizeFiles(File rootFolder)
Make relatives all files, urls and uris that are in this state
from the folder specified.
|
void |
set(String name,
boolean value)
Sets a property of type boolean.
|
void |
set(String name,
Boolean value)
Sets a property of type
Boolean . |
void |
set(String name,
boolean[] value)
Sets a property of type
List with an array of boolean. |
void |
set(String name,
Date value)
Sets a property of type
Date . |
void |
set(String name,
Date[] value)
Sets a property of type
List with an array of Date. |
void |
set(String name,
double value)
Sets a property of type double.
|
void |
set(String name,
Double value)
Sets a property of type
Double . |
void |
set(String name,
double[] value)
Sets a property of type
List with an array of double. |
void |
set(String name,
File value) |
void |
set(String name,
float value)
Sets a property of type float.
|
void |
set(String name,
Float value)
Sets a property of type
Float . |
void |
set(String name,
float[] value)
Sets a property of type
List with an array of float. |
void |
set(String name,
int value)
Sets a property of type int.
|
void |
set(String name,
int[] value)
Sets a property of type
List with an array of int. |
void |
set(String name,
Integer value)
Sets a property of type
Integer . |
void |
set(String name,
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(String name,
List value)
Sets a property of type
List . |
void |
set(String name,
long value)
Sets a property of type long.
|
void |
set(String name,
Long value)
Sets a property of type
Long . |
void |
set(String name,
long[] value)
Sets a property of type
List with an array of long. |
void |
set(String name,
Map value)
Sets a property of type
Map . |
void |
set(String name,
Object value)
Sets a property.
|
void |
set(String name,
Object[] value)
Sets a property of type
List with an array. |
void |
set(String name,
Persistent obj)
Sets a property of type Persistent.
|
void |
set(String name,
Set value)
Sets a property of type
Set . |
void |
set(String name,
String value)
Sets a property of type String.
|
void |
set(String name,
String[] value)
Sets a property of type
List with an array of String. |
void |
set(String name,
URI value) |
void |
set(String name,
URL value) |
void |
setNull(String name) |
String getTheClassName()
DynStruct getDefinition()
PersistentContext getContext()
int getInt(String name) throws PersistenceException
int
property.name
- The name of the property to getint
property associated to the provided namePersistenceException
long getLong(String name) throws PersistenceException
long
property.name
- The name of the property to getlong
property associated to the provided namePersistenceException
Date getDate(String name) throws PersistenceException
Date
property.name
- Date
property associated to the provided namePersistenceException
double getDouble(String name) throws PersistenceException
double
property.name
- The name of the property to getdouble
property associated to the provided namePersistenceException
float getFloat(String name) throws PersistenceException
float
property.name
- The name of the property to getfloat
property associated to the provided namePersistenceException
boolean getBoolean(String name) throws PersistenceException
boolean
property.name
- The name of the property to getboolean
property associated to the provided namePersistenceException
String getString(String name) throws PersistenceException
String
property.name
- The name of the property to getString
property associated to the provided namePersistenceException
List getList(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 valueObject[] getArray(String name, 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(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(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(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(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(String name) throws PersistenceException
DynStruct
must be List.name
- The name of the property to getPersistenceException
- if there is an error getting the property valueDate[] getDateArray(String name) throws PersistenceException
DynStruct
must be List.name
- PersistenceException
String[] getStringArray(String name) throws PersistenceException
DynStruct
must be List.name
- PersistenceException
Map getMap(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 valueSet getSet(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 valueURL getURL(String name) throws PersistenceException
PersistenceException
URI getURI(String name) throws PersistenceException
PersistenceException
File getFile(String name) throws PersistenceException
PersistenceException
Object get(String name) throws PersistenceException
Object
property.name
- The name of the property to getObject
property associated to the provided namePersistenceException
Iterator getIterator(String name) throws PersistenceException
name
- The name of the property to getIterator
associated to the property value of
provided namePersistenceException
void set(String name, String value) throws PersistenceException
Sets a property of type String.
name
- The name of the property to store (must be a valid Java
identifier)it
- The String object to be stored in the state.PersistenceException
void set(String name, File value) throws PersistenceException
PersistenceException
void set(String name, URL value) throws PersistenceException
PersistenceException
void set(String name, URI value) throws PersistenceException
PersistenceException
void set(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)it
- The int value to be stored in the state.PersistenceException
void set(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)it
- The long value to be stored in the state.PersistenceException
void set(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)it
- The double value to be stored in the state.PersistenceException
void set(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)it
- The float value to be stored in the state.PersistenceException
void set(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)it
- The boolean value to be stored in the state.PersistenceException
void set(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(String name, 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(String name, 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(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(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(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(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(String name, 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(String name, 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(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(String name, 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)it
- The Set
object to be stored in the state.PersistenceException
void set(String name, 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)it
- The Map
object to be stored in the state.PersistenceException
void set(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)it
- The Boolean
object to be stored in the state.PersistenceException
void set(String name, Date value) throws PersistenceException
Sets a property of type Date
.
name
- The name of the property to store (must be a valid Java
identifier)it
- The Date
object to be stored in the state.PersistenceException
void set(String name, Integer value) throws PersistenceException
Sets a property of type Integer
.
name
- The name of the property to store (must be a valid Java
identifier)it
- The Integer
object to be stored in the state.PersistenceException
void set(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)it
- The Long
object to be stored in the state.PersistenceException
void set(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)it
- The Float
object to be stored in the state.PersistenceException
void set(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)it
- The Double
object to be stored in the state.PersistenceException
void set(String name, 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(String name, 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)it
- The Float
object to be stored in the state.PersistenceException
void setNull(String name) throws PersistenceException
PersistenceException
Iterator getNames()
Gets an iterator over the names of the properties contained in this PersistentState.
boolean hasValue(String name)
name
- void relativizeFiles(File rootFolder)
rootFolder
- void derelativizeFiles(File rootFolder)
rootFolder
-