Package com.thoughtworks.paranamer
Class BytecodeReadingParanamer.Type
- java.lang.Object
-
- com.thoughtworks.paranamer.BytecodeReadingParanamer.Type
-
- Enclosing class:
- BytecodeReadingParanamer
private static class BytecodeReadingParanamer.Type extends java.lang.Object
A Java type. This class can be used to make it easier to manipulate type and method descriptors.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ARRAY
The sort of array reference types.private static int
BOOLEAN
The sort of the boolean type.private static BytecodeReadingParanamer.Type
BOOLEAN_TYPE
The boolean type.private char[]
buf
A buffer containing the internal name of this Java type.private static int
BYTE
The sort of the byte type.private static BytecodeReadingParanamer.Type
BYTE_TYPE
The byte type.private static int
CHAR
The sort of the char type.private static BytecodeReadingParanamer.Type
CHAR_TYPE
The char type.private static int
DOUBLE
The sort of the double type.private static BytecodeReadingParanamer.Type
DOUBLE_TYPE
The double type.private static int
FLOAT
The sort of the float type.private static BytecodeReadingParanamer.Type
FLOAT_TYPE
The float type.private static int
INT
The sort of the int type.private static BytecodeReadingParanamer.Type
INT_TYPE
The int type.private int
len
The length of the internal name of this Java type.private static int
LONG
The sort of the long type.private static BytecodeReadingParanamer.Type
LONG_TYPE
The long type.private static int
OBJECT
The sort of object reference type.private int
off
The offset of the internal name of this Java type inbuf
or, for primitive types, the size, descriptor and getOpcode offsets for this type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset for IALOAD or IASTORE, byte 3 the offset for all other instructions).private static int
SHORT
The sort of the short type.private static BytecodeReadingParanamer.Type
SHORT_TYPE
The short type.private int
sort
The sort of this Java type.private static int
VOID
The sort of the void type.private static BytecodeReadingParanamer.Type
VOID_TYPE
The void type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static BytecodeReadingParanamer.Type[]
getArgumentTypes(java.lang.String methodDescriptor)
Returns the Java types corresponding to the argument types of the given method descriptor.private java.lang.String
getClassName()
Returns the name of the class corresponding to this type.private int
getDimensions()
Returns the number of dimensions of this array type.private BytecodeReadingParanamer.Type
getElementType()
Returns the type of the elements of this array type.private static BytecodeReadingParanamer.Type
getType(char[] buf, int off)
Returns the Java type corresponding to the given type descriptor.
-
-
-
Field Detail
-
VOID
private static final int VOID
The sort of the void type.- See Also:
- Constant Field Values
-
BOOLEAN
private static final int BOOLEAN
The sort of the boolean type.- See Also:
- Constant Field Values
-
CHAR
private static final int CHAR
The sort of the char type.- See Also:
- Constant Field Values
-
BYTE
private static final int BYTE
The sort of the byte type.- See Also:
- Constant Field Values
-
SHORT
private static final int SHORT
The sort of the short type.- See Also:
- Constant Field Values
-
INT
private static final int INT
The sort of the int type.- See Also:
- Constant Field Values
-
FLOAT
private static final int FLOAT
The sort of the float type.- See Also:
- Constant Field Values
-
LONG
private static final int LONG
The sort of the long type.- See Also:
- Constant Field Values
-
DOUBLE
private static final int DOUBLE
The sort of the double type.- See Also:
- Constant Field Values
-
ARRAY
private static final int ARRAY
The sort of array reference types.- See Also:
- Constant Field Values
-
OBJECT
private static final int OBJECT
The sort of object reference type.- See Also:
- Constant Field Values
-
VOID_TYPE
private static final BytecodeReadingParanamer.Type VOID_TYPE
The void type.
-
BOOLEAN_TYPE
private static final BytecodeReadingParanamer.Type BOOLEAN_TYPE
The boolean type.
-
CHAR_TYPE
private static final BytecodeReadingParanamer.Type CHAR_TYPE
The char type.
-
BYTE_TYPE
private static final BytecodeReadingParanamer.Type BYTE_TYPE
The byte type.
-
SHORT_TYPE
private static final BytecodeReadingParanamer.Type SHORT_TYPE
The short type.
-
INT_TYPE
private static final BytecodeReadingParanamer.Type INT_TYPE
The int type.
-
FLOAT_TYPE
private static final BytecodeReadingParanamer.Type FLOAT_TYPE
The float type.
-
LONG_TYPE
private static final BytecodeReadingParanamer.Type LONG_TYPE
The long type.
-
DOUBLE_TYPE
private static final BytecodeReadingParanamer.Type DOUBLE_TYPE
The double type.
-
sort
private final int sort
The sort of this Java type.
-
buf
private char[] buf
A buffer containing the internal name of this Java type. This field is only used for reference types.
-
off
private int off
The offset of the internal name of this Java type inbuf
or, for primitive types, the size, descriptor and getOpcode offsets for this type (byte 0 contains the size, byte 1 the descriptor, byte 2 the offset for IALOAD or IASTORE, byte 3 the offset for all other instructions).
-
len
private final int len
The length of the internal name of this Java type.
-
-
Constructor Detail
-
Type
private Type(int sort)
Constructs a primitive type.- Parameters:
sort
- the sort of the primitive type to be constructed.
-
Type
private Type(int sort, char[] buf, int off, int len)
Constructs a reference type.- Parameters:
sort
- the sort of the reference type to be constructed.buf
- a buffer containing the descriptor of the previous type.off
- the offset of this descriptor in the previous buffer.len
- the length of this descriptor.
-
-
Method Detail
-
getArgumentTypes
private static BytecodeReadingParanamer.Type[] getArgumentTypes(java.lang.String methodDescriptor)
Returns the Java types corresponding to the argument types of the given method descriptor.- Parameters:
methodDescriptor
- a method descriptor.- Returns:
- the Java types corresponding to the argument types of the given method descriptor.
-
getType
private static BytecodeReadingParanamer.Type getType(char[] buf, int off)
Returns the Java type corresponding to the given type descriptor.- Parameters:
buf
- a buffer containing a type descriptor.off
- the offset of this descriptor in the previous buffer.- Returns:
- the Java type corresponding to the given type descriptor.
-
getDimensions
private int getDimensions()
Returns the number of dimensions of this array type. This method should only be used for an array type.- Returns:
- the number of dimensions of this array type.
-
getElementType
private BytecodeReadingParanamer.Type getElementType()
Returns the type of the elements of this array type. This method should only be used for an array type.- Returns:
- Returns the type of the elements of this array type.
-
getClassName
private java.lang.String getClassName()
Returns the name of the class corresponding to this type.- Returns:
- the fully qualified name of the class corresponding to this type.
-
-