wt.prefs
Class PrefEntrySelector

java.lang.Object
  extended bywt.prefs.PrefEntrySelector
All Implemented Interfaces:
Externalizable, NetFactor, ObjectMappable, Serializable

public class PrefEntrySelector
extends Object
implements Serializable, ObjectMappable, Externalizable

PrefEntry selector retrieves PrefEntry based on name, node and context.

Use the newPrefEntrySelector static factory method(s), not the PrefEntrySelector constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String context
           
static String CONTEXT
          Label for the attribute.
private static int CONTEXT_UPPER_LIMIT
           
private static boolean DEBUG
           
private static Class DEFAULT_DBPREFENTRY
           
private static Class DEFAULT_PREFENTRY
           
private  PrefEntry entry
           
static String ENTRY
          Label for the attribute; Entries retrieved by the selector.
static long EXTERNALIZATION_VERSION_UID
           
private static Constructor instance
           
private static PreferenceMapping map
           
private static Vector MapTypes
           
private  String name
           
static String NAME
          Label for the attribute.
private static int NAME_UPPER_LIMIT
           
private  String node
           
static String NODE
          Label for the attribute.
private static int NODE_UPPER_LIMIT
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  ObjectReference user
           
static String USER
          Label for the attribute.
 
Constructor Summary
PrefEntrySelector()
           
 
Method Summary
protected  String[] children(String[] contexts)
          Will select the children from the current node from the list of contexts
protected  PrefEntry create(String value)
           
protected  void delete()
           
static PrefEntry[] getAllEntries(String node, String[] context, String name)
           
 ClassInfo getClassInfo()
          Returns the ClassInfo object for this class.
 String getConceptualClassname()
          Deprecated.  
 String getContext()
          Gets the value of the attribute: CONTEXT.
 PrefEntry[] getEntries()
          Deprecated.  
 PrefEntry getEntry()
          Gets the value of the attribute: ENTRY.
 String getName()
          Gets the value of the attribute: NAME.
 String getNode()
          Gets the value of the attribute: NODE.
 ObjectReference getUser()
          Gets the value of the attribute: USER.
 int hashCode()
          Returns selector hash code based on name, node and context.
protected  void initialize()
          Supports initialization, following construction of an instance.
protected  void initialize(PrefEntry entry)
          Supports initialization, following construction of an instance.
protected static void initializeProperties()
          This is the initializeProperties method which will open the Preference Mapping file, parse the file using XPaths and create the default Pref Entry
static PrefEntrySelector newPrefEntrySelector()
          

