|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.facets.FacetHolderImpl
org.nakedobjects.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract
public abstract class IntrospectableSpecificationAbstract
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.nakedobjects.metamodel.spec.NakedObjectSpecification |
|---|
NakedObjectSpecification.CreationMode |
| Field Summary | |
|---|---|
protected NakedObjectAssociation[] |
fields
|
protected java.lang.String |
fullName
|
protected Identifier |
identifier
|
protected NakedObjectAction[] |
objectActions
|
protected NakedObjectSpecification |
superClassSpecification
|
| Constructor Summary | |
|---|---|
IntrospectableSpecificationAbstract(RuntimeContext runtimeContext)
|
|
| Method Summary | ||
|---|---|---|
void |
addSubclass(NakedObjectSpecification specification)
Add the class for the specified specification as a subclass of this specification's class. |
|
void |
clearDirty(NakedObject object)
Clear the dirty flag so that a call to isDirty(), and before markDirty() is called, will return false; |
|
java.lang.Object |
createObject(NakedObjectSpecification.CreationMode creationMode)
Create and optionally initialize object. |
|
ObjectTitleContext |
createTitleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject targetNakedObject)
Create an InteractionContext representing an attempt to read the object's title. |
|
ObjectValidityContext |
createValidityInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject targetNakedObject)
Create an InteractionContext representing an attempt to save the object. |
|
protected NakedObjectAction[] |
getActions(NakedObjectAction[] availableActions,
NakedObjectActionType type)
|
|
java.util.List<? extends NakedObjectAssociation> |
getAssociationList()
As per NakedObjectAssociationContainer.getAssociations(), but returning a List. |
|
java.util.List<? extends NakedObjectAssociation> |
getAssociationList(Filter<NakedObjectAssociation> filter)
As per NakedObjectAssociationContainer.getAssociations(Filter), but returning a List. |
|
NakedObjectAssociation[] |
getAssociations()
Return all the fields that exist in an object of this specification, although they need not all be accessible or visible. |
|
NakedObjectAssociation[] |
getAssociations(Filter<NakedObjectAssociation> filter)
Return all NakedObjectAssociations matching the supplied filter. |
|
protected AuthenticationSession |
getAuthenticationSession()
Derived from runtime context. |
|
java.util.List<OneToManyAssociation> |
getCollectionList()
All associations that represents collections. |
|
java.lang.Object |
getDefaultValue()
Default value to be provided for properties or parameters that are not declared as @Optional but where the UI has not (yet) provided a value. |
|
|
getFacet(java.lang.Class<Q> facetType)
Get the facet of the specified type (as per the type it reports from Facet.facetType()). |
|
java.lang.String |
getFullName()
Returns the name of this specification. |
|
java.lang.String |
getIconName(NakedObject object)
Returns the name of an icon to use for the specified object. |
|
Identifier |
getIdentifier()
Identifier of this feature. |
|
Instance |
getInstance(NakedObject nakedObject)
Return an Instance of this Specification with respect
to the provided NakedObject. |
|
java.util.List<? extends NakedObjectAction> |
getObjectActionList(NakedObjectActionType... types)
As per #getObjectActions(NakedObjectActionType), but returned as a List. |
|
NakedObjectAction[] |
getObjectActions(NakedObjectActionType... types)
Returns an array of actions of the specified type(s). |
|
java.util.List<OneToOneAssociation> |
getPropertyList()
All associations that represent properties. |
|
RuntimeContext |
getRuntimeContext()
|
|
protected NakedObjectAction[] |
getServiceActions(NakedObjectActionType type)
Finds all service actions of the specified type, if any. |
|
NakedObjectAction[] |
getServiceActionsFor(NakedObjectActionType type)
TODO: convert to relatedResourceActions |
|
boolean |
hasSubclasses()
Returns true if the subclasses() method will return an array of one or more elements (ie, not an empty array). |
|
NakedObjectSpecification[] |
interfaces()
Get the list of specifications for all the interfaces that the class represented by this specification implements. |
|
boolean |
isAbstract()
|
|
boolean |
isCollection()
Determines if objects represents a collection. |
|
boolean |
isCollectionOrIsAggregated()
Whether objects of this type are a collection or are intrinsically aggregated. |
|
boolean |
isDirty(NakedObject object)
Checks if the specified object has been changed, and hence needs persisting. |
|
boolean |
isEncodeable()
Determines if objects of this type can be converted to a data-stream. |
|
boolean |
isFinal()
Whether or not this specification's class is marked as final, that is it may not have subclasses, and hence methods that could be overridden. |
|
boolean |
isImmutable()
Whether has the ImmutableFacet. |
|
boolean |
isIntrospected()
|
|
boolean |
isObject()
Determines if the object represents an object (value or otherwise). |
|
boolean |
isOfType(NakedObjectSpecification specification)
Determines if this specification represents the same specification, or a subclass, of the specified specification. |
|
boolean |
isParseable()
Determines if objects of this type can be set up from a text entry string. |
|
boolean |
isService()
|
|
Consent |
isValid(NakedObject inObject)
Determines whether the specified object is in a valid state (for example, so can be persisted); represented as a Consent. |
|
InteractionResult |
isValidResult(NakedObject targetNakedObject)
TODO: currently this method is hard-coded to assume all interactions are initiated by user. |
|
boolean |
isValueOrIsAggregated()
Determines if objects of this type are aggregated. |
|
void |
markDirty(NakedObject object)
Mark the specified object as having been changed, and hence needing persisting. |
|
Persistability |
persistability()
Determines if objects of this specification can be persisted or not. |
|
protected void |
setIntrospected(boolean introspected)
|
|
NakedObjectSpecification[] |
subclasses()
Get the list of specifications for the subclasses of the class represented by this specification |
|
NakedObjectSpecification |
superclass()
Get the specification for this specification's class's superclass. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class org.nakedobjects.metamodel.facets.FacetHolderImpl |
|---|
addFacet, addFacet, containsFacet, getFacets, getFacetTypes, removeFacet, removeFacet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.nakedobjects.metamodel.spec.NakedObjectSpecification |
|---|
getDescription, getPluralName, getShortName, getSingularName, getTitle |
| Methods inherited from interface org.nakedobjects.metamodel.facets.FacetHolder |
|---|
addFacet, addFacet, containsFacet, getFacets, getFacetTypes, removeFacet, removeFacet |
| Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectActionContainer |
|---|
getObjectAction, getObjectAction |
| Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectAssociationContainer |
|---|
getAssociation |
| Methods inherited from interface org.nakedobjects.metamodel.spec.IntrospectableSpecification |
|---|
introspect, markAsService |
| Field Detail |
|---|
protected java.lang.String fullName
protected NakedObjectAssociation[] fields
protected NakedObjectAction[] objectActions
protected NakedObjectSpecification superClassSpecification
protected Identifier identifier
| Constructor Detail |
|---|
public IntrospectableSpecificationAbstract(RuntimeContext runtimeContext)
| Method Detail |
|---|
public java.lang.String getFullName()
NakedObjectSpecification
getFullName in interface NakedObjectSpecificationpublic java.lang.String getIconName(NakedObject object)
NakedObjectSpecification
getIconName in interface NakedObjectSpecificationpublic boolean hasSubclasses()
Hierarchical
hasSubclasses in interface Hierarchicalpublic NakedObjectSpecification[] interfaces()
Hierarchical
interfaces in interface Hierarchicalpublic NakedObjectSpecification[] subclasses()
Hierarchical
subclasses in interface Hierarchicalpublic NakedObjectSpecification superclass()
Hierarchical
superclass in interface Hierarchicalpublic boolean isOfType(NakedObjectSpecification specification)
Hierarchical
subSpec.isOfType(superSpec) is equivalent to
Java's
superType.isAssignableFrom(subType).
isOfType in interface Hierarchicalpublic void addSubclass(NakedObjectSpecification specification)
Hierarchical
addSubclass in interface Hierarchicalpublic Instance getInstance(NakedObject nakedObject)
SpecificationInstance of this Specification with respect
to the provided NakedObject.
For example, if the Specification is a OneToOneAssociation,
then is an Instance implementation representing the { NakedObject/ OneToOneAssociation } tuple.
Implementations are expected to use a double-dispatch back to the provided
NakedObject (passing themselves as a parameter), using
NakedObjectMM.getInstance(Specification).
Note: this method may throw an UnsupportedOperationException;
see NakedObjectMM.getInstance(Specification) for details.
getInstance in interface Specificationprotected void setIntrospected(boolean introspected)
public boolean isIntrospected()
isIntrospected in interface IntrospectableSpecificationpublic <Q extends Facet> Q getFacet(java.lang.Class<Q> facetType)
FacetHolderFacet.facetType()).
getFacet in interface FacetHoldergetFacet in class FacetHolderImplpublic java.lang.Object getDefaultValue()
DefaultProvider
getDefaultValue in interface DefaultProviderpublic Identifier getIdentifier()
Identified
getIdentifier in interface Identified
public ObjectTitleContext createTitleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject targetNakedObject)
NakedObjectSpecificationInteractionContext representing an attempt to read the object's title.
createTitleInteractionContext in interface NakedObjectSpecificationpublic NakedObjectAssociation[] getAssociations()
NakedObjectAssociationContainer
getAssociations in interface NakedObjectAssociationContainerpublic java.util.List<? extends NakedObjectAssociation> getAssociationList()
NakedObjectAssociationContainerNakedObjectAssociationContainer.getAssociations(), but returning a List.
getAssociationList in interface NakedObjectAssociationContainerpublic NakedObjectAssociation[] getAssociations(Filter<NakedObjectAssociation> filter)
NakedObjectAssociationContainerNakedObjectAssociations matching the supplied filter.
To get the statically visible fields (where any invisible and unauthorised fields have been removed)
use NakedObjectAssociationFilters#STATICALLY_VISIBLE_ASSOCIATIONS
getAssociations in interface NakedObjectAssociationContainerFilterspublic java.util.List<? extends NakedObjectAssociation> getAssociationList(Filter<NakedObjectAssociation> filter)
NakedObjectAssociationContainerNakedObjectAssociationContainer.getAssociations(Filter), but returning a List.
getAssociationList in interface NakedObjectAssociationContainerpublic java.util.List<OneToOneAssociation> getPropertyList()
NakedObjectAssociationContainerassociations that represent properties.
getPropertyList in interface NakedObjectAssociationContainerpublic java.util.List<OneToManyAssociation> getCollectionList()
NakedObjectAssociationContainerassociations that represents collections.
getCollectionList in interface NakedObjectAssociationContainer
protected NakedObjectAction[] getActions(NakedObjectAction[] availableActions,
NakedObjectActionType type)
public NakedObjectAction[] getObjectActions(NakedObjectActionType... types)
NakedObjectActionContainer
If the type is null, then returns all user,
exploration and debug actions (but not action sets).
getObjectActions in interface NakedObjectActionContainerpublic java.util.List<? extends NakedObjectAction> getObjectActionList(NakedObjectActionType... types)
NakedObjectActionContainer#getObjectActions(NakedObjectActionType), but returned as a List.
getObjectActionList in interface NakedObjectActionContainerpublic NakedObjectAction[] getServiceActionsFor(NakedObjectActionType type)
NakedObjectActionContainer
getServiceActionsFor in interface NakedObjectActionContainerpublic boolean isAbstract()
isAbstract in interface NakedObjectSpecificationpublic boolean isFinal()
Note - not used at present.
public boolean isService()
isService in interface NakedObjectSpecificationpublic boolean isDirty(NakedObject object)
Dirtiable
isDirty in interface DirtiableDirtiable.markDirty(NakedObject),
Dirtiable.clearDirty(NakedObject)public void clearDirty(NakedObject object)
Dirtiable
clearDirty in interface DirtiableDirtiable.isDirty(NakedObject),
Dirtiable.markDirty(NakedObject)public void markDirty(NakedObject object)
Dirtiable
markDirty in interface DirtiableDirtiable.isDirty(NakedObject),
Dirtiable.clearDirty(NakedObject)protected NakedObjectAction[] getServiceActions(NakedObjectActionType type)
However, if this specification is actually for a service, then returns an empty
array.
NakedObjectActionSets (!!), each of which contains
NakedObjectActions of the requested type.public Consent isValid(NakedObject inObject)
NakedObjectSpecificationConsent.
isValid in interface NakedObjectSpecificationpublic InteractionResult isValidResult(NakedObject targetNakedObject)
by user.
isValidResult in interface NakedObjectSpecification
public ObjectValidityContext createValidityInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject targetNakedObject)
InteractionContext representing an attempt to save the object.
createValidityInteractionContext in interface NakedObjectSpecificationpublic Persistability persistability()
NakedObjectSpecificationPersistability.TRANSIENT NakedObject.isPersistent() will indicated
whether the object is persistent or not. If they cannot be persisted then NakedObject.
NakedObjectSpecification.persistability() should be ignored.
persistability in interface NakedObjectSpecificationpublic boolean isParseable()
NakedObjectSpecification
In effect, means has got a ParseableFacet.
isParseable in interface NakedObjectSpecificationpublic boolean isEncodeable()
NakedObjectSpecification
In effect, means has got EncodableFacet.
isEncodeable in interface NakedObjectSpecificationpublic boolean isValueOrIsAggregated()
NakedObjectSpecification
In effect, means has got AggregatedFacet or ValueFacet.
isValueOrIsAggregated in interface NakedObjectSpecificationpublic boolean isCollection()
NakedObjectSpecification
In effect, means has got CollectionFacet, and therefore will return NOT NakedObjectSpecification.isObject().
isCollection in interface NakedObjectSpecificationNakedObjectSpecification.isObject()public boolean isObject()
NakedObjectSpecification
In effect, means that it doesn't have the CollectionFacet, and therefore will return
NOT NakedObjectSpecification.isCollection()
isObject in interface NakedObjectSpecificationNakedObjectSpecification.isCollection().public boolean isImmutable()
NakedObjectSpecificationImmutableFacet.
isImmutable in interface NakedObjectSpecificationpublic boolean isCollectionOrIsAggregated()
NakedObjectSpecification
In effect, means has got a CollectionFacet and/or got the AggregatedFacet.
isCollectionOrIsAggregated in interface NakedObjectSpecificationpublic java.lang.Object createObject(NakedObjectSpecification.CreationMode creationMode)
NakedObjectSpecificationinitialize object.
createObject in interface NakedObjectSpecificationpublic java.lang.String toString()
toString in class java.lang.Objectpublic RuntimeContext getRuntimeContext()
protected final AuthenticationSession getAuthenticationSession()
runtime context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||