|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.util.MetaObjectUtils
public class MetaObjectUtils
Utilities useful for working with meta-objects.
Field Summary | |
---|---|
static MetaClass |
ANNOTATION_CLASS
|
static java.lang.String |
ANNOTATION_KEY
|
static java.lang.String |
ANNOTATION_TYPE
|
static java.lang.String |
ANNOTATION_VALUE
|
static MetaClass |
CONTAINER_PROPERTY_INFO_CLASS
Defines a meta-class for ContainerPropertyInfo so that it can subclass PropertyInfo and pick up its custom properties. |
static java.lang.String |
CONTAINER_PROPERTY_INFO_NAME
|
static java.lang.String |
META_CLASS_ANNOTATIONS
|
static java.lang.String |
META_CLASS_IDENTITY
|
static java.lang.String |
META_CLASS_NAME
|
static java.lang.String |
META_CLASS_PROPERTIES
|
static java.lang.String |
META_CLASS_PROPERTY_DEFS
|
static java.lang.String |
META_CLASS_SUPERCLASSES
|
static java.lang.String |
META_CLASS_TEMPLATE_FACTORY
|
static java.lang.String |
META_CLASS_TEMPLATE_NAME
|
static MetaClass |
META_CLASS_TYPE
Creates a MetaClass representing the properties of a MetaClass. |
static java.lang.String |
PROPERTY_ANNOTATIONS
|
static java.lang.String |
PROPERTY_CLASS_TYPE
|
static MetaClass |
PROPERTY_INFO_CLASS
Defines a meta-class for PropertyInfo so that we can add some custom properties. |
static java.lang.String |
PROPERTY_INFO_NAME
|
static java.lang.String |
PROPERTY_META_CLASS_TYPE
|
Constructor Summary | |
---|---|
MetaObjectUtils()
|
Method Summary | |
---|---|
static boolean |
areEqualValues(MetaObject m1,
MetaObject m2)
Returns true if both meta-objects are the same class and have the same values for all of their properties. |
static java.lang.Object |
bytesToObject(byte[] bytes,
Cache cache)
Converts a byte array into the un-serialized Serializable object it contains. |
static MetaObject |
cloneMetaObject(MetaObject source)
Creates a shallow clone of the supplied meta-object. |
static void |
copyMetaObject(MetaObject source,
MetaObject destination)
Performs a shallow copy of one meta-object to another. |
static void |
copyMetaObject(MetaObject source,
MetaObject destination,
boolean copyReadOnly)
Performs a shallow copy of one meta-object to another. |
static MetaClass |
createMetaClass(MetaObject metaClassInfo)
Creates a MetaClass for the specified MetaObject representation of a MetaClass. |
static MetaClass |
createMetaClass(MetaObject metaClassInfo,
MetaClassRegistry registry)
Creates a MetaClass for the specified MetaObject representation of a MetaClass. |
static MetaObject |
createMetaObjectForMetaClass(MetaClass metaClass)
Creates a MetaObject representation of the specified MetaClass. |
static PropertyInfo |
createPropertyInfo(MetaObject propInfo)
Creates a PropertyInfo object for the specified PropertyInfo MetaObject representation. |
static PropertyInfo |
findPropertyInfo(java.lang.String property,
java.util.List propertyInfos)
Finds the PropertyInfo for the specified name in the specified list. |
static byte[] |
objectToBytes(java.io.Serializable object)
Converts a serializable object into a byte[] array. |
static PropertyInfo |
removePropertyInfo(java.lang.String property,
java.util.List propertyInfos)
Finds and removes the PropertyInfo for the specified name in the specified list. |
static void |
replacePropertyType(java.util.List propertyInfos,
java.lang.String property,
PropertyType type)
Replaces the specified field's type with the specified type. |
static void |
resetDefaultValues(MetaObject metaObject)
Resets the state of the MetaObject to use any default values defined in the MetaClass definition. |
static void |
setPropertyInfoAttributes(PropertyInfo propInfo,
MetaObject mInfo)
Sets the attributes of the specified PropertyInfo object to those contained in the MetaObject representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MetaClass META_CLASS_TYPE
public static final java.lang.String META_CLASS_NAME
public static final java.lang.String META_CLASS_IDENTITY
public static final java.lang.String META_CLASS_PROPERTIES
public static final java.lang.String META_CLASS_SUPERCLASSES
public static final java.lang.String META_CLASS_ANNOTATIONS
public static final java.lang.String META_CLASS_TEMPLATE_FACTORY
public static final java.lang.String META_CLASS_TEMPLATE_NAME
public static final java.lang.String META_CLASS_PROPERTY_DEFS
public static final MetaClass PROPERTY_INFO_CLASS
public static final java.lang.String PROPERTY_INFO_NAME
public static final java.lang.String PROPERTY_ANNOTATIONS
public static final java.lang.String PROPERTY_CLASS_TYPE
public static final java.lang.String PROPERTY_META_CLASS_TYPE
public static final MetaClass CONTAINER_PROPERTY_INFO_CLASS
public static final java.lang.String CONTAINER_PROPERTY_INFO_NAME
public static final MetaClass ANNOTATION_CLASS
public static final java.lang.String ANNOTATION_TYPE
public static final java.lang.String ANNOTATION_KEY
public static final java.lang.String ANNOTATION_VALUE
Constructor Detail |
---|
public MetaObjectUtils()
Method Detail |
---|
public static boolean areEqualValues(MetaObject m1, MetaObject m2)
public static void copyMetaObject(MetaObject source, MetaObject destination)
source
- Meta-object to copy from.destination
- Meta-object to copy to.public static void copyMetaObject(MetaObject source, MetaObject destination, boolean copyReadOnly)
source
- Meta-object to copy from.destination
- Meta-object to copy to.copyReadOnly
- Set to true to force a field copy of read-only properties.
This only works if the destination object supports setting
read-only fields.public static MetaObject cloneMetaObject(MetaObject source)
source
- Meta-object to clone.
public static PropertyInfo findPropertyInfo(java.lang.String property, java.util.List propertyInfos)
public static PropertyInfo removePropertyInfo(java.lang.String property, java.util.List propertyInfos)
public static void replacePropertyType(java.util.List propertyInfos, java.lang.String property, PropertyType type)
public static MetaObject createMetaObjectForMetaClass(MetaClass metaClass)
public static MetaClass createMetaClass(MetaObject metaClassInfo)
public static MetaClass createMetaClass(MetaObject metaClassInfo, MetaClassRegistry registry)
public static PropertyInfo createPropertyInfo(MetaObject propInfo)
public static void setPropertyInfoAttributes(PropertyInfo propInfo, MetaObject mInfo)
public static byte[] objectToBytes(java.io.Serializable object)
public static java.lang.Object bytesToObject(byte[] bytes, Cache cache)
public static void resetDefaultValues(MetaObject metaObject)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |