|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.MetaClass
public class MetaClass
Describes the properties associated with a meta-object. MetaClass objects must be created through the factory methods provided by the MetaClassRegistry to which they will belong.
Constructor Summary | |
---|---|
protected |
MetaClass(MetaClassRegistry classRegistry,
java.lang.String name,
java.util.Collection propertyInfo,
java.util.Collection identityProperties,
java.util.Collection superclasses)
Creates the meta-class using the specified parameters. |
Method Summary | |
---|---|
protected void |
addProperty(PropertyInfo info)
Adds the specified property info to this meta-class. |
boolean |
areEquivalent(MetaObject obj1,
MetaObject obj2)
Returns true if the specified meta-objects are equivalent based on this meta-class's identity. |
boolean |
equals(MetaClass mClass)
|
boolean |
equals(java.lang.Object obj)
|
static MetaClass |
forName(java.lang.String name)
Retrieves the specified class from the current context class registry or throws a RuntimeException. |
MetaClassRegistry |
getClassRegistry()
Returns the class registry to which this meta-class belongs. |
java.lang.String |
getIdentityKey(MetaObject obj)
Returns a string "key" for the MetaObject based on its identity. |
java.util.Set |
getIdentityProperties()
Returns the set of the names of this MetaClass's identity properties. |
java.lang.Object |
getMetaClassAnnotation(AnnotationType type)
Returns the general MetaClass-level annotation for the specified annotation type. |
java.lang.Object |
getMetaClassAnnotation(AnnotationType type,
java.lang.Object key)
Returns the MetaClass-level annotation for the specified annotation type and key. |
java.lang.String |
getName()
Returns the name of this meta-class. |
java.lang.Object |
getPropertyAnnotation(AnnotationType type,
java.lang.String propertyName)
Returns the annotation for the specified annotation type and property. |
PropertyInfo |
getPropertyInfo(java.lang.String name)
Returns the descriptive information for the specified property. |
java.util.Collection |
getPropertyInfos()
Returns an unmodifiable collection of property info objects. |
java.util.Set |
getPropertyNames()
Returns the unmodifiable sorted set of property names in alphabetical order. |
PropertyType |
getPropertyType(java.lang.String name)
Returns the type for the specified property. |
java.util.List |
getSuperclasses()
Returns a List containing the immediate superclasses of this meta-class. |
int |
hashCode()
|
int |
hashCode(MetaObject instance,
int defaultHash)
Returns a hashcode for the specified MetaObject instance based on the identity properties for this meta-class. |
boolean |
hasIdentity()
Returns true if this class defines any identity properties. |
boolean |
hasProperty(java.lang.String name)
Returns true if this class has the specified property defined. |
boolean |
isAssignableFrom(MetaClass metaClass)
Returns true if this MetaClass is either the same as or is a superclass of the specified MetaClass. |
boolean |
isInstance(MetaObject obj)
Returns true if the specified meta-object is an instance of this class. |
boolean |
isInstance(java.lang.Object obj)
Returns true if the specified object is a meta-object and an instance of this class. |
static MetaClass |
lookupMetaClass(java.lang.String name)
Retrieves the specified class from the current context class registry or returns null. |
java.util.Iterator |
propertyNames()
Returns an iterator over all valid property names in alphabetical order. |
protected PropertyType |
resolveType(PropertyType type)
Called internally to resolve a property type if it is required. |
void |
resolveTypes()
Resolves any deferred types against the class registry associated with this meta-class. |
void |
setMetaClassAnnotation(AnnotationType type,
java.lang.Object annotation)
Sets the general MetaClass-level annotation for the specified annotation type to the specified value. |
void |
setMetaClassAnnotation(AnnotationType type,
java.lang.Object key,
java.lang.Object annotation)
Sets the MetaClass-level annotation for the specified annotation type and key to the specified value. |
void |
setPropertyAnnotation(AnnotationType type,
java.lang.String propertyName,
java.lang.Object annotation)
Sets the annotation value for the specified annotation type and property. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected MetaClass(MetaClassRegistry classRegistry, java.lang.String name, java.util.Collection propertyInfo, java.util.Collection identityProperties, java.util.Collection superclasses)
Method Detail |
---|
protected PropertyType resolveType(PropertyType type)
public void resolveTypes()
public MetaClassRegistry getClassRegistry()
public java.lang.String getName()
public java.util.List getSuperclasses()
public java.util.Set getIdentityProperties()
public boolean hasIdentity()
protected void addProperty(PropertyInfo info)
public PropertyType getPropertyType(java.lang.String name)
public PropertyInfo getPropertyInfo(java.lang.String name)
public java.util.Iterator propertyNames()
public java.util.Set getPropertyNames()
public boolean hasProperty(java.lang.String name)
public java.util.Collection getPropertyInfos()
public java.lang.Object getMetaClassAnnotation(AnnotationType type)
public void setMetaClassAnnotation(AnnotationType type, java.lang.Object annotation) throws ImmutableAnnotationMapException
ImmutableAnnotationMapException
- if the annotation type does not
support updates to annotation values.public java.lang.Object getMetaClassAnnotation(AnnotationType type, java.lang.Object key)
public void setMetaClassAnnotation(AnnotationType type, java.lang.Object key, java.lang.Object annotation) throws ImmutableAnnotationMapException, UnsupportedKeyException
ImmutableAnnotationMapException
- if the annotation type does not
support updates to annotation values.
UnsupportedKeyException
- if the specified key is not supported
by the underlying implementation.public java.lang.Object getPropertyAnnotation(AnnotationType type, java.lang.String propertyName)
public void setPropertyAnnotation(AnnotationType type, java.lang.String propertyName, java.lang.Object annotation) throws ImmutableAnnotationMapException
ImmutableAnnotationMapException
- if the annotation type does not
support updates to annotation values.public boolean isInstance(MetaObject obj)
public boolean isInstance(java.lang.Object obj)
public boolean isAssignableFrom(MetaClass metaClass)
public int hashCode(MetaObject instance, int defaultHash)
public boolean areEquivalent(MetaObject obj1, MetaObject obj2)
public java.lang.String getIdentityKey(MetaObject obj)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(MetaClass mClass)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static MetaClass forName(java.lang.String name) throws MetaClassNotFoundException
MetaClassNotFoundException
public static MetaClass lookupMetaClass(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |