org.nakedobjects.runtime.persistence.adapterfactory.pojo
Class PojoAdapter

java.lang.Object
  extended by org.nakedobjects.metamodel.adapter.InstanceAbstract
      extended by org.nakedobjects.runtime.persistence.adapterfactory.pojo.PojoAdapter
All Implemented Interfaces:
Instance, NakedObject, NakedObjectMM

public class PojoAdapter
extends InstanceAbstract
implements NakedObject


Constructor Summary
PojoAdapter(java.lang.Object pojo, Oid oid)
           
 
Method Summary
 void changeState(ResolveState newState)
           
 void checkLock(Version version)
           
protected  void finalize()
           
 void fireChangedEvent()
          Guaranteed to be called whenever this object is known to have changed (specifically, by the ObjectStorePersistor).
protected  java.lang.String getDefaultTitle()
           
 java.lang.String getIconName()
          Returns the name of the icon to use to represent this object.
 Instance getInstance(Specification specification)
          Not supported by this implementation.
 java.lang.Object getObject()
           
 Oid getOid()
           
 ResolveState getResolveState()
           
 NakedObjectSpecification getSpecification()
          Downcasts getSpecification().
 TypeOfFacet getTypeOfFacet()
           
 Version getVersion()
           
 boolean isAggregated()
           
 boolean isPersistent()
          Just delegates to resolve state.
 boolean isTransient()
          Just delegates to resolve state.
protected  NakedObjectSpecification loadSpecification()
           
 void replacePojo(java.lang.Object pojo)
          Sometimes it is necessary to manage the replacement of the underlying domain object (by another component such as an object store).
protected  void setOid(Oid oid)
           
 void setOptimisticLock(Version version)
           
 void setTypeOfFacet(TypeOfFacet typeOfFacet)
           
 java.lang.String titleString()
          Returns the title from the underlying business object.
 java.lang.String toString()
           
protected  void toString(ToString str)
           
 
Methods inherited from class org.nakedobjects.metamodel.adapter.InstanceAbstract
getOwner, getSpecificationNoLoad
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.adapter.Instance
getOwner
 

Constructor Detail

PojoAdapter

public PojoAdapter(java.lang.Object pojo,
                   Oid oid)
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

loadSpecification

protected NakedObjectSpecification loadSpecification()
Overrides:
loadSpecification in class InstanceAbstract

getSpecification

public final NakedObjectSpecification getSpecification()
Downcasts getSpecification().

Specified by:
getSpecification in interface Instance
Specified by:
getSpecification in interface NakedObjectMM
Overrides:
getSpecification in class InstanceAbstract

getObject

public java.lang.Object getObject()
Specified by:
getObject in interface NakedObjectMM

replacePojo

public void replacePojo(java.lang.Object pojo)
Sometimes it is necessary to manage the replacement of the underlying domain object (by another component such as an object store). This method allows the adapter to be kept while the domain object is replaced.

Specified by:
replacePojo in interface NakedObjectMM

getResolveState

public ResolveState getResolveState()
Specified by:
getResolveState in interface NakedObject

changeState

public void changeState(ResolveState newState)
Specified by:
changeState in interface NakedObject

isPersistent

public boolean isPersistent()
Just delegates to resolve state.

Specified by:
isPersistent in interface NakedObjectMM
See Also:
ResolveState.isPersistent(), isTransient()

isTransient

public boolean isTransient()
Just delegates to resolve state.

Specified by:
isTransient in interface NakedObjectMM
See Also:
ResolveState.isTransient(), isPersistent()

getOid

public Oid getOid()
Specified by:
getOid in interface NakedObject

setOid

protected void setOid(Oid oid)

isAggregated

public boolean isAggregated()
Specified by:
isAggregated in interface NakedObject

getVersion

public Version getVersion()
Specified by:
getVersion in interface NakedObject

checkLock

public void checkLock(Version version)
Specified by:
checkLock in interface NakedObject

setOptimisticLock

public void setOptimisticLock(Version version)
Specified by:
setOptimisticLock in interface NakedObject

titleString

public java.lang.String titleString()
Returns the title from the underlying business object.

If the object has not yet been resolved the specification will be asked for a unresolved title, which could of been persisted by the persistence mechanism. If either of the above provides null as the title then this method will return a title relating to the name of the object type, e.g. "A Customer", "A Product".

Specified by:
titleString in interface NakedObjectMM

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDefaultTitle

protected java.lang.String getDefaultTitle()

toString

protected void toString(ToString str)

getIconName

public java.lang.String getIconName()
Returns the name of the icon to use to represent this object.

Specified by:
getIconName in interface NakedObject

getTypeOfFacet

public TypeOfFacet getTypeOfFacet()
Specified by:
getTypeOfFacet in interface NakedObjectMM

setTypeOfFacet

public void setTypeOfFacet(TypeOfFacet typeOfFacet)
Specified by:
setTypeOfFacet in interface NakedObjectMM

getInstance

public Instance getInstance(Specification specification)
Not supported by this implementation.

Specified by:
getInstance in interface NakedObjectMM

fireChangedEvent

public void fireChangedEvent()
Guaranteed to be called whenever this object is known to have changed (specifically, by the ObjectStorePersistor).

This implementation does nothing, but subclasses (for example PojoAdapterX) might provide listeners.

Specified by:
fireChangedEvent in interface NakedObject


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.