Class TypeUtils
- java.lang.Object
-
- nonapi.io.github.classgraph.types.TypeUtils
-
public final class TypeUtils extends java.lang.ObjectUtilities for parsing Java type descriptors and type signatures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTypeUtils.ModifierTypeThe origin of the modifier bits.
-
Constructor Summary
Constructors Modifier Constructor Description privateTypeUtils()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidappendModifierKeyword(java.lang.StringBuilder buf, java.lang.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, java.lang.StringBuilder buf)Convert modifiers into a string representation, e.g.
-
-
-
Method Detail
-
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
private static void appendModifierKeyword(java.lang.StringBuilder buf, java.lang.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- the bufmodifierKeyword- the modifier keyword
-
modifiersToString
public static void modifiersToString(int modifiers, TypeUtils.ModifierType modifierType, boolean isDefault, java.lang.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.
-
-