Package ome.util

Class ModelMapper

  • All Implemented Interfaces:
    Filter

    public abstract class ModelMapper
    extends ContextFilter
    Since:
    1.0
    • Field Detail

      • log

        protected static final org.slf4j.Logger log
      • model2target

        protected java.util.Map model2target
    • Constructor Detail

      • ModelMapper

        public ModelMapper()
    • Method Detail

      • c2c

        protected abstract java.util.Map c2c()
        TODO identity versus null mappings
        Returns:
        a map from IObject classes ModelBased classes.
      • map

        public java.util.Collection map​(java.util.Collection source)
      • map

        public java.util.Map map​(java.util.Map source)
      • filter

        public java.util.Collection filter​(java.lang.String fieldId,
                                           java.util.Collection source)
        Description copied from class: ContextFilter
        iterates over the contents of the collection and filters each. Adds itself to the context. This is somewhat dangerous.
        Specified by:
        filter in interface Filter
        Overrides:
        filter in class ContextFilter
      • filter

        public java.util.Map filter​(java.lang.String fieldId,
                                    java.util.Map source)
        Description copied from class: ContextFilter
        filters both the key and value sets of the map. Adds itself to the context. Somewhat dangerous.
        Specified by:
        filter in interface Filter
        Overrides:
        filter in class ContextFilter
      • findClass

        protected java.lang.Class findClass​(java.lang.Class source)
      • findKeyTarget

        public java.lang.Object findKeyTarget​(java.lang.Object current)
        extension point which subclasses can override to better map the keys of maps.
      • findCollectionTarget

        public java.lang.Object findCollectionTarget​(java.lang.Object current)
        extension point which subclasses can override to better map the values of collections and maps.
      • findTarget

        public java.lang.Object findTarget​(java.lang.Object current)
        known immutables are return unchanged.
        Parameters:
        current -
        Returns:
        a possibly uninitialized object which will be finalized as the object graph is walked.
      • findCollection

        public java.util.Collection findCollection​(java.util.Collection source)
      • findMap

        public java.util.Map findMap​(java.util.Map source)
      • event2timestamp

        public java.sql.Timestamp event2timestamp​(Event event)
      • nullSafeInt

        public int nullSafeInt​(java.lang.Integer i)
      • nullSafeLong

        public long nullSafeLong​(java.lang.Long l)
      • nullSafeDouble

        public double nullSafeDouble​(java.lang.Double d)
      • nullSafeFloat

        public float nullSafeFloat​(java.lang.Float f)
      • stackAsString

        public static java.lang.String stackAsString​(java.lang.Throwable t)