org.jboss.errai.marshalling.rebind.util
Class MarshallingGenUtil
java.lang.Object
org.jboss.errai.marshalling.rebind.util.MarshallingGenUtil
public class MarshallingGenUtil
- extends Object
- Author:
- Mike Brock , Christian Sadilek
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ARRAY_VAR_PREFIX
public static final String ARRAY_VAR_PREFIX
- See Also:
- Constant Field Values
ERRAI_DOLLARSIGN_REPLACEMENT
public static final String ERRAI_DOLLARSIGN_REPLACEMENT
- See Also:
- Constant Field Values
ERRAI_UNDERSCORE_REPLACEMENT
public static final String ERRAI_UNDERSCORE_REPLACEMENT
- See Also:
- Constant Field Values
MarshallingGenUtil
public MarshallingGenUtil()
getVarName
public static String getVarName(MetaClass clazz)
getVarName
public static String getVarName(Class<?> clazz)
getArrayVarName
public static String getArrayVarName(String clazz)
getVarName
public static String getVarName(String clazz)
findGetterMethod
public static MetaMethod findGetterMethod(MetaClass cls,
String key)
getConcreteCollectionElementType
public static MetaClass getConcreteCollectionElementType(MetaClass toType)
- Returns the element type of the given metaclass under the following conditions:
- toType is a collection type
- toType has a single type parameter
- toType's type parameter is not a wildcard
- toType's type parameter is a non-abstract (concrete) type
- toType's type parameter is not java.lang.Object
- Parameters:
toType
- The type to check for a known concrete collection element type.
- Returns:
- The concrete element type meeting all above-mentioned criteria, or null if one or more
of the criteria fails.
getConcreteElementType
public static MetaClass getConcreteElementType(MetaClass toType)
- Returns the element type of the given metaclass under the following conditions:
- toType has a single type parameter
- toType's type parameter is not a wildcard
- toType's type parameter is a non-abstract (concrete) type
- toType's type parameter is not java.lang.Object
- Parameters:
toType
- The type to check for a known concrete collection element type.
- Returns:
- The concrete element type meeting all above-mentioned criteria, or null if one or more
of the criteria fails.
getConcreteMapKeyType
public static MetaClass getConcreteMapKeyType(MetaClass toType)
- Returns the map key type of the given metaclass under the following conditions:
- toType is a
Map
- toType's key type is not a wildcard
- toType's key type is a non-abstract (concrete) type
- Parameters:
toType
- The type to check for a known concrete map key type.
- Returns:
- The concrete map key type meeting all above-mentioned criteria, or null if one or more
of the criteria fails.
getConcreteMapValueType
public static MetaClass getConcreteMapValueType(MetaClass toType)
- Returns the map value type of the given metaclass under the following conditions:
- toType is a
Map
- toType's value type is not a wildcard
- toType's value type is a non-abstract (concrete) type
- Parameters:
toType
- The type to check for a known concrete map key type.
- Returns:
- The concrete map value type meeting all above-mentioned criteria, or null if one or
more of the criteria fails.
getDefaultArrayMarshallers
public static Collection<MetaClass> getDefaultArrayMarshallers()
isUseStaticMarshallers
public static boolean isUseStaticMarshallers()
isForceStaticMarshallers
public static boolean isForceStaticMarshallers()
ensureMarshallerFieldCreated
public static void ensureMarshallerFieldCreated(ClassStructureBuilder<?> classStructureBuilder,
MetaClass marshallerForType,
MetaClass type,
BlockBuilder<?> initMethod)
ensureMarshallerFieldCreated
public static void ensureMarshallerFieldCreated(ClassStructureBuilder<?> classStructureBuilder,
MetaClass marshallerForType,
MetaClass type,
BlockBuilder<?> initMethod,
Statement marshallerCreationCallback)
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.