|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.util.ContextFilter
ome.util.ModelMapper
omero.util.IceMapper
public class IceMapper
Responsible for the mapping of ome.* types to omero.* types and back again.
Not all types are bidirectional, rather only those mappings are needed that
actually appear in the blitz API.
As of Beta3.1, an IceMapper
instance can also be configured to handle
return value mapping, though by default an exception will be thrown if
mapReturnValue(Object)
is called.
Nested Class Summary | |
---|---|
static interface |
IceMapper.ReturnMapping
|
Field Summary | |
---|---|
static IceMapper.ReturnMapping |
FILTERABLE
|
static IceMapper.ReturnMapping |
FILTERABLE_ARRAY
|
static IceMapper.ReturnMapping |
FILTERABLE_COLLECTION
|
static IceMapper.ReturnMapping |
FILTERABLE_PRIMITIVE_MAP
|
static IceMapper.ReturnMapping |
LISTOBJECTARRAY_TO_RTYPESEQSEQ
|
static IceMapper.ReturnMapping |
OBJECT_TO_RTYPE
|
static IceMapper.ReturnMapping |
OBJECTARRAY_TO_RTYPESEQ
|
static IceMapper.ReturnMapping |
PRIMITIVE
|
static IceMapper.ReturnMapping |
PRIMITIVE_FILTERABLE_COLLECTION_MAP
|
static IceMapper.ReturnMapping |
PRIMITIVE_MAP
|
static IceMapper.ReturnMapping |
RTYPEDICT
|
static IceMapper.ReturnMapping |
STRING_TO_RSTRING
|
protected Map |
target2model
|
static IceMapper.ReturnMapping |
UNMAPPED
Specifies a return type which should not be parsed. |
static IceMapper.ReturnMapping |
VOID
|
Fields inherited from class ome.util.ModelMapper |
---|
model2target |
Fields inherited from class ome.util.ContextFilter |
---|
_cache, _context |
Constructor Summary | |
---|---|
IceMapper()
|
|
IceMapper(IceMapper.ReturnMapping mapping)
|
Method Summary | |
---|---|
protected Map |
c2c()
|
boolean |
canMapReturnValue()
True if this instance has a IceMapper.ReturnMapping |
static omero.RTime |
convert(Date date)
|
static omero.sys.EventContext |
convert(EventContext ctx)
|
static ome.parameters.Filter |
convert(omero.sys.Filter f)
|
static ome.parameters.Options |
convert(omero.sys.Options o)
|
ome.parameters.Parameters |
convert(omero.sys.Parameters params)
|
static omero.model.Permissions |
convert(ome.model.internal.Permissions p)
|
static ome.model.internal.Permissions |
convert(omero.model.Permissions p)
|
static PlaneDef |
convert(omero.romio.PlaneDef def)
|
static Principal |
convert(omero.sys.Principal old)
|
static omero.romio.RGBBuffer |
convert(RGBBuffer buffer)
|
static omero.sys.Roles |
convert(Roles roles)
|
static Timestamp |
convert(omero.RTime time)
|
ome.parameters.QueryParameter |
convert(String key,
Object o)
|
static omero.ServerError |
fillServerError(omero.ServerError se,
Throwable t)
|
ome.util.Filterable |
filter(String fieldId,
ome.util.Filterable source)
|
Collection |
findCollection(Collection source)
Overrides the findCollection logic of ModelMapper , since all
Collection s should be List s in Ice. |
Object |
fromRType(omero.RType rt)
Uses the omero.rtypes hierarchy to properly convert any RType to
its internal representation. |
Ice.UserException |
handleException(Throwable t,
OmeroContext ctx)
|
Object |
handleInput(Class<?> p,
Object arg)
|
Object |
handleOutput(Class type,
Object o)
|
protected boolean |
hasntSeen(Object o)
|
boolean |
isImmutable(Object obj)
|
protected static boolean |
isNullablePrimitive(Class<?> p)
|
protected boolean |
isPrimitive(Class<?> p)
|
boolean |
isVoid()
Returns true only if the current mapping is the VOID mapping. |
protected static boolean |
isWrapperArray(Class<?> p)
|
List |
map(ome.util.Filterable[] array)
|
Object |
mapReturnValue(Object value)
Convert the given Object via the set IceMapper.ReturnMapping . |
static Class<? extends ome.model.IObject> |
omeroClass(String className,
boolean strict)
|
Collection |
reverse(Collection source)
Copied from ModelMapper.findCollection(Collection) This could be
unified in that a method findCollection(Collection, Map) was added with
ModelMapper calling findCollection(source,model2target) and
#reverseCollection(Collection) calling
findCollection(source,target2model). |
Collection |
reverse(Collection source,
Class targetType)
Creates a collection assignable to the given type. |
Map |
reverse(Map map)
|
ome.util.Filterable |
reverse(ome.model.ModelBased source)
Copied from ReverseModelMapper#map(ModelBased) |
Object |
reverse(Object source)
|
Object[] |
reverseArray(List list,
Class type)
Supports the separate case of reversing for arrays. |
static String |
stackAsString(Throwable t)
|
void |
store(Object source,
Object target)
|
omero.RType |
toRType(Object o)
|
Methods inherited from class ome.util.ModelMapper |
---|
event2timestamp, filter, filter, findClass, findCollectionTarget, findKeyTarget, findMap, findTarget, map, map, map, nullSafeDouble, nullSafeFloat, nullSafeInt, nullSafeLong |
Methods inherited from class ome.util.ContextFilter |
---|
addSeen, afterFilter, beforeFilter, currentContext, doFilter, doFilter, doFilter, enter, exit, filter, filter, pop, previousContext, push |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final IceMapper.ReturnMapping VOID
public static final IceMapper.ReturnMapping FILTERABLE
public static final IceMapper.ReturnMapping FILTERABLE_ARRAY
public static final IceMapper.ReturnMapping FILTERABLE_COLLECTION
public static final IceMapper.ReturnMapping OBJECTARRAY_TO_RTYPESEQ
public static final IceMapper.ReturnMapping LISTOBJECTARRAY_TO_RTYPESEQSEQ
public static final IceMapper.ReturnMapping OBJECT_TO_RTYPE
public static final IceMapper.ReturnMapping STRING_TO_RSTRING
public static final IceMapper.ReturnMapping UNMAPPED
public static final IceMapper.ReturnMapping PRIMITIVE
public static final IceMapper.ReturnMapping PRIMITIVE_MAP
public static final IceMapper.ReturnMapping FILTERABLE_PRIMITIVE_MAP
public static final IceMapper.ReturnMapping PRIMITIVE_FILTERABLE_COLLECTION_MAP
public static final IceMapper.ReturnMapping RTYPEDICT
protected Map target2model
Constructor Detail |
---|
public IceMapper()
public IceMapper(IceMapper.ReturnMapping mapping)
Method Detail |
---|
public boolean isVoid()
VOID
mapping.
public boolean canMapReturnValue()
IceMapper.ReturnMapping
public Object mapReturnValue(Object value) throws Ice.UserException
IceMapper.ReturnMapping
. Throws a
NullPointException
if no mapping is set.
Ice.UserException
public static omero.ServerError fillServerError(omero.ServerError se, Throwable t)
public static String stackAsString(Throwable t)
public static Class<? extends ome.model.IObject> omeroClass(String className, boolean strict) throws omero.ApiUsageException
omero.ApiUsageException
public omero.RType toRType(Object o) throws omero.ApiUsageException
omero.ApiUsageException
public Object fromRType(omero.RType rt) throws omero.ApiUsageException
RType
to
its internal representation. This requires that the instance properly
implement rtypes.Conversion
otherwise ApiUsageException
will be thrown.
rt
-
omero.ApiUsageException
public static omero.sys.EventContext convert(EventContext ctx)
public static omero.romio.RGBBuffer convert(RGBBuffer buffer)
public static PlaneDef convert(omero.romio.PlaneDef def) throws omero.ApiUsageException
omero.ApiUsageException
public static Principal convert(omero.sys.Principal old)
public static omero.sys.Roles convert(Roles roles)
public static omero.RTime convert(Date date)
public static Timestamp convert(omero.RTime time)
public ome.parameters.Parameters convert(omero.sys.Parameters params) throws omero.ApiUsageException
omero.ApiUsageException
public ome.parameters.QueryParameter convert(String key, Object o) throws omero.ApiUsageException
omero.ApiUsageException
public static ome.parameters.Options convert(omero.sys.Options o)
public static ome.parameters.Filter convert(omero.sys.Filter f)
public Collection findCollection(Collection source)
ModelMapper
, since all
Collection
s should be List
s in Ice.
Originally necessitated by the MapIContainer#findAnnotations(Class, Set, Set, Map)
findCollection
in class ome.util.ModelMapper
public List map(ome.util.Filterable[] array)
public static omero.model.Permissions convert(ome.model.internal.Permissions p)
public static ome.model.internal.Permissions convert(omero.model.Permissions p)
public boolean isImmutable(Object obj)
public Object reverse(Object source) throws omero.ApiUsageException
omero.ApiUsageException
public Collection reverse(Collection source)
ModelMapper.findCollection(Collection)
This could be
unified in that a method findCollection(Collection, Map) was added with
ModelMapper
calling findCollection(source,model2target) and
#reverseCollection(Collection)
calling
findCollection(source,target2model).
reverse
in interface ome.util.ReverseModelMapper
collection
-
public Collection reverse(Collection source, Class targetType)
Set
and List
are supported, and HashSet
s and
ArrayList
s will be returned. The need for this arose from the
decision to have no Set
s in the Ice Java mapping.
source
- targetType
-
ticket:684
public Object[] reverseArray(List list, Class type) throws omero.ServerError
reverse(Collection, Class)
and map(Filterable[])
.
list
- type
-
omero.ServerError
public Map reverse(Map map)
public ome.util.Filterable reverse(ome.model.ModelBased source)
ReverseModelMapper#map(ModelBased)
reverse
in interface ome.util.ReverseModelMapper
source
-
public void store(Object source, Object target)
protected Map c2c()
c2c
in class ome.util.ModelMapper
public ome.util.Filterable filter(String fieldId, ome.util.Filterable source)
filter
in interface ome.util.Filter
filter
in class ome.util.ModelMapper
protected boolean hasntSeen(Object o)
hasntSeen
in class ome.util.ContextFilter
protected boolean isPrimitive(Class<?> p)
protected static boolean isNullablePrimitive(Class<?> p)
protected static boolean isWrapperArray(Class<?> p)
public Object handleInput(Class<?> p, Object arg) throws omero.ServerError
omero.ServerError
public Object handleOutput(Class type, Object o) throws omero.ServerError
omero.ServerError
public Ice.UserException handleException(Throwable t, OmeroContext ctx)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta4.2.1-r8614-Beta4.2-b41
Copyright © 2009 The University of Dundee. All Rights Reserved.