|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.portal.provider.v2.preference.Preference
public final class Preference
A Preference
is the 'key' through which PreferenceDataObject
s are stored and retrieved from a PreferenceStore
. The main component of this key is the reference
path. A reference path is a string consisting of zero or more path
components, each delimited by a '/'
character. A path
component is a string of one or more unicode characters, not including the
'/'
character. It is illegal for a path component to be equal
to the strings "."
or ".."
.
The idea is that a data item associated with a particular application object
is stored under a reference path composed from a 'context' reference
path which uniquely identifies the object within the context of its 'parent'
objects, appended with a path component which uniquely identifies the data
item. An example form of reference path corresponding to user-specific data
associated with a portlet instance might be "<provider id>/<portlet
id>/<portlet instance name>/<user name>"
.
To prevent one reference path naming scheme from 'clashing' with another in
the preference store, the Preference
key contains an additional
preference type component, which should group together all reference
paths of the same 'type'. A naming scheme similar to the one used for Java
package names should be used to ensure uniqueness of path types,
e.g. "oracle.portal.provider.v2.user"
.
The final component of the Preference
key is the class name of
the PreferenceDataObject
to be stored or retrieved. This
component is only mandatory if the Preference
is to be read
from storage, as it can be automatically determined for data objects
provided for writing to storage.
Constructor Summary | |
---|---|
Preference(java.lang.String referencePath,
java.lang.String type,
PreferenceDataObject data)
Constructs a Preference for writing the given data object. |
|
Preference(java.lang.String referencePath,
java.lang.String type,
java.lang.String dataClassName)
Constructs a Preference for reading data with the given
class. |
|
Preference(java.lang.String contextPath,
java.lang.String name,
java.lang.String type,
PreferenceDataObject data)
Constructs a Preference for writing the given data object. |
|
Preference(java.lang.String contextPath,
java.lang.String name,
java.lang.String type,
java.lang.String dataClassName)
Constructs a Preference for reading data with the given
class. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getContextPath()
Gets the context path of this Preference . |
PreferenceDataObject |
getData()
Get the data object associated with this Preference . |
java.lang.Class |
getDataClass()
Gets the Class object representing the class of the PreferenceDataObject stored against this preference. |
java.lang.String |
getDataClassName()
Gets the full class name of the PreferenceDataObject stored
against this preference. |
java.lang.String |
getName()
Gets the name which identifies this Preference within its
context path. |
java.lang.String |
getReferencePath()
Gets the full reference path of this Preference , consisting
of a a context path followed by a unique name. |
java.lang.String |
getType()
Gets the preference type. |
int |
hashCode()
Returns a hash code value for the object. |
void |
setData(PreferenceDataObject dataObject)
Sets the data object to be stored under this Preference . |
void |
setDataClass(java.lang.Class dataClass)
Sets the Class object representing the class of the PreferenceDataObject to be loaded into this
Preference . |
void |
setDataClass(java.lang.String dataClassName)
Sets the full class name of the PreferenceDataObject to be
loaded into this Preference . |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Preference(java.lang.String contextPath, java.lang.String name, java.lang.String type, java.lang.String dataClassName) throws PreferenceStoreException
Preference
for reading data with the given
class.
contextPath
- the context path of this Preference
.name
- the name which identifies the preference within the context
path.type
- the preference type. Should be a String name which follows
the conventions for naming Java packages,
e.g. "oracle.portal.provider.v2.user"
.dataClassName
- the full class name of the PreferenceDataObject
stored under this Preference
.
PreferenceStoreException
public Preference(java.lang.String referencePath, java.lang.String type, java.lang.String dataClassName) throws PreferenceStoreException
Preference
for reading data with the given
class.
referencePath
- the full reference path of this
Preference
, including a context path followed by a unique
name.type
- the preference type. Should be a String name which follows
the conventions for naming Java packages,
e.g. "oracle.portal.provider.v2.user"
.dataClassName
- the full class name of the PreferenceDataObject
stored under this Preference
.
PreferenceStoreException
public Preference(java.lang.String contextPath, java.lang.String name, java.lang.String type, PreferenceDataObject data) throws PreferenceStoreException
Preference
for writing the given data object.
contextPath
- the context path of this Preference
.name
- the name which identifies the preference within the context
path.type
- the preference type. Should be a String name which follows
the conventions for naming Java packages,
e.g. "oracle.portal.provider.v2.user"
.data
- the data object to be stored.
PreferenceStoreException
public Preference(java.lang.String referencePath, java.lang.String type, PreferenceDataObject data) throws PreferenceStoreException
Preference
for writing the given data object.
referencePath
- the full reference path of this
Preference
, including a context path followed by a unique
name.type
- the preference type. Should be a String name which follows
the conventions for naming Java packages,
e.g. "oracle.portal.provider.v2.user"
.data
- the data object to be stored.
PreferenceStoreException
Method Detail |
---|
public java.lang.String getReferencePath()
Preference
, consisting
of a a context path followed by a unique name.
Preference
public java.lang.String getName()
Preference
within its
context path.
Preference
within
its context path.public java.lang.String getContextPath()
Preference
.
Preference
public java.lang.String getType()
"oracle.portal.provider.v2.user"
.public java.lang.String getDataClassName()
PreferenceDataObject
stored
against this preference.
PreferenceDataObject
stored
against this preference, if known, or null
otherwise.public java.lang.Class getDataClass() throws PreferenceStoreException
Class
object representing the class of the PreferenceDataObject
stored against this preference.
Class
object representing the class of the PreferenceDataObject
stored against this preference, if known, or
null
otherwise.
PreferenceStoreException
- if the class is unknown, or cannot
be loaded.public PreferenceDataObject getData()
Preference
. The
Preference
's data object must have been supplied during
construction or loaded using PreferenceStore.read(oracle.portal.provider.v2.preference.Preference)
for this
method to return a non-null value.
Preference
, or
null
if one hasn't yet been loaded.public void setDataClass(java.lang.String dataClassName) throws PreferenceStoreException
PreferenceDataObject
to be
loaded into this Preference
. Note that if a data object is
currently held in this Preference
, this will remove it as a
side effect. Note also that if the named class cannot be loaded, this will
not cause an exception, as it will still be possible to read the data as
an input stream using PreferenceStore.getInputStream(oracle.portal.provider.v2.preference.Preference)
.
dataClassName
- the full class name of the PreferenceDataObject
to be loaded into this Preference
.
PreferenceStoreException
- if the class is not a subclass of
PreferenceDataObject
.public void setDataClass(java.lang.Class dataClass) throws PreferenceStoreException
Class
object representing the class of the PreferenceDataObject
to be loaded into this
Preference
. Note that if a data object is currently held in
this Preference
, this will remove it as a side effect.
dataClass
- the class of type PreferenceDataObject
to be loaded into this Preference
.
PreferenceStoreException
- if the class is not a subclass of
PreferenceDataObject
.public void setData(PreferenceDataObject dataObject) throws PreferenceStoreException
Preference
.
dataObject
- the data object to be stored under this
Preference
.
PreferenceStoreException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- - the reference object with which to compare.
public int hashCode()
hashCode
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |