Package org.datanucleus.api.jdo
Class JDOTypeConverterUtils
java.lang.Object
org.datanucleus.api.jdo.JDOTypeConverterUtils
Convenience methods for handling AttributeConverters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic javax.jdo.AttributeConverter
createAttributeConverter
(org.datanucleus.NucleusContext nucCtx, Class<? extends javax.jdo.AttributeConverter> converterCls) static Class
getAttributeTypeForAttributeConverter
(Class<? extends javax.jdo.AttributeConverter> converterCls, Class attrTypeFallback) Convenience method that takes the class of an AttributeConverter class, and returns the attribute type that it is for.static Class
getDatastoreTypeForAttributeConverter
(Class<? extends javax.jdo.AttributeConverter> converterCls, Class attrType, Class dbTypeFallback) Convenience method that takes the class of an AttributeConverter class, and returns the datastore type that it is for.
-
Constructor Details
-
JDOTypeConverterUtils
public JDOTypeConverterUtils()
-
-
Method Details
-
getAttributeTypeForAttributeConverter
public static Class getAttributeTypeForAttributeConverter(Class<? extends javax.jdo.AttributeConverter> converterCls, Class attrTypeFallback) Convenience method that takes the class of an AttributeConverter class, and returns the attribute type that it is for.- Parameters:
converterCls
- The converter classattrTypeFallback
- The fallback to return if the attribute type is not found- Returns:
- The attribute type for this converter
-
getDatastoreTypeForAttributeConverter
public static Class getDatastoreTypeForAttributeConverter(Class<? extends javax.jdo.AttributeConverter> converterCls, Class attrType, Class dbTypeFallback) Convenience method that takes the class of an AttributeConverter class, and returns the datastore type that it is for.- Parameters:
converterCls
- The converter classattrType
- Type for the attributedbTypeFallback
- The fallback to return if the datastore type is not found- Returns:
- The datastore type for this converter
-
createAttributeConverter
public static javax.jdo.AttributeConverter createAttributeConverter(org.datanucleus.NucleusContext nucCtx, Class<? extends javax.jdo.AttributeConverter> converterCls)
-