org.nakedobjects.object
Class NakedClass

java.lang.Object
  extended byjava.util.Observable
      extended byorg.nakedobjects.object.AbstractNakedObject
          extended byorg.nakedobjects.object.NakedClass
All Implemented Interfaces:
java.io.Externalizable, Naked, NakedObject, java.io.Serializable

public final class NakedClass
extends AbstractNakedObject
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static NakedClass FINDER
           
 
Method Summary
 About aboutActionFinder()
           
 About aboutActionInstances()
           
 About aboutActionNewInstance()
           
 About aboutExplorationActionClass()
           
 About aboutExplorationActionClone()
           
 About aboutExplorationActionDestroyObject()
           
 About aboutExplorationActionMakePersistent()
           
 NakedObject acquireInstance()
          Creates an object of the type represented by this object.
 NakedObject actionFinder()
           
 InstanceCollection actionInstances()
           
 NakedObject actionNewInstance()
           
static java.lang.String actionOrder()
           
 boolean canInstantiate()
          Deprecated. - having a valid/default constructor is mandatory now. this should not be used to determine instantiability
static java.lang.String className(java.lang.Class clas)
          Returns the name of the class with out the package details.
 void clear(NakedObject object)
          Removes all the data from the specified object.
 NakedObject createFinder()
          Creates a finder object with no references or values.
static NakedClass createFor(java.lang.Class c)
          Deprecated. use getNakedClass()
 java.lang.String debugInterface()
           
static java.lang.String dump()
           
 Action get0ParamAction(java.lang.String name)
           
 Action[] get0ParamActions()
           
 Action get0ParamClassAction(java.lang.String name)
           
 Action[] get0ParamClassActions()
           
 Action get1ParamAction(java.lang.Class type)
          Returns the Action for the specified class and type (look for the process method that take that type of object).
 Action get1ParamAction(java.lang.String name)
           
 Action[] get1ParamActions()
           
 Action get1ParamClassAction(java.lang.Class type)
          Returns the Action for the specified type (look for the process method that take that type of object).
 Action[] get1ParamClassActions()
           
 About getClassAbout()
           
 Action[] getExplorationActions()
           
 Action[] getExplorationClassActions()
           
 Field getField(java.lang.String name)
           
 Field[] getFields()
           
 java.lang.String getIconName()
          Returns the String returned by getClassName()
 java.lang.Class getJavaType()
          Return the java type (a Class object) that this NakedClass is representing.
static NakedClass getNakedClass(java.lang.Class c)
          Returns the NakedClass object for the specified class.
static NakedClass getNakedClass(java.lang.String className)
          Returns the NakedClass object for the specified type.
 java.lang.String getName()
          Returns the name of the NakedClass.
 java.lang.String getObjectHelpText()
          Returns a textual desctiption of the object - its contents and possible uses.
 java.lang.Object getOid()
          The objects unique id.
 java.lang.String getPluralName()
          Returns the short name (with spacing) for this object in a pluralised form.
 java.lang.String getShortName()
          Returns the class name without the package.
 java.lang.String getSingularName()
          Returns the short name (with spacing) of this NakedClass object.
 boolean hasSubclasses()
           
 boolean isCollection()
          Returns true if this NakedClass represents a collection - of, or subclassed from, NakedCollection.
 boolean isData()
          Returns true if this NakedClass represents a value object - subclassed from NakedValue.
 boolean isObject()
          Returns true if this NakedClass represents a reference object - subclassed from NakedObject.
 boolean isResolved()
          returns true when the object has been completely read into memory and all it attributes can be accessed.
static java.lang.String naturalName(java.lang.String javaName)
          Returns a human readable form of the specified name of a Java entity.
static void reset()
          Removes all the objects definitions so they are reloaded.
 void setOid(java.lang.Object oid)
          Sets the OID for this object.
static java.lang.String shortClassName(java.lang.String fullyQualifiedClassName)
          Returns the short name of the fully qualified name (including the package name) .
 NakedClassList subclasses()
           
 Title title()
          every Naked Object is required to provide a Title by which it is identified to the end user.
 java.lang.String toString()
           
 
Methods inherited from class org.nakedobjects.object.AbstractNakedObject
about, canClone, contextualTitle, copyObject, created, createInstance, createInstance, createTransientInstance, deleted, destroy, equals, explorationActionClass, explorationActionClone, explorationActionMakePersistent, getClassHelpText, getClassName, getCollectiveName, getFullClassName, getIdString, getNakedClass, getObjectStore, hashCode, iconImage, init, isEmpty, isFinder, isLookupElement, isPersistent, isSameAs, isValid, makeFinder, makePersistent, objectChanged, readExternal, resolve, resolve, setChangedAndNotifyObservers, setResolved, summary, writeExternal
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.object.NakedObject
addObserver, countObservers, deleteObserver, hasChanged
 

Field Detail

FINDER

public static final NakedClass FINDER
Method Detail

actionOrder

public static java.lang.String actionOrder()

getClassAbout

public About getClassAbout()

isCollection

public boolean isCollection()
Returns true if this NakedClass represents a collection - of, or subclassed from, NakedCollection.


isData

public boolean isData()
Returns true if this NakedClass represents a value object - subclassed from NakedValue.


getExplorationActions

public Action[] getExplorationActions()

getExplorationClassActions

public Action[] getExplorationClassActions()

getField

public Field getField(java.lang.String name)

getFields

public Field[] getFields()

getIconName

public java.lang.String getIconName()
Description copied from class: AbstractNakedObject
Returns the String returned by getClassName()

Overrides:
getIconName in class AbstractNakedObject
See Also:
AbstractNakedObject.getClassName()

getJavaType

public java.lang.Class getJavaType()
Return the java type (a Class object) that this NakedClass is representing.


getNakedClass

public static NakedClass getNakedClass(java.lang.Class c)
Returns the NakedClass object for the specified class. Calls the getNakedClass(String) method.


getNakedClass

public static NakedClass getNakedClass(java.lang.String className)
Returns the NakedClass object for the specified type. This is retrieved from an internal cache if it exists; if not, a new NakedClass object is created and it is added to the cache.


getName

public java.lang.String getName()
Returns the name of the NakedClass. This is the fully qualified name of the Class object that this object represents (i.e. it includes the package name).


isObject

public boolean isObject()
Returns true if this NakedClass represents a reference object - subclassed from NakedObject.


getObjectHelpText

public java.lang.String getObjectHelpText()
Description copied from interface: Naked
Returns a textual desctiption of the object - its contents and possible uses.

Specified by:
getObjectHelpText in interface Naked
Overrides:
getObjectHelpText in class AbstractNakedObject

getOid

public java.lang.Object getOid()
Description copied from interface: NakedObject
The objects unique id. This id allows the object to added to, stored by, and retrieved from the object store.

Specified by:
getOid in interface NakedObject
Overrides:
getOid in class AbstractNakedObject

getPluralName

public java.lang.String getPluralName()
Returns the short name (with spacing) for this object in a pluralised form. The plural from is obtained from the defining classes pluralName method, if it exists, or by adding 's', 'es', or 'ies dependending of the name's ending.


isResolved

public boolean isResolved()
Description copied from interface: NakedObject
returns true when the object has been completely read into memory and all it attributes can be accessed.

Specified by:
isResolved in interface NakedObject
Overrides:
isResolved in class AbstractNakedObject

getShortName

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


getSingularName

public java.lang.String getSingularName()
Returns the short name (with spacing) of this NakedClass object. This is the objects name with package name removed.

Removes the text up to, and including the last period (".").


acquireInstance

public NakedObject acquireInstance()
Creates an object of the type represented by this object. This method only creates a java object (using newInstance on the Class object returned using the getJavaType method).

Returns:
org.nakedobjects.object.NakedObject

aboutActionNewInstance

public About aboutActionNewInstance()

actionNewInstance

public NakedObject actionNewInstance()

aboutActionFinder

public About aboutActionFinder()
                        throws ObjectStoreException
Throws:
ObjectStoreException

actionFinder

public NakedObject actionFinder()

aboutActionInstances

public About aboutActionInstances()
                           throws ObjectStoreException
Throws:
ObjectStoreException

aboutExplorationActionClone

public About aboutExplorationActionClone()
Overrides:
aboutExplorationActionClone in class AbstractNakedObject

aboutExplorationActionClass

public About aboutExplorationActionClass()
Overrides:
aboutExplorationActionClass in class AbstractNakedObject

aboutExplorationActionMakePersistent

public About aboutExplorationActionMakePersistent()
Overrides:
aboutExplorationActionMakePersistent in class AbstractNakedObject

aboutExplorationActionDestroyObject

public About aboutExplorationActionDestroyObject()

actionInstances

public InstanceCollection actionInstances()

canInstantiate

public boolean canInstantiate()
Deprecated. - having a valid/default constructor is mandatory now. this should not be used to determine instantiability


className

public static java.lang.String className(java.lang.Class clas)
Returns the name of the class with out the package details. E.g., className(String.class) will return String whereas String.class.getName() will return java.lang.String.


createFinder

public NakedObject createFinder()
Creates a finder object with no references or values.

Returns:
NakedObject

createFor

public static NakedClass createFor(java.lang.Class c)
Deprecated. use getNakedClass()

Returns the NakedClass object for the specified type of object. This is retrieved from an internal cache if it exists; if not, a new NakedClass object is created and it added to the cache.


debugInterface

public java.lang.String debugInterface()

dump

public static java.lang.String dump()

get0ParamAction

public Action get0ParamAction(java.lang.String name)

get0ParamActions

public Action[] get0ParamActions()

get0ParamClassAction

public Action get0ParamClassAction(java.lang.String name)

get0ParamClassActions

public Action[] get0ParamClassActions()

get1ParamAction

public Action get1ParamAction(java.lang.Class type)
Returns the Action for the specified class and type (look for the process method that take that type of object). Works it way up through the class hierachy from the specified type up to, but not including, the Object class. NOTE - this does not consider interfaces at present!


get1ParamAction

public Action get1ParamAction(java.lang.String name)

get1ParamActions

public Action[] get1ParamActions()

get1ParamClassAction

public Action get1ParamClassAction(java.lang.Class type)
Returns the Action for the specified type (look for the process method that take that type of object). Works it way up through the class hierachy from the specified type up to, but not including, the Object class. NOTE - this does not consider interfaces at present!

Parameters:
type - java.lang.Class
Returns:
org.nakedobjects.object.Action

get1ParamClassActions

public Action[] get1ParamClassActions()

hasSubclasses

public boolean hasSubclasses()

naturalName

public static java.lang.String naturalName(java.lang.String javaName)
Returns a human readable form of the specified name of a Java entity. The specified string is scanned for its first upper case letter; this marks the beginning of the name. The next instance of an uppercase letter is then sought; this marks the next work. This is repeated until no more uppercase letters are found and then a new string is created that contains all the found words, in the same order, but with spaces inserted between each. If no upper case letter is found then the text invalid name is returned.

Calling this method with the following Java names will produce these results:

       getCarRegistration        -> Car Registration
       CityMayor -> City Mayor
       isReady -> Ready
       


reset

public static void reset()
Removes all the objects definitions so they are reloaded.


setOid

public void setOid(java.lang.Object oid)
Description copied from interface: NakedObject
Sets the OID for this object. This id must be unique.

Specified by:
setOid in interface NakedObject
Overrides:
setOid in class AbstractNakedObject

shortClassName

public static java.lang.String shortClassName(java.lang.String fullyQualifiedClassName)
Returns the short name of the fully qualified name (including the package name) . e.g. for com.xyz.example.Customer returns Customer.


subclasses

public NakedClassList subclasses()

title

public Title title()
Description copied from class: AbstractNakedObject
every Naked Object is required to provide a Title by which it is identified to the end user.

Unless overridden, the String representation of this Title object is available through contextualTitle().

Specified by:
title in interface Naked
Overrides:
title in class AbstractNakedObject
See Also:
AbstractNakedObject.contextualTitle()

toString

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

clear

public void clear(NakedObject object)
Removes all the data from the specified object. All associations are set to nulll; values have clear() call on them; and internal collections are reset so they have zero elements