Class Descriptors


  • public class Descriptors
    extends java.lang.Object
    • Constructor Detail

      • Descriptors

        public Descriptors()
    • Method Detail

      • createTypeRef

        private Descriptors.TypeRef createTypeRef​(java.lang.String binaryClassName)
      • getClassSignature

        public ClassSignature getClassSignature​(java.lang.String signature)
      • getMethodSignature

        public MethodSignature getMethodSignature​(java.lang.String signature)
      • getFieldSignature

        public FieldSignature getFieldSignature​(java.lang.String signature)
      • getShortName

        public static java.lang.String getShortName​(java.lang.String fqn)
        Return the short name of a FQN
      • binaryToFQN

        public static java.lang.String binaryToFQN​(java.lang.String binary)
      • binaryClassToFQN

        public static java.lang.String binaryClassToFQN​(java.lang.String path)
      • fqnToBinary

        public static java.lang.String fqnToBinary​(java.lang.String binary)
      • fqnClassToBinary

        public static java.lang.String fqnClassToBinary​(java.lang.String binary)
      • getPackage

        public static java.lang.String getPackage​(java.lang.String binaryNameOrFqn)
      • fqnToPath

        public static java.lang.String fqnToPath​(java.lang.String s)
      • getTypeRefFromPath

        public Descriptors.TypeRef getTypeRefFromPath​(java.lang.String path)
      • pathToFqn

        public static java.lang.String pathToFqn​(java.lang.String path)
      • isBinaryClass

        public static boolean isBinaryClass​(java.lang.String resource)
      • binaryToSimple

        public static java.lang.String binaryToSimple​(java.lang.String resource)
        Java really screwed up in using different names for the binary path and the fqns. This calculates the simple name of a potentially nested class.
        Parameters:
        resource - ( segment '/')+ (name '$')* name '.class'
        Returns:
        the last name
      • isClassName

        public static boolean isClassName​(java.lang.String fqn)
        Heuristic for a class name. We assume a segment with
        Parameters:
        fqn - can be a class name, nested class, or simple name
        Returns:
        true if the last segment starts with an upper case
      • determine

        public static Result<java.lang.String[],​java.lang.String> determine​(java.lang.String fqn)
        Return a 2 element array based on the fqn. The first element is the package name, the second is the class name. Each can be absent, but not both. The class name can be a nested class (will contain a '.' then)
        Parameters:
        fqn - a Java identifier name, either a simple class name, a qualified class name, or a package name
        Returns:
        a Result with 2 element array with [package, class]