Interface JavaTypeSignatureBuilder

All Known Implementing Classes:
DefaultJavaTypeSignatureBuilder, JavaReflectionTypeSignatureBuilder

public interface JavaTypeSignatureBuilder
In addition to the signature formats described below, implementations should provide a way of retrieving method and variable signatures, but they may have different numbers of input arguments depending on the implementation.

Method signatures should be formatted like com.MyThing{name=add,return=void,parameters=[Integer]}, where MyThing is the declaring type, void is the return type, and Integer is a parameter.

Variable signatures should be formatted like com.MyThing{name=MY_FIELD}.

  • Method Details

    • signature

      String signature(@Nullable Object type)
      Parameters:
      type - A type object.
      Returns:
      The type signature. If t is null, the signature is {undefined}.
    • arraySignature

      String arraySignature(Object type)
      Parameters:
      type - An array type.
      Returns:
      Formatted like Integer[].
    • classSignature

      String classSignature(Object type)
      Parameters:
      type - A class type.
      Returns:
      Formatted like java.util.List.
    • genericSignature

      String genericSignature(Object type)
      When generic type variables are cyclic, like U extends Cyclic<? extends U>, represent the cycle with the bound name, like Generic{U extends Cyclic<? extends U>}.

      When the bound is Object (regardless of whether that bound is implicit or explicit in the source code),the type variable is considered invariant and the bound is omitted. So Generic{List<?>} is favored over Generic{List<? extends java.lang.Object>}.

      Parameters:
      type - A generic type.
      Returns:
      Formatted like Generic{U extends java.lang.Comparable} (covariant) or Generic{U super java.lang.Comparable} (contravariant).
    • parameterizedSignature

      String parameterizedSignature(Object type)
      Parameters:
      type - A parameterized type.
      Returns:
      Formatted like java.util.List<java.util.List<Integer>>.
    • primitiveSignature

      String primitiveSignature(Object type)
      Parameters:
      type - A primitive type.
      Returns:
      Formatted like Integer.