org.curjent.impl.agent
Class BoxedInfo

java.lang.Object
  extended by org.curjent.impl.agent.BoxedInfo

final class BoxedInfo
extends Object

Information for bytecode generation of primitive boxing and unboxing. This class is used to generate bytecode for converting between primitives, such as boolean, and their boxed objects, such as Boolean.


Field Summary
(package private)  String boxingDescriptor
          The JVM method descriptor for boxing a primitive, such as "(Z)Ljava/lang/Boolean;" for Boolean.valueOf(int).
(package private)  int defaultValueOpcode
          ASM opcode for pushing the default primitive value onto the stack; e.g., ICONST_0 for int.
private static Map<Class<?>,BoxedInfo> map
          Maps the primitive types, such as Boolean.TYPE, to their corresponding BoxedInfo instances.
(package private)  String typeInternal
          Internal JVM name for the boxed type, such as "java/lang/Boolean" for the java.lang.Boolean class.
(package private)  String unboxingDescriptor
          The JVM method descriptor for unboxing a primitive, such as "()Z" for Boolean.booleanValue().
(package private)  String unboxingName
          The method name for unboxing a primitive, such as booleanValue for Boolean.booleanValue().
 
Constructor Summary
private BoxedInfo(String typeInternal, String boxingDescriptor, String unboxingName, String unboxingDescriptor, int defaultValueOpcode)
          Saves the boxed information the given type.
 
Method Summary
(package private) static BoxedInfo get(Class<?> type)
          Returns boxing bytecode generation information for the given primitive type, such as Boolean.TYPE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

private static final Map<Class<?>,BoxedInfo> map
Maps the primitive types, such as Boolean.TYPE, to their corresponding BoxedInfo instances.


typeInternal

final String typeInternal
Internal JVM name for the boxed type, such as "java/lang/Boolean" for the java.lang.Boolean class.


boxingDescriptor

final String boxingDescriptor
The JVM method descriptor for boxing a primitive, such as "(Z)Ljava/lang/Boolean;" for Boolean.valueOf(int).


unboxingName

final String unboxingName
The method name for unboxing a primitive, such as booleanValue for Boolean.booleanValue().


unboxingDescriptor

final String unboxingDescriptor
The JVM method descriptor for unboxing a primitive, such as "()Z" for Boolean.booleanValue().


defaultValueOpcode

final int defaultValueOpcode
ASM opcode for pushing the default primitive value onto the stack; e.g., ICONST_0 for int.

Constructor Detail

BoxedInfo

private BoxedInfo(String typeInternal,
                  String boxingDescriptor,
                  String unboxingName,
                  String unboxingDescriptor,
                  int defaultValueOpcode)
Saves the boxed information the given type.

Method Detail

get

static BoxedInfo get(Class<?> type)
Returns boxing bytecode generation information for the given primitive type, such as Boolean.TYPE. Returns null if the given type is not a class for a primitive type.



Copyright 2009-2011 Tom Landon
Apache License 2.0