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 enumThe origin of the modifier bits. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidappendModifierKeyword(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 booleangetIdentifierToken(Parser parser, boolean stopAtDollarSign, boolean stopAtDot) Parse a Java identifier, replacing '/' with '.'.static voidmodifiersToString(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
public static boolean getIdentifierToken(Parser parser, boolean stopAtDollarSign, boolean stopAtDot) 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.stopAtDot- 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.ModifierTypethese modifiers apply to.isDefault- for methods, true if this is a default method (else ignored).buf- The buffer to write the result into.
-