APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.jdeprscan

public Class Pretty

extends Object
Class Inheritance
Imports
java.util.regex.Matcher, .Pattern

Utility class for pretty-printing various bits of API syntax.

Field Summary

Modifier and TypeField and Description
pack-priv static final Pattern
DESC_PAT

Pattern for matching a method descriptor.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static String

Returns:

string containing an annotation
depr
(String
the since value
since
,
boolean
the forRemoval value
forRemoval
)

Converts deprecation information into an @Deprecated annotation.

pack-priv static String

Returns:

the result string
desc
(String
the input descriptor
desc
)

Converts a type descriptor to a readable string.

pack-priv static String

Returns:

the result string
desc
(String
a string possibly containing several descriptors
desc
,
int[]
on input, the start position; on return, the position following the just-parsed descriptor
pos_inout
)

Converts one type descriptor to a readable string, starting from position pos_inout[0], and updating it to the location following the descriptor just parsed.

pack-priv static String

Returns:

the readable string
parms
(String
the parameter types
types
)

Converts a series of type descriptors into a comma-separated, readable string.

pack-priv static String

Returns:

the result name
unslashify
(String
the input name
n
)

Converts a slash-$ style name into a dot-separated name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DESC_PATback to summary
pack-priv static final Pattern DESC_PAT

Pattern for matching a method descriptor. Match results can be retrieved from named capture groups as follows: "name(params)return".

Constructor Detail

Prettyback to summary
public Pretty()

Method Detail

deprback to summary
pack-priv static String depr(String since, boolean forRemoval)

Converts deprecation information into an @Deprecated annotation. The output is minimized: an empty since string is omitted, a forRemoval value of false is omitted; and if both are omitted, the trailing parentheses are also omitted.

Parameters
since:String

the since value

forRemoval:boolean

the forRemoval value

Returns:String

string containing an annotation

descback to summary
pack-priv static String desc(String desc)

Converts a type descriptor to a readable string.

Parameters
desc:String

the input descriptor

Returns:String

the result string

descback to summary
pack-priv static String desc(String desc, int[] pos_inout)

Converts one type descriptor to a readable string, starting from position pos_inout[0], and updating it to the location following the descriptor just parsed. A type descriptor mostly corresponds to a FieldType in JVMS 4.3.2. It can be one of a BaseType (a single character denoting a primitive, plus void), an object type ("Lname;"), or an array type (one more more '[' followed by a base or object type).

Parameters
desc:String

a string possibly containing several descriptors

pos_inout:int[]

on input, the start position; on return, the position following the just-parsed descriptor

Returns:String

the result string

parmsback to summary
pack-priv static String parms(String types)

Converts a series of type descriptors into a comma-separated, readable string. This is used for the parameter types of a method descriptor.

Parameters
types:String

the parameter types

Returns:String

the readable string

unslashifyback to summary
pack-priv static String unslashify(String n)

Converts a slash-$ style name into a dot-separated name.

Parameters
n:String

the input name

Returns:String

the result name