|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.MetaClassRegistry
public class MetaClassRegistry
A registry of MetaClasses that can be looked up by name. The MetaClassRegistry acts as sort of a class-loader in meta-space. Each MetaClass knows which class registry it belongs to and can use this information to look up information about related classes.
Field Summary | |
---|---|
static int |
LOOKUP_LOCAL_FIRST
|
static int |
LOOKUP_LOCAL_ONLY
|
static int |
LOOKUP_PARENT_FIRST
|
Constructor Summary | |
---|---|
MetaClassRegistry()
Creates a new meta-class registry that delegates to the root registry after looking for a class locally. |
|
MetaClassRegistry(int delegationPolicy)
Creates a new meta-class registry the delegates to the root registry as specified by the delegation policy parameter. |
|
MetaClassRegistry(MetaClassRegistry parentRegistry)
Creates a new meta-class registry the delegates to the specified parent registry after looking for a class locally. |
|
MetaClassRegistry(MetaClassRegistry parentRegistry,
int delegationPolicy)
Creates a new meta-class registry the delegates to the specified parent registry as specified by the delegation policy parameter. |
Method Summary | |
---|---|
MetaClass |
createMetaClass(java.lang.String name,
java.util.Collection propertyInfos)
Creates a meta-class from the specified information. |
MetaClass |
createMetaClass(java.lang.String name,
java.util.Collection propertyInfos,
java.util.Collection uniqueProperties,
java.util.Collection superclasses)
Creates a meta-class from the specified information. |
MetaClass |
createMetaClass(java.lang.String name,
java.util.Collection propertyInfos,
java.util.List superclasses)
Creates a meta-class from the specified information. |
MetaClass |
createMetaClass(java.lang.String name,
java.util.Collection propertyInfos,
MetaClass superclass)
Creates a meta-class from the specified information. |
boolean |
exists(java.lang.String name)
Returns true if the specified class name has a meta-class associated with it. |
static MetaClassRegistry |
getContextRegistry()
Returns the current thread's context meta-class registry or the root class registry if one has not been set. |
int |
getDelegationPolicy()
Returns the policy used to determine how this class registry interacts with its parent registry. |
MetaClass |
getMetaClass(java.lang.String name)
Retrieves the meta-class associated with the specified class name. |
java.util.Collection |
getMetaClasses()
Returns a read-only collection containing all of the MetaClasses in this registry. |
MetaClassRegistry |
getParentRegistry()
Returns the parent registry to this meta-class registry or null if there is no parent registry. |
static MetaClassRegistry |
getRootRegistry()
Returns the singleton instance of the root class registry. |
protected boolean |
isInCache(java.lang.String name)
Temporary. |
protected void |
putMetaClass(java.lang.String name,
MetaClass mc)
Temporary. |
static void |
setContextRegistry(MetaClassRegistry registry)
Sets the current thread's context meta-class registry or the root class registry if one has not been set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOOKUP_PARENT_FIRST
public static final int LOOKUP_LOCAL_FIRST
public static final int LOOKUP_LOCAL_ONLY
Constructor Detail |
---|
public MetaClassRegistry()
public MetaClassRegistry(int delegationPolicy)
public MetaClassRegistry(MetaClassRegistry parentRegistry)
public MetaClassRegistry(MetaClassRegistry parentRegistry, int delegationPolicy)
Method Detail |
---|
public static MetaClassRegistry getRootRegistry()
public static MetaClassRegistry getContextRegistry()
public static void setContextRegistry(MetaClassRegistry registry)
public MetaClassRegistry getParentRegistry()
public int getDelegationPolicy()
public MetaClass createMetaClass(java.lang.String name, java.util.Collection propertyInfos) throws DuplicateMetaClassException
name
- The name of the meta-class to create.propertyInfos
- The PropertyInfo objects describing the properties
of the meta-class.
DuplicateMetaClassException
- if a MetaClass already exists in this registry for the
specified name.public MetaClass createMetaClass(java.lang.String name, java.util.Collection propertyInfos, java.util.Collection uniqueProperties, java.util.Collection superclasses) throws DuplicateMetaClassException
name
- The name of the meta-class to create.propertyInfos
- The PropertyInfo objects describing the properties
of the meta-class.superclasses
- The meta-classes from which this meta-class is derived.
Any properties in the superclasses will be inherited directly unless specifically
overridden in the propertyInfos list.uniqueProperties
- The set of properties that define the uniqueness of
instances of the created meta-class. This will be used by most
implementations for object equivalence checks. The unique properties
are combined with those defined in the superclasses.
DuplicateMetaClassException
- if a MetaClass already exists in this registry for the
specified name.protected void putMetaClass(java.lang.String name, MetaClass mc)
protected boolean isInCache(java.lang.String name)
public MetaClass createMetaClass(java.lang.String name, java.util.Collection propertyInfos, java.util.List superclasses) throws DuplicateMetaClassException
name
- The name of the meta-class to create.propertyInfos
- The PropertyInfo objects describing the properties
of the meta-class.superclasses
- The meta-classes from which this meta-class is derived.
Any properties in the superclasses will be inherited directly unless specifically
overridden in the propertyInfos list.
DuplicateMetaClassException
- if a MetaClass already exists in this registry for the
specified name.public MetaClass createMetaClass(java.lang.String name, java.util.Collection propertyInfos, MetaClass superclass)
name
- The name of the meta-class to create.propertyInfos
- The PropertyInfo objects describing the properties
of the meta-class.superclass
- The single meta-class from which this meta-class is derived.
Any properties in the superclass will be inherited directly unless specifically
overridden in the propertyInfos list.public MetaClass getMetaClass(java.lang.String name)
public boolean exists(java.lang.String name)
public java.util.Collection getMetaClasses()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |