org.nakedobjects.metamodel.runtimecontext.spec
Class NakedObjectSpecificationNoMember

java.lang.Object
  extended by org.nakedobjects.metamodel.facets.FacetHolderImpl
      extended by org.nakedobjects.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract
          extended by org.nakedobjects.metamodel.runtimecontext.spec.NakedObjectSpecificationNoMember
All Implemented Interfaces:
FacetHolder, DefaultProvider, Dirtiable, NakedObjectActionContainer, NakedObjectAssociationContainer, Hierarchical, Identified, IntrospectableSpecification, NakedObjectSpecification, Specification

public class NakedObjectSpecificationNoMember
extends IntrospectableSpecificationAbstract

A simple implementation used for objects that have no members (fields or actions). Used for primitives and as a fall-back if no specification can be otherwise generated.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nakedobjects.metamodel.spec.NakedObjectSpecification
NakedObjectSpecification.CreationMode
 
Field Summary
 
Fields inherited from class org.nakedobjects.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract
fields, fullName, identifier, objectActions, superClassSpecification
 
Constructor Summary
NakedObjectSpecificationNoMember(java.lang.String className, RuntimeContext runtimeContext)
           
 
Method Summary
 InteractionContext createPersistInteractionContext(AuthenticationSession session, boolean programmatic, NakedObject targetNakedObject)
          Does nothing, but should never be called.
 void debugData(DebugString debug)
           
 java.lang.String debugTitle()
           
 NakedObjectAssociation getAssociation(java.lang.String name)
          Get the field object representing the field with the specified field identifier.
 java.lang.String getDescription()
          Returns the description, if any, of the specification.
 NakedObjectAction getObjectAction(NakedObjectActionType type, java.lang.String id)
          Get the action object represented by the specified identity string.
 NakedObjectAction getObjectAction(NakedObjectActionType type, java.lang.String id, NakedObjectSpecification[] parameters)
          Returns the action of the specified type with the specified signature.
 NakedObjectAction[] getObjectActions(NakedObjectActionType... type)
          Returns an array of actions of the specified type(s).
 java.lang.String getPluralName()
          Returns the plural name for objects of this specification.
 java.lang.String getShortName()
          Returns the class name without the package.
 java.lang.String getSingularName()
          Returns the singular name for objects of this specification.
 java.lang.String getTitle(NakedObject naked)
          Returns the title string for the specified object.
 void introspect(FacetDecoratorSet decorator)
          Discovers what attributes and behaviour the type specified by this specification.
 Consent isValid(NakedObject transientObject)
          Determines whether the specified object is in a valid state (for example, so can be persisted); represented as a Consent.
 void markAsService()
           
 Persistability persistability()
          Determines if objects of this specification can be persisted or not.
 
Methods inherited from class org.nakedobjects.metamodel.runtimecontext.spec.IntrospectableSpecificationAbstract
addSubclass, clearDirty, createObject, createTitleInteractionContext, createValidityInteractionContext, getActions, getAssociationList, getAssociationList, getAssociations, getAssociations, getAuthenticationSession, getCollectionList, getDefaultValue, getFacet, getFullName, getIconName, getIdentifier, getInstance, getObjectActionList, getPropertyList, getRuntimeContext, getServiceActions, getServiceActionsFor, hasSubclasses, interfaces, isAbstract, isCollection, isCollectionOrIsAggregated, isDirty, isEncodeable, isFinal, isImmutable, isIntrospected, isObject, isOfType, isParseable, isService, isValidResult, isValueOrIsAggregated, markDirty, setIntrospected, subclasses, superclass, 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.facets.FacetHolder
addFacet, addFacet, containsFacet, getFacets, getFacetTypes, removeFacet, removeFacet
 

Constructor Detail

NakedObjectSpecificationNoMember

public NakedObjectSpecificationNoMember(java.lang.String className,
                                        RuntimeContext runtimeContext)
Method Detail

markAsService

public void markAsService()

introspect

public void introspect(FacetDecoratorSet decorator)
Description copied from interface: IntrospectableSpecification
Discovers what attributes and behaviour the type specified by this specification.

As specifications are cyclic (specifically a class will reference its subclasses, which in turn reference their superclass) they need be created first, and then later work out its internals. This allows for cyclic references to the be accommodated as there should always a specification available even though it might not be complete.


getTitle

public java.lang.String getTitle(NakedObject naked)
Description copied from interface: NakedObjectSpecification
Returns the title string for the specified object.


getShortName

public java.lang.String getShortName()
Description copied from interface: NakedObjectSpecification
Returns the class name without the package. Removes the text up to, and including the last period (".").


getSingularName

public java.lang.String getSingularName()
Description copied from interface: NakedObjectSpecification
Returns the singular name for objects of this specification.


getPluralName

public java.lang.String getPluralName()
Description copied from interface: NakedObjectSpecification
Returns the plural name for objects of this specification.


getDescription

public java.lang.String getDescription()
Description copied from interface: NakedObjectSpecification
Returns the description, if any, of the specification.


getAssociation

public NakedObjectAssociation getAssociation(java.lang.String name)
Description copied from interface: NakedObjectAssociationContainer
Get the field object representing the field with the specified field identifier.


getObjectActions

public NakedObjectAction[] getObjectActions(NakedObjectActionType... type)
Description copied from interface: NakedObjectActionContainer
Returns an array of actions of the specified type(s).

If the type is null, then returns all user, exploration and debug actions (but not action sets).

Specified by:
getObjectActions in interface NakedObjectActionContainer
Overrides:
getObjectActions in class IntrospectableSpecificationAbstract

getObjectAction

public NakedObjectAction getObjectAction(NakedObjectActionType type,
                                         java.lang.String id,
                                         NakedObjectSpecification[] parameters)
Description copied from interface: NakedObjectActionContainer
Returns the action of the specified type with the specified signature.


getObjectAction

public NakedObjectAction getObjectAction(NakedObjectActionType type,
                                         java.lang.String id)
Description copied from interface: NakedObjectActionContainer
Get the action object represented by the specified identity string.

The identity string should be Identifier.toNameParmsIdentityString().


isValid

public Consent isValid(NakedObject transientObject)
Description copied from interface: NakedObjectSpecification
Determines whether the specified object is in a valid state (for example, so can be persisted); represented as a Consent.

Specified by:
isValid in interface NakedObjectSpecification
Overrides:
isValid in class IntrospectableSpecificationAbstract

persistability

public Persistability persistability()
Description copied from interface: NakedObjectSpecification
Determines if objects of this specification can be persisted or not. If it can be persisted (i.e. it return something other than Persistability.TRANSIENT NakedObject.isPersistent() will indicated whether the object is persistent or not. If they cannot be persisted then NakedObject. NakedObjectSpecification.persistability() should be ignored.

Specified by:
persistability in interface NakedObjectSpecification
Overrides:
persistability in class IntrospectableSpecificationAbstract

debugData

public void debugData(DebugString debug)

debugTitle

public java.lang.String debugTitle()

createPersistInteractionContext

public InteractionContext createPersistInteractionContext(AuthenticationSession session,
                                                          boolean programmatic,
                                                          NakedObject targetNakedObject)
Does nothing, but should never be called.



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