|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NakedObjectMM
Naked objects are adapters to domain objects, where the application is written in terms of domain objects and those objects are represented within the NOF through these adapter, and not directly.
This interface defines just those aspects of the adapter that are of interest to the
meta-model (hence the 'MM' suffix), while the NakedObject subtype defines additional properties
used by the framework (PersistenceSessions et al) for tracking the persistence state
of the object. In theory it ought to be possible to move NakedObject interface out of
the metamodel module. However, this would require either lots of genericizing or lots of downcasting
to ensure that the framework is only ever handed or deals with the NakedObjects.
NakedObject| Method Summary | |
|---|---|
Instance |
getInstance(Specification specification)
Return an Instance of the specified Specification with respect
to this NakedObject. |
java.lang.Object |
getObject()
Returns the adapted domain object, the POJO, that this adapter represents with the NOF. |
NakedObjectSpecification |
getSpecification()
Refines Instance.getSpecification(). |
TypeOfFacet |
getTypeOfFacet()
Gets the type of facet for this object, defaulting to the facet held by the underlying specification. |
boolean |
isPersistent()
Whether the object is persisted. |
boolean |
isTransient()
Whether the object is transient. |
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). |
void |
setTypeOfFacet(TypeOfFacet typeOfFacet)
Sets the element type facet, typically by copying it from the method or association information. |
java.lang.String |
titleString()
Returns the title to display this object with, which is usually got from the wrapped domain object. |
| Methods inherited from interface org.nakedobjects.metamodel.adapter.Instance |
|---|
getOwner |
| Method Detail |
|---|
NakedObjectSpecification getSpecification()
Instance.getSpecification().
getSpecification in interface Instancejava.lang.Object getObject()
java.lang.String titleString()
domain object.
Instance getInstance(Specification specification)
Instance of the specified Specification with respect
to this NakedObject.
If called with NakedObjectSpecification, then just returns this).
If called for other subinterfaces, then should provide an appropriate
Instance implementation.
Designed to be called in a double-dispatch design from Specification.getInstance(NakedObject).
Note: this method will throw an UnsupportedOperationException unless the
extended PojoAdapterXFactory is configured. (That is, only
PojoAdapterX provides support for this; the regular PojoAdapter
does not currently.
nakedObject -
boolean isPersistent()
Note: not necessarily the reciprocal of isTransient();
standalone adapters (with ResolveState.VALUE) report as neither persistent or transient.
boolean isTransient()
Note: not necessarily the reciprocal of isPersistent();
standalone adapters (with ResolveState.VALUE) report as neither persistent or transient.
void replacePojo(java.lang.Object pojo)
TypeOfFacet getTypeOfFacet()
setTypeOfFacet(TypeOfFacet) be more generic allowing other facets
to be added to adapters.
void setTypeOfFacet(TypeOfFacet typeOfFacet)
getTypeOfFacet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||