Package org.openrewrite.java.internal
Class JavaReflectionTypeSignatureBuilder
java.lang.Object
org.openrewrite.java.internal.JavaReflectionTypeSignatureBuilder
- All Implemented Interfaces:
JavaTypeSignatureBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionarraySignature(Object type) classSignature(Object type) genericSignature(Object type) When generic type variables are cyclic, likeU extends Cyclic<? extends U>, represent the cycle with the bound name, likeGeneric{U extends Cyclic<? extends U>}.methodSignature(Constructor<?> ctor, String declaringTypeName) methodSignature(Method method, String declaringTypeName) parameterizedSignature(Object type) primitiveSignature(Object type) variableSignature(Field field)
-
Constructor Details
-
JavaReflectionTypeSignatureBuilder
public JavaReflectionTypeSignatureBuilder()
-
-
Method Details
-
signature
- Specified by:
signaturein interfaceJavaTypeSignatureBuilder- Parameters:
t- A type object.- Returns:
- The type signature. If
tis null, the signature is{undefined}.
-
arraySignature
- Specified by:
arraySignaturein interfaceJavaTypeSignatureBuilder- Parameters:
type- An array type.- Returns:
- Formatted like
Integer[].
-
classSignature
- Specified by:
classSignaturein interfaceJavaTypeSignatureBuilder- Parameters:
type- A class type.- Returns:
- Formatted like
java.util.List.
-
genericSignature
Description copied from interface:JavaTypeSignatureBuilderWhen generic type variables are cyclic, likeU extends Cyclic<? extends U>, represent the cycle with the bound name, likeGeneric{U extends Cyclic<? extends U>}. When the bound isObject(regardless of whether that bound is implicit or explicit in the source code),the type variable is considered invariant and the bound is omitted. SoGeneric{List<?>}is favored overGeneric{List<? extends java.lang.Object>}.- Specified by:
genericSignaturein interfaceJavaTypeSignatureBuilder- Parameters:
type- A generic type.- Returns:
- Formatted like
Generic{U extends java.lang.Comparable}(covariant) orGeneric{U super java.lang.Comparable}(contravariant).
-
parameterizedSignature
- Specified by:
parameterizedSignaturein interfaceJavaTypeSignatureBuilder- Parameters:
type- A parameterized type.- Returns:
- Formatted like
java.util.List<java.util.List<Integer>>.
-
primitiveSignature
- Specified by:
primitiveSignaturein interfaceJavaTypeSignatureBuilder- Parameters:
type- A primitive type.- Returns:
- Formatted like
Integer.
-
methodSignature
-
methodSignature
-
variableSignature
-