public interface ObjectAdapter extends Instance, org.apache.isis.applib.annotation.When.Persistable
| Modifier and Type | Interface and Description |
|---|---|
static class |
ObjectAdapter.Functions |
static class |
ObjectAdapter.Util |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canTransitionToResolving() |
void |
changeState(ResolveState newState)
Changes the 'lazy loaded' state of the domain object.
|
void |
checkLock(Version version)
Checks the version of this adapter to make sure that it does not differ
from the specified version.
|
void |
fireChangedEvent() |
ObjectAdapter |
getAggregateRoot()
Either the aggregate root (either itself or, if parented, then its parent adapter).
|
ObjectSpecification |
getElementSpecification()
For (stand-alone) collections, returns the element type.
|
String |
getIconName()
Returns the name of an icon to use if this object is to be displayed
graphically.
|
Instance |
getInstance(Specification specification)
|
Object |
getObject()
Returns the adapted domain object, the POJO, that this adapter represents
with the framework.
|
Oid |
getOid()
The object's unique
Oid. |
ResolveState |
getResolveState()
Determines what 'lazy loaded' state the domain object is in.
|
ObjectSpecification |
getSpecification()
Refines
Instance.getSpecification(). |
Version |
getVersion() |
boolean |
isAggregated()
Whether this is an aggregated Oid.
|
boolean |
isDestroyed() |
boolean |
isGhost() |
boolean |
isNew() |
boolean |
isParented()
Whether this instance belongs to another object (meaning its
getOid() will be ParentedOid, either an
AggregatedOid or a CollectionOid). |
boolean |
isResolved() |
boolean |
isResolving() |
boolean |
isTitleAvailable() |
boolean |
isTransient() |
boolean |
isUpdating() |
boolean |
isValue()
Whether this is a value (standalone, has no oid).
|
void |
markAsResolvedIfPossible() |
void |
replaceOid(Oid persistedOid)
Since
Oids are now immutable, it is the reference from the
ObjectAdapter to its Oid that must now be updated. |
void |
replacePojo(Object pojo)
Sometimes it is necessary to manage the replacement of the underlying
domain object (by another component such as an object store).
|
boolean |
representsPersistent()
Whether the object is persisted.
|
boolean |
respondToChangesInPersistentObjects() |
void |
setElementSpecificationProvider(ElementSpecificationProvider elementSpecificationProvider)
For (stand-alone) collections, returns the element type.
|
void |
setVersion(Version version) |
String |
titleString()
Deprecated.
|
String |
titleString(ObjectAdapter contextAdapter)
Returns the title to display this object with, rendered within the context
of some other adapter.
|
ObjectSpecification getSpecification()
Instance.getSpecification().getSpecification in interface InstanceObject getObject()
@Deprecated String titleString()
titleString(ObjectAdapter)domain object.String titleString(ObjectAdapter contextAdapter)
Instance getInstance(Specification specification)
Instance of the specified Specification with
respect to this ObjectAdapter.
If called with ObjectSpecification, 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(ObjectAdapter).
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.
adapter - void replacePojo(Object pojo)
ObjectSpecification getElementSpecification()
For owned (aggregated) collections, the element type can be determined from the TypeOfFacet associated with the ObjectAssociation representing the collection.
void setElementSpecificationProvider(ElementSpecificationProvider elementSpecificationProvider)
getElementSpecification()String getIconName()
May return null if no icon is specified.
void changeState(ResolveState newState)
ResolveStatevoid checkLock(Version version)
ConcurrencyException - if the specified version differs from the version held this
adapter.Oid getOid()
Oid.
This id allows the object to added to, stored by,
and retrieved from the object store. Objects can be looked up by their
Oid from the AdapterManager.
Note that standalone value objects ("foobar", or 5, or a date), are not mapped and have a null oid.
void replaceOid(Oid persistedOid)
Oids are now immutable, it is the reference from the
ObjectAdapter to its Oid that must now be updated.ResolveState getResolveState()
ResolveStateboolean representsPersistent()
Note: not necessarily the reciprocal of isTransient();
standalone adapters (with ResolveState.VALUE) report as neither
persistent or transient.
boolean isNew()
boolean isTransient()
isTransient in interface org.apache.isis.applib.annotation.When.Persistableboolean isGhost()
boolean isResolved()
boolean isResolving()
boolean isUpdating()
boolean isDestroyed()
boolean canTransitionToResolving()
boolean isTitleAvailable()
void markAsResolvedIfPossible()
Version getVersion()
void setVersion(Version version)
void fireChangedEvent()
boolean isParented()
getOid() will be ParentedOid, either an
AggregatedOid or a CollectionOid).boolean isAggregated()
boolean isValue()
ObjectAdapter getAggregateRoot()
boolean respondToChangesInPersistentObjects()
Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.