Class TypeUtils


  • public final class TypeUtils
    extends java.lang.Object
    Utilities for parsing Java type descriptors and type signatures.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TypeUtils.ModifierType
      The origin of the modifier bits.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TypeUtils()
      Constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      static boolean getIdentifierToken​(Parser parser, boolean stopAtDollarSign)
      Parse a Java identifier, replacing '/' with '.'.
      static void modifiersToString​(int modifiers, TypeUtils.ModifierType modifierType, boolean isDefault, java.lang.StringBuilder buf)
      Convert modifiers into a string representation, e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeUtils

        private TypeUtils()
        Constructor.
    • Method Detail

      • 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​(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 buf
        modifierKeyword - 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 - 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.