Package ome.util
Class ModelMapper
- java.lang.Object
-
- ome.util.ContextFilter
-
- ome.util.ModelMapper
-
- All Implemented Interfaces:
Filter
public abstract class ModelMapper extends ContextFilter
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlogprotected java.util.Mapmodel2target-
Fields inherited from class ome.util.ContextFilter
_cache, _context
-
-
Constructor Summary
Constructors Constructor Description ModelMapper()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.util.Mapc2c()TODO identity versus null mappingsjava.sql.Timestampevent2timestamp(Event event)java.util.Collectionfilter(java.lang.String fieldId, java.util.Collection source)iterates over the contents of the collection and filters each.java.util.Mapfilter(java.lang.String fieldId, java.util.Map source)filters both the key and value sets of the map.Filterablefilter(java.lang.String fieldId, Filterable source)protected java.lang.ClassfindClass(java.lang.Class source)java.util.CollectionfindCollection(java.util.Collection source)java.lang.ObjectfindCollectionTarget(java.lang.Object current)extension point which subclasses can override to better map the values of collections and maps.java.lang.ObjectfindKeyTarget(java.lang.Object current)extension point which subclasses can override to better map the keys of maps.java.util.MapfindMap(java.util.Map source)java.lang.ObjectfindTarget(java.lang.Object current)known immutables are return unchanged.java.util.Collectionmap(java.util.Collection source)java.util.Mapmap(java.util.Map source)ModelBasedmap(Filterable source)doublenullSafeDouble(java.lang.Double d)floatnullSafeFloat(java.lang.Float f)intnullSafeInt(java.lang.Integer i)longnullSafeLong(java.lang.Long l)static java.lang.StringstackAsString(java.lang.Throwable t)-
Methods inherited from class ome.util.ContextFilter
addSeen, afterFilter, beforeFilter, currentContext, doFilter, doFilter, doFilter, enter, exit, filter, filter, hasntSeen, pop, previousContext, push
-
-
-
-
Method Detail
-
c2c
protected abstract java.util.Map c2c()
TODO identity versus null mappings- Returns:
- a map from
IObjectclassesModelBasedclasses.
-
map
public ModelBased map(Filterable source)
-
map
public java.util.Collection map(java.util.Collection source)
-
map
public java.util.Map map(java.util.Map source)
-
filter
public Filterable filter(java.lang.String fieldId, Filterable source)
- Specified by:
filterin interfaceFilter- Overrides:
filterin classContextFilter
-
filter
public java.util.Collection filter(java.lang.String fieldId, java.util.Collection source)Description copied from class:ContextFilteriterates over the contents of the collection and filters each. Adds itself to the context. This is somewhat dangerous.- Specified by:
filterin interfaceFilter- Overrides:
filterin classContextFilter
-
filter
public java.util.Map filter(java.lang.String fieldId, java.util.Map source)Description copied from class:ContextFilterfilters both the key and value sets of the map. Adds itself to the context. Somewhat dangerous.- Specified by:
filterin interfaceFilter- Overrides:
filterin classContextFilter
-
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)
-
-