org.nakedobjects.metamodel.adapter
Class ResolveState

java.lang.Object
  extended by org.nakedobjects.metamodel.adapter.ResolveState

public final class ResolveState
extends java.lang.Object


Field Summary
static java.util.Map<ResolveState,ResolveState[]> changeToStatesByState
          These cannot be passed into the constructor because cannot reference an instance until it has been declared.
static ResolveState DESTROYED
           
static ResolveState GHOST
           
static ResolveState NEW
           
static ResolveState PART_RESOLVED
           
static ResolveState RESOLVED
           
static ResolveState RESOLVING
           
static ResolveState RESOLVING_PART
           
static ResolveState SERIALIZING_GHOST
           
static ResolveState SERIALIZING_PART_RESOLVED
           
static ResolveState SERIALIZING_RESOLVED
           
static ResolveState SERIALIZING_TRANSIENT
           
static ResolveState TRANSIENT
           
static ResolveState UPDATING
           
static ResolveState VALUE
           
 
Method Summary
 boolean canChangeTo(ResolveState newState)
          As per isValidToChangeTo(ResolveState), but will additionally throw a ResolveException if the requested state can never be transitioned into, and will return false if the current state can never be transitioned from.
 java.lang.String code()
          Four character representation of the state.
 boolean couldResolve()
          Returns true if an object in this state could trigger some sort of database loading.
 ResolveState getEndState()
           
static ResolveState getResolveState(java.lang.String name)
           
 boolean isDeserializable(ResolveState newState)
           
 boolean isDestroyed()
           
 boolean isGhost()
           
 boolean isNew()
           
 boolean isPartlyResolved()
           
 boolean isPersistent()
          Returns true when an object is persistent (except for VALUE adapters).
 boolean isResolvable(ResolveState newState)
          Deprecated. - renamed to canChangeTo(ResolveState).
 boolean isResolved()
           
 boolean isResolving()
          Return true if the state reflects some kind of loading.
 boolean isSerializing()
           
 boolean isTransient()
          Returns true when an object has not yet been made persistent (except for VALUE adapters)..
 boolean isUpdating()
           
 boolean isValidToChangeTo(ResolveState nextState)
          Determines if the resolved state can be changed from this state to the specified state.
 boolean isValue()
           
 java.lang.String name()
           
 boolean respondToChangesInPersistentObjects()
          Returns false while object is having its field set up.
 ResolveState serializeFrom()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEW

public static final ResolveState NEW

TRANSIENT

public static final ResolveState TRANSIENT

GHOST

public static final ResolveState GHOST

PART_RESOLVED

public static final ResolveState PART_RESOLVED

RESOLVED

public static final ResolveState RESOLVED

RESOLVING

public static final ResolveState RESOLVING

RESOLVING_PART

public static final ResolveState RESOLVING_PART

SERIALIZING_GHOST

public static final ResolveState SERIALIZING_GHOST

SERIALIZING_PART_RESOLVED

public static final ResolveState SERIALIZING_PART_RESOLVED

SERIALIZING_RESOLVED

public static final ResolveState SERIALIZING_RESOLVED

SERIALIZING_TRANSIENT

public static final ResolveState SERIALIZING_TRANSIENT

UPDATING

public static final ResolveState UPDATING

DESTROYED

public static final ResolveState DESTROYED

VALUE

public static final ResolveState VALUE

changeToStatesByState

public static java.util.Map<ResolveState,ResolveState[]> changeToStatesByState
These cannot be passed into the constructor because cannot reference an instance until it has been declared.

Method Detail

getResolveState

public static ResolveState getResolveState(java.lang.String name)

code

public java.lang.String code()
Four character representation of the state.

The format is XYZW where:


getEndState

public ResolveState getEndState()

isPersistent

public boolean isPersistent()
Returns true when an object is persistent (except for VALUE adapters).

Always returns false for VALUE.


isTransient

public boolean isTransient()
Returns true when an object has not yet been made persistent (except for VALUE adapters)..

Always returns false for VALUE.


canChangeTo

public boolean canChangeTo(ResolveState newState)
As per isValidToChangeTo(ResolveState), but will additionally throw a ResolveException if the requested state can never be transitioned into, and will return false if the current state can never be transitioned from.


isResolvable

@Deprecated
public boolean isResolvable(ResolveState newState)
Deprecated. - renamed to canChangeTo(ResolveState).


isDeserializable

public boolean isDeserializable(ResolveState newState)

respondToChangesInPersistentObjects

public boolean respondToChangesInPersistentObjects()
Returns false while object is having its field set up.


isGhost

public boolean isGhost()

isValue

public boolean isValue()

isNew

public boolean isNew()

isPartlyResolved

public boolean isPartlyResolved()

isUpdating

public boolean isUpdating()

isDestroyed

public boolean isDestroyed()

isResolved

public boolean isResolved()

isResolving

public boolean isResolving()
Return true if the state reflects some kind of loading.


couldResolve

public boolean couldResolve()
Returns true if an object in this state could trigger some sort of database loading.

Used to prevent calls to title() etc on objects that are not resolved.

See Also:
ResolvePotential

isSerializing

public boolean isSerializing()

isValidToChangeTo

public boolean isValidToChangeTo(ResolveState nextState)
Determines if the resolved state can be changed from this state to the specified state. Returns true if the change is valid.


name

public java.lang.String name()

serializeFrom

public ResolveState serializeFrom()

toString

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


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