Class TypeUtils

java.lang.Object
nonapi.io.github.classgraph.types.TypeUtils

public final class TypeUtils extends Object
Utilities for parsing Java type descriptors and type signatures.
  • Constructor Details

    • TypeUtils

      private TypeUtils()
      Constructor.
  • Method Details

    • getIdentifierToken

      public static boolean getIdentifierToken(Parser parser, boolean stopAtDollarSign)
      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

      private 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.
      Parameters:
      buf - the buf
      modifierKeyword - 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 - The TypeUtils.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.