|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.specloader.NakedObjectReflectorAbstract
public abstract class NakedObjectReflectorAbstract
Builds the meta-model for Java 5 programming model.
The implementation provides for a degree of pluggability:
ProgrammingModelFacets that
specifies the set of Facet that make up programming model. If not
specified then defaults to ProgrammingModelFacetsJava5 (which should
be used as a starting point for your own customizations).
ClassSubstitutor, which
allows the class to be loaded to be substituted if required. This is used in
conjunction with some PersistenceMechanisms that do class
enhancement.
CollectionTypeRegistry specifies the types that should be
considered as collections. If not specified then will
default. (Note: this extension point
has not been tested, so should be considered more of a "statement of
intent" than actual API. Also, we may use annotations (similar to the
way in which Values are specified) as an alternative mechanism).
In addition, the RuntimeContext can optionally be injected, but will
default to RuntimeContextNoRuntime if not provided prior to
initialization. The purpose of RuntimeContext is to
allow the metamodel to be used standalone, for example in a Maven plugin. The
RuntimeContextNoRuntime implementation will through an exception for
any methods (such as finding an adapter) because there is
no runtime session. In the case of the metamodel being used by the framework
(that is, when there is a runtime), then the framework injects an
implementation of RuntimeContext that acts like a bridge to its
NakedObjectsContext.
| Constructor Summary | |
|---|---|
NakedObjectReflectorAbstract(NakedObjectConfiguration configuration,
ClassSubstitutor classSubstitutor,
CollectionTypeRegistry collectionTypeRegistry,
SpecificationTraverser specificationTraverser,
ProgrammingModelFacets programmingModelFacets,
java.util.Set<FacetDecorator> facetDecorators,
MetaModelValidator metaModelValidator)
|
|
| Method Summary | |
|---|---|
NakedObjectSpecification[] |
allSpecifications()
Return all the loaded specifications. |
protected NakedObjectSpecification |
createSpecification(java.lang.Class<?> cls)
Overridable method for language-specific subclass to create the appropriate type of NakedObjectSpecification. |
void |
debugData(DebugString str)
Debug details describing the object being investigated |
java.lang.String |
debugTitle()
The title for the debug information |
protected void |
finalize()
|
ClassSubstitutor |
getClassSubstitutor()
The configured ClassSubstitutor. |
CollectionTypeRegistry |
getCollectionTypeRegistry()
|
java.util.Set<FacetDecorator> |
getFacetDecoratorSet()
|
FacetProcessor |
getFacetProcessor()
Provides access to the registered Facets. |
MetaModelValidator |
getMetaModelValidator()
|
NakedObjectConfiguration |
getNakedObjectConfiguration()
|
ProgrammingModelFacets |
getProgrammingModelFacets()
|
RuntimeContext |
getRuntimeContext()
As per setRuntimeContext(RuntimeContext). |
java.util.List<java.lang.Class<?>> |
getServiceClasses()
|
SpecificationTraverser |
getSpecificationTraverser()
|
void |
init()
Initializes and wires up, and primes the cache based on any service classes that may have been injected. |
void |
injectInto(java.lang.Object candidate)
Injects self into candidate if required, and instructs its subcomponents to do so also. |
boolean |
loaded(java.lang.Class<?> cls)
Whether this class has been loaded. |
boolean |
loaded(java.lang.String fullyQualifiedClassName)
|
NakedObjectSpecification |
loadSpecification(java.lang.Class<?> type)
API: Return specification. |
NakedObjectSpecification |
loadSpecification(java.lang.String className)
API: Return the specification for the specified class of object. |
boolean |
loadSpecifications(java.util.List<java.lang.Class<?>> typesToLoad)
|
boolean |
loadSpecifications(java.util.List<java.lang.Class<?>> typesToLoad,
java.lang.Class<?> typeToIgnore)
Loads the specifications of the specified types except the one specified (to prevent an infinite loop). |
void |
setRuntimeContext(RuntimeContext runtimeContext)
Due to RuntimeContextAware. |
void |
setServiceClasses(java.util.List<java.lang.Class<?>> serviceClasses)
Specify the classes of the services to pro-actively prime the cache. |
void |
shutdown()
Indicates to the component that it will no longer be used and should shut itself down cleanly. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NakedObjectReflectorAbstract(NakedObjectConfiguration configuration,
ClassSubstitutor classSubstitutor,
CollectionTypeRegistry collectionTypeRegistry,
SpecificationTraverser specificationTraverser,
ProgrammingModelFacets programmingModelFacets,
java.util.Set<FacetDecorator> facetDecorators,
MetaModelValidator metaModelValidator)
| Method Detail |
|---|
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic void init()
injected.
init in interface ApplicationScopedComponentpublic void shutdown()
ApplicationScopedComponent
shutdown in interface ApplicationScopedComponentpublic final NakedObjectSpecification loadSpecification(java.lang.String className)
loadSpecification in interface SpecificationLoaderpublic NakedObjectSpecification loadSpecification(java.lang.Class<?> type)
loadSpecification in interface SpecificationLoaderSpecificationLoader.loadSpecification(String)
public boolean loadSpecifications(java.util.List<java.lang.Class<?>> typesToLoad,
java.lang.Class<?> typeToIgnore)
public boolean loadSpecifications(java.util.List<java.lang.Class<?>> typesToLoad)
protected NakedObjectSpecification createSpecification(java.lang.Class<?> cls)
NakedObjectSpecification.
public NakedObjectSpecification[] allSpecifications()
allSpecifications in interface SpecificationLoaderpublic boolean loaded(java.lang.Class<?> cls)
SpecificationLoader
loaded in interface SpecificationLoaderpublic boolean loaded(java.lang.String fullyQualifiedClassName)
loaded in interface SpecificationLoaderSpecificationLoader.loaded(Class).public void injectInto(java.lang.Object candidate)
injectInto in interface Injectablepublic void debugData(DebugString str)
DebugInfo
debugData in interface DebugInfopublic java.lang.String debugTitle()
DebugInfo
debugTitle in interface DebugInfopublic FacetProcessor getFacetProcessor()
Facets.
public RuntimeContext getRuntimeContext()
setRuntimeContext(RuntimeContext).
getRuntimeContext in interface NakedObjectReflectorpublic void setRuntimeContext(RuntimeContext runtimeContext)
RuntimeContextAware.
setRuntimeContext in interface RuntimeContextAwarepublic java.util.List<java.lang.Class<?>> getServiceClasses()
public void setServiceClasses(java.util.List<java.lang.Class<?>> serviceClasses)
SpecificationLoader
setServiceClasses in interface SpecificationLoaderpublic NakedObjectConfiguration getNakedObjectConfiguration()
public ClassSubstitutor getClassSubstitutor()
NakedObjectReflectorClassSubstitutor.
getClassSubstitutor in interface NakedObjectReflectorpublic CollectionTypeRegistry getCollectionTypeRegistry()
public SpecificationTraverser getSpecificationTraverser()
getSpecificationTraverser in interface NakedObjectReflectorpublic ProgrammingModelFacets getProgrammingModelFacets()
getProgrammingModelFacets in interface NakedObjectReflectorpublic java.util.Set<FacetDecorator> getFacetDecoratorSet()
public MetaModelValidator getMetaModelValidator()
getMetaModelValidator in interface NakedObjectReflector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||