APIdia Launch Partner
Top Description Fields Constructors Methods
sun.invoke.util

public Class BytecodeDescriptor

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodType, java.util.ArrayList, .List

Utility routines for dealing with bytecode-level signatures.
Author
jrose

Field Summary

Modifier and TypeField and Description
private static final int
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int
nextNonIdentifier(String str, int index, int end)

public static Class<?>
parseClass(String
a field descriptor string
descriptor
,
ClassLoader
the class loader in which to look up the types (null means bootstrap class loader)
loader
)

Parses and validates a field descriptor string in the loader context.

private static void
public static List<Class<?>>
parseMethod(String
a method descriptor string
descriptor
,
ClassLoader
the class loader in which to look up the types (null means bootstrap class loader)
loader
)

Parses and validates a method descriptor string in the loader context.

private static Class<?>
parseSig(String
contains the string to parse
str
,
int[]
cursor for the next token in the string, modified in-place
i
,
int
the limit for parsing
end
,
ClassLoader
the class loader in which to look up the types (null means bootstrap class loader)
loader
)

Parse a single type in a descriptor.

public static String
unparse(Class<?> type)

public static String
public static String
unparseMethod(Class<?> rtype, List<Class<?>> ptypes)

public static String
unparseMethod(Class<?> rtype, Class<?>[] ptypes)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CHECK_OFFSETback to summary
private static final int CHECK_OFFSET
NON_IDENTIFIER_MASKback to summary
private static final long NON_IDENTIFIER_MASK

Constructor Detail

BytecodeDescriptorback to summary
private BytecodeDescriptor()

Method Detail

nextNonIdentifierback to summary
private static int nextNonIdentifier(String str, int index, int end)
parseClassback to summary
public static Class<?> parseClass(String descriptor, ClassLoader loader)

Parses and validates a field descriptor string in the loader context.

Parameters
descriptor:String

a field descriptor string

loader:ClassLoader

the class loader in which to look up the types (null means bootstrap class loader)

Exceptions
IllegalArgumentException:
if the descriptor is invalid
TypeNotPresentException:
if the descriptor is valid, but the class cannot be found by the loader
parseErrorback to summary
private static void parseError(String str, String msg)
parseMethodback to summary
public static List<Class<?>> parseMethod(String descriptor, ClassLoader loader)

Parses and validates a method descriptor string in the loader context.

Parameters
descriptor:String

a method descriptor string

loader:ClassLoader

the class loader in which to look up the types (null means bootstrap class loader)

Exceptions
IllegalArgumentException:
if the descriptor is invalid
TypeNotPresentException:
if a reference type cannot be found by the loader (before the descriptor is found invalid)
parseSigback to summary
private static Class<?> parseSig(String str, int[] i, int end, ClassLoader loader)

Parse a single type in a descriptor. Results can be:

  • A Class for successful parsing
  • null for malformed descriptor format
  • Throwing a TypeNotPresentException for valid class name, but class cannot be found
Parameters
str:String

contains the string to parse

i:int[]

cursor for the next token in the string, modified in-place

end:int

the limit for parsing

loader:ClassLoader

the class loader in which to look up the types (null means bootstrap class loader)

unparseback to summary
public static String unparse(Class<?> type)
unparseback to summary
public static String unparse(Object type)
unparseMethodback to summary
public static String unparseMethod(Class<?> rtype, List<Class<?>> ptypes)
unparseMethodback to summary
public static String unparseMethod(Class<?> rtype, Class<?>[] ptypes)
unparseSigback to summary
private static void unparseSig(Class<?> t, StringBuilder sb)