Package com.fluxtion.generator.util
Interface ClassUtils
public interface ClassUtils
- Author:
- Greg Higgins
-
Field Summary
Fields Modifier and Type Field Description static org.slf4j.Logger
LOGGER
-
Method Summary
Static Methods Modifier and Type Method Description static CbMethodHandle
findBestParentCB(java.lang.Object parent, java.util.Collection<CbMethodHandle> cbs)
finds the CbMethodHandle whose parameter most closely matches the class of the parent in the inheritance tree.static <T> T
getField(java.lang.String name, java.lang.Object instance)
static java.lang.reflect.Field
getReflectField(java.lang.Class clazz, java.lang.String fieldName)
static boolean
isPropertyTransient(java.beans.PropertyDescriptor property, Field field)
static java.lang.String
mapPropertyToJavaSource(java.beans.PropertyDescriptor property, Field field, java.util.List<Field> nodeFields, java.util.Set<java.lang.Class<?>> importList)
static java.lang.String
mapToJavaSource(java.lang.Object primitiveVal, java.util.List<Field> nodeFields, java.util.Set<java.lang.Class<?>> importList)
static boolean
propertySupported(java.beans.PropertyDescriptor property, Field field, java.util.List<Field> nodeFields)
static boolean
typeSupported(java.lang.Class<?> type)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER
-
-
Method Details
-
findBestParentCB
static CbMethodHandle findBestParentCB(java.lang.Object parent, java.util.Collection<CbMethodHandle> cbs)finds the CbMethodHandle whose parameter most closely matches the class of the parent in the inheritance tree. If no match is found a null is returned.- Parameters:
parent
- node to interrogatecbs
- collection of callbacks- Returns:
- The best matched callback handle
-
typeSupported
static boolean typeSupported(java.lang.Class<?> type) -
mapToJavaSource
static java.lang.String mapToJavaSource(java.lang.Object primitiveVal, java.util.List<Field> nodeFields, java.util.Set<java.lang.Class<?>> importList) -
mapPropertyToJavaSource
-
propertySupported
-
isPropertyTransient
static boolean isPropertyTransient(java.beans.PropertyDescriptor property, Field field) throws java.lang.SecurityException- Throws:
java.lang.SecurityException
-
getField
static <T> T getField(java.lang.String name, java.lang.Object instance) -
getReflectField
static java.lang.reflect.Field getReflectField(java.lang.Class clazz, java.lang.String fieldName) throws java.lang.NoSuchFieldException- Throws:
java.lang.NoSuchFieldException
-