|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.mppobject.MPPObject
An object that represents data from a Microsoft Project Plan
.
Field Summary | |
private int |
id
|
private Map |
map
|
private static int |
MAP_INIT_CAPACITY
|
private Persistable |
persistable
|
private MPPPlan |
plan
|
Constructor Summary | |
MPPObject()
|
Method Summary | |
int |
compareTo(Object o)
Instances of MPPObject
are naturally ordered according to their
ID numbers. |
boolean |
containsKey(String key)
Returns true if this object contains a mapping for the specified key. |
protected abstract Persistable |
createPersistable()
Create a new Persistable that is of the correct
type for this object. |
Set |
entrySet()
Returns a set view of the mappings contained in this map. |
String |
get(String key)
Returns the value to which this object maps the specified key. |
Timestamp |
getCurrentDate()
Get the current date for this object's plan. |
protected abstract String |
getGenericName()
Return a generic name fo the this object. |
int |
getID()
Get the value of the object's ID attribute. |
ImportInfo |
getImportInfo()
Return the ImportInfo that
should be used when persisting this object. |
String |
getName()
Return the name assigned to this object. |
protected abstract String |
getNameElement()
Return the name of the XML element that should
be used to obtain the value of this object's name. |
ObjectIdentifier |
getObjectIdentifier()
Get the object's ObjectIdentifier . |
Persistable |
getPersistable()
Get the Persistable object that this object
maps to. |
Class |
getPersistableClass()
Retutn the Class of this object's
Persistable . |
long |
getPersistableID()
Retutn the ID of this object's Persistable . |
MPPPlan |
getPlan()
Get the plan that this object belongs to. |
ProjectPlan |
getProjectPlan()
Get the ProjectPlan that
contains this object. |
long |
getUID()
Get the value of the object's UID attribute. |
boolean |
isContainer()
Return true if this object is a container for other
project plan nodes. |
protected boolean |
isValidPersistable(Persistable p)
Make sure that the specified Persistable is
of the right type for this object. |
Set |
keySet()
Returns a set view of the keys contained in this object. |
void |
print()
|
protected void |
printImpl()
|
protected void |
printMsg(String msg)
Print out a message. |
protected void |
printNoUpdate(String key)
Print out a message indicating that an attribute is being skipped. |
protected void |
printNoUpdate(String key,
String msg)
Print out a message indicating that an attribute is being skipped and the reason why it is being skipped. |
protected void |
printRollUp(String key)
Print out a message indicating that an attribute is being rolled-up. |
protected void |
printUpdate(String key)
Print out a message indicating what attribute is being updated. |
protected void |
printUpdate(String key,
Object value)
Print out a message indicating what attribute is being updated. |
String |
put(String key,
String value)
Associates the specified value with the specified key in this object. |
protected Persistable |
refreshPersistable()
Retrieve the Persistable that corresponds to this
object from the database. |
Persistable |
savePersistable()
Update and save the persistable that coresponds to this object. |
protected void |
setID(int id)
Set the value of the object's ID attribute. |
protected void |
setPersistable(Persistable p)
Set the persistable that this object maps to. |
void |
setPlan(MPPPlan plan)
Set the plan that this object belongs to. |
String |
toString()
|
protected abstract Persistable |
updatePersistable(Persistable p)
Update the specified Persistable with the data
in this object. |
protected void |
updatePersistableCache(Persistable p)
Update the persistable cache on this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final int MAP_INIT_CAPACITY
private int id
private MPPPlan plan
private Persistable persistable
private final Map map
Constructor Detail |
public MPPObject()
Method Detail |
public String getName()
protected abstract String getGenericName()
protected abstract String getNameElement()
XML
element that should
be used to obtain the value of this object's name.
public int compareTo(Object o)
MPPObject
are naturally ordered
according to their
ID
numbers.
compareTo
in interface Comparable
public final int getID()
ID
attribute.
This is the value of this object's ID
element
in the XML
file.
RuntimeException
- if the object does not
have an ID or its ID is malformed.protected final void setID(int id)
ID
attribute.
When there are gaps in the sequence of ID that are
contained in the XML
data this method is
used to reassign IDs so that the gaps are removed.
id
- the object's IDpublic long getUID()
UID
attribute.
This is the value of this object's UID
element
in the XML
file.
public MPPPlan getPlan()
public void setPlan(MPPPlan plan)
RuntimeException
- if the plan has already been setpublic boolean isContainer()
true
if this object is a container for other
project plan nodes. Plans, summary activities and subprojects are
considered to be containers.
public ProjectPlan getProjectPlan()
ProjectPlan
that
contains this object.
public Timestamp getCurrentDate()
public ImportInfo getImportInfo()
ImportInfo
that
should be used when persisting this object.
public final long getPersistableID()
ID
of this object's Persistable
.
If the object has not been mapped to a persistable yet then
this returns the long
specified by it's
Constants.ID_ALIAS
extended
attribute. If this ID is malformed (or no ID is specified)
then zero is returned
(see ObjectIdentifier.UNASSIGNED_ID
).
public final Class getPersistableClass()
Class
of this object's
Persistable
.
If the object has not been mapped to a persistable yet then
this return the Class
specified by it's
Constants.CLASS_ALIAS
extended
attribute. If the class is not found (or no class is
specified) return null
.
public ObjectIdentifier getObjectIdentifier()
ObjectIdentifier
. The OID
is obtained by using two extended attributes
.
One attribute contains the object's long
id
value (Constants.ID_ALIAS
) and the other
contains the object's Java class name (Constants.CLASS_ALIAS
).
Returns null
if the object does not have an OID
or the OID data is malformed.
public final Persistable getPersistable() throws WTException
Persistable
object that this object
maps to. Return null
if no such persistable
exists.
WTException
protected final void setPersistable(Persistable p)
XML
.
protected final void updatePersistableCache(Persistable p)
protected Persistable refreshPersistable() throws WTException
Persistable
that corresponds to this
object from the database. Return null
if no such
persistable exists.
WTException
protected abstract Persistable createPersistable() throws WTException
Persistable
that is of the correct
type for this object.
WTException
protected boolean isValidPersistable(Persistable p) throws WTException
Persistable
is
of the right type for this object. Return false
if null
is passed to the method.
This class's implementation of this method ensures that the
perisitable is in the right ProjectPlan
. Subclasses
that override this method should be sure to make a call to
super
so that this code is executed.
WTException
public final Persistable savePersistable() throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
protected abstract Persistable updatePersistable(Persistable p) throws WTException, WTPropertyVetoException
Persistable
with the data
in this object.
WTException
WTPropertyVetoException
public String get(String key)
key
- key whose associated value is to be returned
public String put(String key, String value)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
public boolean containsKey(String key)
key
- key whose presence in this object is to be tested
true
if this object contains a mapping for the
specified keypublic Set keySet()
public Set entrySet()
public String toString()
public final void print()
protected void printImpl()
protected final void printUpdate(String key)
key
- the name of the attribute being updatedprotected final void printUpdate(String key, Object value)
key
- the name of the attribute being updatedvalue
- the value that is being used to update the arttributeprotected final void printNoUpdate(String key)
key
- the name of the attribute being skippedprotected final void printNoUpdate(String key, String msg)
key
- the name of the attribute being skippedmsg
- the reason why it is being skippedprotected final void printRollUp(String key)
XML
file. This is the value that is being ignored
in favor of rolling up the value.
key
- the name of the attribute being skippedprotected final void printMsg(String msg)
msg
- the message to print out
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |