Top Description Inners Constructors Methods
nonapi.io.github.classgraph.types

public final Class TypeUtils

extends Object
Class Inheritance
Imports
java.lang.reflect.Modifier

Utilities for parsing Java type descriptors and type signatures.
Author
lukehutch

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
TypeUtils.ModifierType

The origin of the modifier bits.

Constructor Summary

AccessConstructor and Description
private
TypeUtils()

Constructor.

Method Summary

Modifier and TypeMethod and Description
private static void
appendModifierKeyword(final StringBuilder
the buf
buf
,
final String
the modifier keyword
modifierKeyword
)

Append a space if necessary (if not at the beginning of the buffer, and the last character is not already a space), then append a modifier keyword.

public static boolean

Returns:

true if at least one identifier character was parsed.
getIdentifierToken
(final Parser
The parser.
parser
,
final boolean
If true, stop parsing when the first '$' is hit.
stopAtDollarSign
,
final boolean
If true, stop parsing when the first '.' is hit.
stopAtDot
)

Parse a Java identifier, replacing '/' with '.'.

public static void
modifiersToString(final int
The field or method modifiers.
modifiers
,
final TypeUtils.ModifierType
The ModifierType these modifiers apply to.
modifierType
,
final boolean
for methods, true if this is a default method (else ignored).
isDefault
,
final StringBuilder
The buffer to write the result into.
buf
)

Convert modifiers into a string representation, e.g. "public static final".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TypeUtilsback to summary
private TypeUtils()

Constructor.

Method Detail

appendModifierKeywordback to summary
private static void appendModifierKeyword(final StringBuilder buf, final String modifierKeyword)

Append a space if necessary (if not at the beginning of the buffer, and the last character is not already a space), then append a modifier keyword.

Parameters
buf:StringBuilder

the buf

modifierKeyword:String

the modifier keyword

getIdentifierTokenback to summary
public static boolean getIdentifierToken(final Parser parser, final boolean stopAtDollarSign, final boolean stopAtDot)

Parse a Java identifier, replacing '/' with '.'. Appends the identifier to the token buffer in the parser.

Parameters
parser:Parser

The parser.

stopAtDollarSign:boolean

If true, stop parsing when the first '$' is hit.

stopAtDot:boolean

If true, stop parsing when the first '.' is hit.

Returns:boolean

true if at least one identifier character was parsed.

modifiersToStringback to summary
public static void modifiersToString(final int modifiers, final TypeUtils.ModifierType modifierType, final boolean isDefault, final StringBuilder buf)

Convert modifiers into a string representation, e.g. "public static final".

Parameters
modifiers:int

The field or method modifiers.

modifierType:TypeUtils.ModifierType

The ModifierType these modifiers apply to.

isDefault:boolean

for methods, true if this is a default method (else ignored).

buf:StringBuilder

The buffer to write the result into.

nonapi.io.github.classgraph.types back to summary

public final Enum TypeUtils.ModifierType

extends Enum<TypeUtils.ModifierType>
Class Inheritance

The origin of the modifier bits.

Field Summary

Modifier and TypeField and Description
public static final TypeUtils.ModifierType
CLASS

The modifier bits apply to a class.

public static final TypeUtils.ModifierType
FIELD

The modifier bits apply to a field.

public static final TypeUtils.ModifierType
METHOD

The modifier bits apply to a method.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static TypeUtils.ModifierType
public static TypeUtils.ModifierType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLASSback to summary
public static final TypeUtils.ModifierType CLASS

The modifier bits apply to a class.

FIELDback to summary
public static final TypeUtils.ModifierType FIELD

The modifier bits apply to a field.

METHODback to summary
public static final TypeUtils.ModifierType METHOD

The modifier bits apply to a method.

Constructor Detail

ModifierTypeback to summary
private ModifierType()

Method Detail

valueOfback to summary
public static TypeUtils.ModifierType valueOf(String name)
valuesback to summary
public static TypeUtils.ModifierType[] values()