Supported API: false
static PrefEntrySelector newPrefEntrySelector(PrefEntry entry)
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
 void readExternal(PersistentRetrieveIfc input)
          Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(PrefEntrySelector thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private  PrefEntry retrieveEntry()
          This method will retrive an entry from the appropriate PrefEntry type.
protected  ArrayList search(String aString, String[] aContext, boolean isLike)
          Will search the various Preference Entries and return a list of PrefSearch objects that match the search criteria.
 void setContext(String a_Context)
          Sets the value of the attribute: CONTEXT.
 void setEntry(PrefEntry a_Entry)
          Sets the value of the attribute: ENTRY.
 void setName(String a_Name)
          Sets the value of the attribute: NAME.
 void setNode(String a_Node)
          Sets the value of the attribute: NODE.
 void setUser(ObjectReference a_User)
          Sets the value of the attribute: USER.
 String toString()
          Returns the conceptual (modeled) name for the class.
protected  PrefEntry update(PrefEntry inEntry, String value)
           
protected  PrefEntry update(String value)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 void writeExternal(PersistentStoreIfc output)
          Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

NAME

public static final String NAME
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

NAME_UPPER_LIMIT

private static int NAME_UPPER_LIMIT

name

private String name

NODE

public static final String NODE
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

NODE_UPPER_LIMIT

private static int NODE_UPPER_LIMIT

node

private String node

CONTEXT

public static final String CONTEXT
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

CONTEXT_UPPER_LIMIT

private static int CONTEXT_UPPER_LIMIT

context

private String context

USER

public static final String USER
Label for the attribute.

Supported API: false

See Also:
Constant Field Values

user

private ObjectReference user

ENTRY

public static final String ENTRY
Label for the attribute; Entries retrieved by the selector.

Supported API: false

See Also:
Constant Field Values

entry

private PrefEntry entry

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

DEFAULT_PREFENTRY

private static Class DEFAULT_PREFENTRY

DEFAULT_DBPREFENTRY

private static Class DEFAULT_DBPREFENTRY

map

private static PreferenceMapping map

MapTypes

private static Vector MapTypes

instance

private static Constructor instance

DEBUG

private static boolean DEBUG
Constructor Detail

PrefEntrySelector

public PrefEntrySelector()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(PrefEntrySelector thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(PersistentStoreIfc output)
                   throws SQLException,
                          DatastoreException
Used by Persistent Data Service to obtain the values of the persistent attributes of this class, so they can be written to a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
writeExternal in interface ObjectMappable
Parameters:
output -
Throws:
SQLException
DatastoreException

readExternal

public void readExternal(PersistentRetrieveIfc input)
                  throws SQLException,
                         DatastoreException
Used by Persistent Data Service to populate the persistent attributes of this class from a persistent store.

(Not intended for general use.)

Supported API: false

Specified by:
readExternal in interface ObjectMappable
Parameters:
input -
Throws:
SQLException
DatastoreException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

toString

public String toString()
Returns the conceptual (modeled) name for the class.

Supported API: false

Returns:
String

getClassInfo

public ClassInfo getClassInfo()
                       throws WTIntrospectionException
Returns the ClassInfo object for this class.

Supported API: false

Specified by:
getClassInfo in interface NetFactor
Returns:
ClassInfo
Throws:
WTIntrospectionException

getName

public String getName()
Gets the value of the attribute: NAME.

Supported API: false

Returns:
String

setName

public void setName(String a_Name)
Sets the value of the attribute: NAME.

Supported API: false

Parameters:
a_Name -

getNode

public String getNode()
Gets the value of the attribute: NODE.

Supported API: false

Returns:
String

setNode

public void setNode(String a_Node)
Sets the value of the attribute: NODE.

Supported API: false

Parameters:
a_Node -

getContext

public String getContext()
Gets the value of the attribute: CONTEXT.

Supported API: false

Returns:
String

setContext

public void setContext(String a_Context)
Sets the value of the attribute: CONTEXT.

Supported API: false

Parameters:
a_Context -

getUser

public ObjectReference getUser()
Gets the value of the attribute: USER.

Supported API: false

Returns:
ObjectReference

setUser

public void setUser(ObjectReference a_User)
Sets the value of the attribute: USER.

Supported API: false

Parameters:
a_User -

getEntry

public PrefEntry getEntry()
                   throws WTException
Gets the value of the attribute: ENTRY. Entries retrieved by the selector.

Supported API: false

Returns:
PrefEntry
Throws:
WTException

setEntry

public void setEntry(PrefEntry a_Entry)
Sets the value of the attribute: ENTRY. Entries retrieved by the selector.

Supported API: false

Parameters:
a_Entry -

hashCode

public int hashCode()
Returns selector hash code based on name, node and context.

Supported API: false

Returns:
int

newPrefEntrySelector

public static PrefEntrySelector newPrefEntrySelector(PrefEntry entry)
                                              throws WTException


Supported API: false

Parameters:
entry -
Returns:
PrefEntrySelector
Throws:
WTException

initialize

protected void initialize(PrefEntry entry)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Parameters:
entry -
Throws:
WTException

newPrefEntrySelector

public static PrefEntrySelector newPrefEntrySelector()
                                              throws WTException


Supported API: false

Returns:
PrefEntrySelector
Throws:
WTException

initialize

protected void initialize()
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Throws:
WTException

retrieveEntry

private PrefEntry retrieveEntry()
                         throws WTException
This method will retrive an entry from the appropriate PrefEntry type. If the fully qualified Preference Key is mapped then this method will retrieve the mapped entry.

Returns:
The PrefEntry that was found that matched (if any) or null if non matched
Throws:
WTException

getEntries

public PrefEntry[] getEntries()
                       throws WTException
Deprecated.  



NOTE: This method should not be used as it circumvents the multi- level preference heirarchy. It does not support alternative PrefEntry types either (just the DBPrefEnty). There will not be a replacement method.

Throws:
WTException

getAllEntries

public static PrefEntry[] getAllEntries(String node,
                                        String[] context,
                                        String name)
                                 throws WTException
Throws:
WTException

create

protected PrefEntry create(String value)
                    throws WTException
Throws:
WTException

delete

protected void delete()
               throws WTException
Throws:
WTException

update

protected PrefEntry update(String value)
                    throws WTException
Throws:
WTException

update

protected PrefEntry update(PrefEntry inEntry,
                           String value)
                    throws WTException
Throws:
WTException

initializeProperties

protected static void initializeProperties()
                                    throws Exception
This is the initializeProperties method which will open the Preference Mapping file, parse the file using XPaths and create the default Pref Entry

Throws:
Exception - The exception thrown if there is an error initializing

search

protected ArrayList search(String aString,
                           String[] aContext,
                           boolean isLike)
Will search the various Preference Entries and return a list of PrefSearch objects that match the search criteria.

Parameters:
aString - The search string.
aContext - The search context.
isLike - The search is like or exact search

children

protected String[] children(String[] contexts)
Will select the children from the current node from the list of contexts