Class JDOTypeConverterUtils


  • public class JDOTypeConverterUtils
    extends java.lang.Object
    Convenience methods for handling AttributeConverters.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.jdo.AttributeConverter createAttributeConverter​(org.datanucleus.NucleusContext nucCtx, java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls)  
      static java.lang.Class getAttributeTypeForAttributeConverter​(java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls, java.lang.Class attrTypeFallback)
      Convenience method that takes the class of an AttributeConverter class, and returns the attribute type that it is for.
      static java.lang.Class getDatastoreTypeForAttributeConverter​(java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls, java.lang.Class attrType, java.lang.Class dbTypeFallback)
      Convenience method that takes the class of an AttributeConverter class, and returns the datastore type that it is for.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JDOTypeConverterUtils

        public JDOTypeConverterUtils()
    • Method Detail

      • getAttributeTypeForAttributeConverter

        public static java.lang.Class getAttributeTypeForAttributeConverter​(java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls,
                                                                            java.lang.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 class
        attrTypeFallback - The fallback to return if the attribute type is not found
        Returns:
        The attribute type for this converter
      • getDatastoreTypeForAttributeConverter

        public static java.lang.Class getDatastoreTypeForAttributeConverter​(java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls,
                                                                            java.lang.Class attrType,
                                                                            java.lang.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 class
        attrType - Type for the attribute
        dbTypeFallback - 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,
                                                                            java.lang.Class<? extends javax.jdo.AttributeConverter> converterCls)