Class TypeUtils
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.typesignature.TypeUtils
-
public class TypeUtils extends Object
Utilities for parsing Java type descriptors and type signatures.- Author:
- lukehutch
-
-
Field Summary
Fields Modifier and Type Field Description static intMODIFIER_MANDATEDThe modifier bit for mandated parameters.static intMODIFIER_SYNTHETICThe modifier bit for synthetic parameters.
-
Constructor Summary
Constructors Constructor Description TypeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleangetIdentifierToken(Parser parser)Parse a Java identifier part (between separators and other non-alphanumeric characters).static booleangetIdentifierToken(Parser parser, char separator, char separatorReplace)Parse a Java identifier with the given separator ('.' or '/').static StringmodifiersToString(int modifiers, boolean isMethod)Convert modifiers into a string representation, e.g.static voidmodifiersToString(int modifiers, boolean isMethod, StringBuilder buf)Convert modifiers into a string representation, e.g.
-
-
-
Field Detail
-
MODIFIER_SYNTHETIC
public static final int MODIFIER_SYNTHETIC
The modifier bit for synthetic parameters.- See Also:
- Constant Field Values
-
MODIFIER_MANDATED
public static final int MODIFIER_MANDATED
The modifier bit for mandated parameters.- See Also:
- Constant Field Values
-
-
Method Detail
-
modifiersToString
public static String modifiersToString(int modifiers, boolean isMethod)
Convert modifiers into a string representation, e.g. "public static final".- Parameters:
modifiers- The field, method or class modifiers.isMethod- True if this is a method, false if this is a field or class.- Returns:
- The modifiers, as a string.
-
modifiersToString
public static void modifiersToString(int modifiers, boolean isMethod, StringBuilder buf)Convert modifiers into a string representation, e.g. "public static final".- Parameters:
modifiers- The field or method modifiers.isMethod- True if this is a method, false if this is a field or class.buf- The buffer to write the result into.
-
getIdentifierToken
public static boolean getIdentifierToken(Parser parser, char separator, char separatorReplace) throws Parser.ParseException
Parse a Java identifier with the given separator ('.' or '/'). Potentially replaces the separator with a different character. Appends the identifier to the token buffer in the parser.- Throws:
Parser.ParseException
-
getIdentifierToken
public static boolean getIdentifierToken(Parser parser) throws Parser.ParseException
Parse a Java identifier part (between separators and other non-alphanumeric characters). Appends the identifier to the token buffer in the parser.- Throws:
Parser.ParseException
-
-