Class BuildUtils
- java.lang.Object
-
- org.drools.compiler.builder.impl.classbuilder.BuildUtils
-
public final class BuildUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intarrayDimSize(String type)static StringarrayType(String type)static Stringbox(String type)static intexternalArrayDimSize(String className)static Stringextractor(String type)static ObjectgetDefaultValue(org.drools.core.factmodel.FieldDefinition fld)static StringgetDescriptor(org.kie.internal.definition.GenericTypeDefinition typeDef)static StringgetGenericTypes(String[] interfaces)static StringgetInternalType(String type)Returns the corresponding internal type representation for the given type.static String[]getInternalTypes(String[] superClasses)static StringgetSignature(org.kie.internal.definition.GenericTypeDefinition typeDef)static StringgetterName(String fieldName, String type)static StringgetTypeDescriptor(String type)Returns the corresponding type descriptor for the given type.static Stringinjector(String type)static booleanisArray(String type)Returns true if the provided type is an arrayType Can only be used with internal names, i.e. after [ has been prefixstatic booleanisBoolean(String type)static booleanisBoxed(String type)static booleanisPrimitive(String type)Returns true if the provided type is a primitive typestatic StringnumericMorph(String type)static StringserializationReaderName(String type)static StringserializationType(String type)static StringserializationWriterName(String type)static StringsetterName(String fieldName)static intsizeOf(String type)static StringunBox(String type)
-
-
-
Method Detail
-
getInternalType
public static String getInternalType(String type)
Returns the corresponding internal type representation for the given type. I decided to not use the ASM Type class methods because they require resolving the actual type into a Class instance and at this point, I think it is best to delay type resolution until it is really needed.- Parameters:
type-- Returns:
-
getTypeDescriptor
public static String getTypeDescriptor(String type)
Returns the corresponding type descriptor for the given type. I decided to not use the ASM Type class methods because they require resolving the actual type into a Class instance and at this point, I think it is best to delay type resolution until it is really needed.- Parameters:
type-- Returns:
-
externalArrayDimSize
public static int externalArrayDimSize(String className)
-
arrayDimSize
public static int arrayDimSize(String type)
-
isPrimitive
public static boolean isPrimitive(String type)
Returns true if the provided type is a primitive type- Parameters:
type-- Returns:
-
isArray
public static boolean isArray(String type)
Returns true if the provided type is an arrayType Can only be used with internal names, i.e. after [ has been prefix- Parameters:
type-- Returns:
-
getDefaultValue
public static Object getDefaultValue(org.drools.core.factmodel.FieldDefinition fld)
-
isBoxed
public static boolean isBoxed(String type)
-
sizeOf
public static int sizeOf(String type)
-
isBoolean
public static boolean isBoolean(String type)
-
getDescriptor
public static String getDescriptor(org.kie.internal.definition.GenericTypeDefinition typeDef)
-
getSignature
public static String getSignature(org.kie.internal.definition.GenericTypeDefinition typeDef)
-
-