Class TypeUtils
java.lang.Object
nonapi.io.github.classgraph.types.TypeUtils
Utilities for parsing Java type descriptors and type signatures.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The origin of the modifier bits. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
appendModifierKeyword
(StringBuilder buf, 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.static boolean
getIdentifierToken
(Parser parser, boolean stopAtDollarSign) Parse a Java identifier, replacing '/' with '.'.static void
modifiersToString
(int modifiers, TypeUtils.ModifierType modifierType, boolean isDefault, StringBuilder buf) Convert modifiers into a string representation, e.g.
-
Constructor Details
-
TypeUtils
private TypeUtils()Constructor.
-
-
Method Details
-
getIdentifierToken
Parse a Java identifier, replacing '/' with '.'. Appends the identifier to the token buffer in the parser.- Parameters:
parser
- The parser.stopAtDollarSign
- If true, stop parsing when the first '$' is hit.- Returns:
- true if at least one identifier character was parsed.
-
appendModifierKeyword
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
- the bufmodifierKeyword
- the modifier keyword
-
modifiersToString
public static void modifiersToString(int modifiers, TypeUtils.ModifierType modifierType, boolean isDefault, StringBuilder buf) Convert modifiers into a string representation, e.g. "public static final".- Parameters:
modifiers
- The field or method modifiers.modifierType
- TheTypeUtils.ModifierType
these modifiers apply to.isDefault
- for methods, true if this is a default method (else ignored).buf
- The buffer to write the result into.
-