Package org.synchronoss.cpo.core.meta
Class AbstractCpoMetaAdapter
java.lang.Object
org.synchronoss.cpo.core.meta.AbstractCpoMetaAdapter
- All Implemented Interfaces:
CpoMetaAdapter
Base
CpoMetaAdapter implementation that maintains the in-memory map of loaded CpoClass metadata and the shared logic for loading that metadata from the JAXB-bound Ct*
classes produced by unmarshalling a CPO meta XML document. Datastore-specific subclasses supply
the DataTypeMapper and the concrete CpoClass/CpoAttribute/CpoFunctionGroup/CpoFunction/CpoArgument factory methods.- Author:
- dberry
-
Method Summary
Modifier and TypeMethodDescriptionGets the names of all native data types this meta adapter knows how to map.Returns a list of the cpo class objects that the meta adapter is aware of.intgetDataTypeInt(String dataTypeName) Gets the integer identifier for a named native data type.Class<?> getDataTypeJavaClass(CpoAttribute attribute) Gets the Java class that the given attribute's native data type maps to.getDataTypeMapEntry(int dataTypeInt) Gets the full data type mapping entry for a given native data type identifier.getDataTypeName(CpoAttribute attribute) Gets the Java class name that the given attribute's native data type maps to.<T> CpoClassgetMetaClass(T bean) Returns the metadata for the class that is contained within the metadata sourceMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.synchronoss.cpo.core.meta.CpoMetaAdapter
getExpressionParser
-
Method Details
-
getMetaClass
Returns the metadata for the class that is contained within the metadata sourceLooks up the metadata by
bean's exact class name first, then walks up the superclass/interface hierarchy until a match is found.- Specified by:
getMetaClassin interfaceCpoMetaAdapter- Type Parameters:
T- The bean Type- Parameters:
bean- The java bean whose metaclass is needed- Returns:
- the
CpoClassmetadata forbean's class - Throws:
CpoException- Thrown if there are errors accessing the datasource
-
getCpoClasses
Returns a list of the cpo class objects that the meta adapter is aware of.- Specified by:
getCpoClassesin interfaceCpoMetaAdapter- Returns:
- java.util.List of CpoClass
-
getDataTypeName
Gets the Java class name that the given attribute's native data type maps to.- Specified by:
getDataTypeNamein interfaceCpoMetaAdapter- Parameters:
attribute- the attribute whose data type is being resolved- Returns:
- the fully-qualified Java class name (array types are reported as
byte[]orchar[])
-
getDataTypeJavaClass
Gets the Java class that the given attribute's native data type maps to.- Specified by:
getDataTypeJavaClassin interfaceCpoMetaAdapter- Parameters:
attribute- the attribute whose data type is being resolved- Returns:
- the Java class the attribute's value is represented as
-
getDataTypeInt
Gets the integer identifier for a named native data type.- Specified by:
getDataTypeIntin interfaceCpoMetaAdapter- Parameters:
dataTypeName- the native data type name- Returns:
- the integer identifier registered for
dataTypeName - Throws:
CpoException- if the data type name is not recognized
-
getDataTypeMapEntry
Gets the full data type mapping entry for a given native data type identifier.- Specified by:
getDataTypeMapEntryin interfaceCpoMetaAdapter- Parameters:
dataTypeInt- the integer identifier of the native data type- Returns:
- the
DataTypeMapEntryregistered fordataTypeInt - Throws:
CpoException- if the data type identifier is not recognized
-
getAllowableDataTypes
Gets the names of all native data types this meta adapter knows how to map.- Specified by:
getAllowableDataTypesin interfaceCpoMetaAdapter- Returns:
- the list of allowable native data type names
- Throws:
CpoException- if the data types cannot be retrieved
-