java.lang.Object
org.drools.compiler.builder.impl.classbuilder.BuildUtils

public final class BuildUtils extends Object
  • Method Details

    • getInternalTypes

      public static String[] getInternalTypes(String[] superClasses)
    • getGenericTypes

      public static String getGenericTypes(String[] interfaces)
    • 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:
    • arrayType

      public static String arrayType(String type)
    • 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(FieldDefinition fld)
    • isBoxed

      public static boolean isBoxed(String type)
    • unBox

      public static String unBox(String type)
    • box

      public static String box(String type)
    • sizeOf

      public static int sizeOf(String type)
    • isBoolean

      public static boolean isBoolean(String type)
    • getterName

      public static String getterName(String fieldName, String type)
    • setterName

      public static String setterName(String fieldName)
    • extractor

      public static String extractor(String type)
    • injector

      public static String injector(String type)
    • numericMorph

      public static String numericMorph(String type)
    • serializationWriterName

      public static String serializationWriterName(String type)
    • serializationReaderName

      public static String serializationReaderName(String type)
    • serializationType

      public static String serializationType(String type)
    • getDescriptor

      public static String getDescriptor(GenericTypeDefinition typeDef)
    • getSignature

      public static String getSignature(GenericTypeDefinition typeDef)