Package com.tangosol.io.pof.reflect
Class PofReflectionHelper
- java.lang.Object
-
- com.tangosol.io.pof.reflect.PofReflectionHelper
-
public class PofReflectionHelper extends Object
Collection of helper methods for POF reflection.- Since:
- Coherence 3.5.2
- Author:
- dag 2009.09.14
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPofReflectionHelper.NavigatorAndType
-
Constructor Summary
Constructors Constructor Description PofReflectionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectensureType(Object o, int nType, PofContext ctx)Validate that the supplied object is compatible with the specified type.static ClassgetClass(int nType, PofContext ctx)Determine the class associated with the given type identifier.static PofNavigatorgetPofNavigator(Class clazz, String fieldPath)Obtain thePofNavigatorto use to navigate to the specified field in a class.
-
-
-
Method Detail
-
getClass
public static Class getClass(int nType, PofContext ctx)
Determine the class associated with the given type identifier.- Parameters:
nType- the Pof type identifier; includes Pof intrinsics, Pof compact values, and user typesctx- the PofContext- Returns:
- the class associated with the specified type identifier or null for types with no mapping
- Throws:
IllegalArgumentException- if the specified type is a user type that is unknown to this PofContext
-
ensureType
public static Object ensureType(Object o, int nType, PofContext ctx)
Validate that the supplied object is compatible with the specified type.- Parameters:
o- the objectnType- the Pof type identifier; includes Pof intrinsics, Pof compact values, and user typesctx- the PofContext- Returns:
- the original object
- Throws:
IllegalArgumentException- if the specified type is a user type that is unknown to this PofContext or there is no type mappingClassCastException- if the specified object is not assignable to the specified type
-
getPofNavigator
public static PofNavigator getPofNavigator(Class clazz, String fieldPath)
Obtain thePofNavigatorto use to navigate to the specified field in a class.- Parameters:
clazz- theClasscontaining the field to navigate tofieldPath- the field(s) making up the path to navigate- Returns:
- the
PofNavigatorto navigate to the field path within the specified class
-
-