wt.fc
Class ReferenceFactory

java.lang.Object
  extended bywt.fc.ReferenceFactory
All Implemented Interfaces:
Externalizable, Serializable

public class ReferenceFactory
extends Object
implements Externalizable

A factory for getting references and strings that refer to persistable objects. Generally speaking, the factory returns version references when given the latest iteration of an Iterated object, otherwise object references. The version reference will always refer to the latest iteration of that version.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private static ResourceBundle messagesResource
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Constructor Summary
ReferenceFactory()
          Constructor for ReferenceFactory.
 
Method Summary
 String getQueryString(Persistable object)
          Deprecated.  
 String getQueryString(WTReference object)
          Deprecated.  
 WTReference getReference(Persistable object)
          Given an object, returns a reference to it.
 WTReference getReference(String stringReference)
          Given a string reference that was originally created by the ReferenceFactory, returns a reference object that refers to the same object as the string.
 String getReferenceString(Persistable object)
          Given a persistable object, returns a string reference to that object.
 String getReferenceString(WTReference object)
          Given an instance of some subclass of WTReference, returns a string representation of that reference.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
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(ReferenceFactory thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

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

VERBOSE

private static boolean VERBOSE

messagesResource

private static ResourceBundle messagesResource
Constructor Detail

ReferenceFactory

public ReferenceFactory()
Constructor for ReferenceFactory.

Supported API: true

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(ReferenceFactory 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

getReference

public WTReference getReference(Persistable object)
                         throws WTException
Given an object, returns a reference to it. The type of the reference is based on the type of the object.

Supported API: true

Parameters:
object -
Returns:
WTReference
Throws:
WTException

getReference

public WTReference getReference(String stringReference)
                         throws WTException
Given a string reference that was originally created by the ReferenceFactory, returns a reference object that refers to the same object as the string. The type of the reference is based on the type of the string reference.

Supported API: true

Parameters:
stringReference -
Returns:
WTReference
Throws:
WTException

getQueryString

public String getQueryString(WTReference object)
                      throws WTException
Deprecated.  

Deprecated. Replaced by getReferenceString().

Supported API: false

Parameters:
object -
Returns:
String
Throws:
WTException

getQueryString

public String getQueryString(Persistable object)
                      throws WTException
Deprecated.  

Deprecated. Replaced by getReferenceString().

Supported API: false

Parameters:
object -
Returns:
String
Throws:
WTException

getReferenceString

public String getReferenceString(WTReference object)
                          throws WTException
Given an instance of some subclass of WTReference, returns a string representation of that reference.

Supported API: true

Parameters:
object -
Returns:
String
Throws:
WTException

getReferenceString

public String getReferenceString(Persistable object)
                          throws WTException
Given a persistable object, returns a string reference to that object.

Supported API: true

Parameters:
object -
Returns:
String
Throws:
WTException