public final class JdtUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
asDottedString(char[][] name)
Returns a source name from an array of names.
|
static String |
formatBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding) |
static String |
formatMethodSignature(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
Get a readable method description from
methodBinding conforming with JSNI formatting. |
static org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding |
getAnnotationByName(org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations,
String name) |
static org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding |
getAnnotationByName(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] annotationsBindings,
String name) |
static Boolean |
getAnnotationParameterBoolean(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName) |
static boolean |
getAnnotationParameterBoolean(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName,
boolean defaultValue) |
static String |
getAnnotationParameterString(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName) |
static org.eclipse.jdt.internal.compiler.impl.StringConstant[] |
getAnnotationParameterStringConstantArray(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName) |
static org.eclipse.jdt.internal.compiler.lookup.TypeBinding |
getAnnotationParameterTypeBinding(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName) |
static org.eclipse.jdt.internal.compiler.lookup.TypeBinding[] |
getAnnotationParameterTypeBindingArray(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding,
String parameterName) |
static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding |
getBaseTypeBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
int typeId) |
static String |
getBinaryName(String qualifiedPackageName,
String qualifiedSourceName) |
static String |
getBinaryName(org.eclipse.jdt.internal.compiler.lookup.TypeBinding classBinding) |
static org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding |
getBoxedTypeBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType) |
static org.eclipse.jdt.internal.compiler.lookup.MethodBinding |
getBoxingMethodBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType) |
static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding |
getBoxingPrimitiveType(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
int implicitConversion) |
static String |
getClassName(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
Returns the name of the class from reference binding.
|
static String |
getDefiningCompilationUnitType(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
Returns the top type of the compilation unit that defines
binding . |
static String |
getSourceName(String qualifiedPackageName,
String qualifiedSourceName) |
static String |
getSourceName(org.eclipse.jdt.internal.compiler.lookup.TypeBinding classBinding) |
static Iterable<org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding> |
getSuperInterfacesRequiringInitialization(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding type) |
static Set<String> |
getSuppressedWarnings(org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations) |
static org.eclipse.jdt.internal.compiler.lookup.MethodBinding |
getUnboxingMethodBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType) |
static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding |
getUnboxingPrimitiveType(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
int implicitConversion) |
static boolean |
isInnerClass(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding) |
static boolean |
isJso(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding)
Returns
true if typeBinding is JavaScriptObject or
any subtype. |
static boolean |
isJsoSubclass(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding)
Returns
true if typeBinding is a subtype of
JavaScriptObject , but not JavaScriptObject itself. |
static boolean |
isLocalClass(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding) |
static boolean |
isStaticClass(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding) |
static String |
join(char[][] name,
String separator)
Returns a string name from an array of names using
separator . |
static boolean |
needsCastBeforeUnbox(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope,
int implicitConversion) |
static boolean |
requiresBoxing(int implicitConversion) |
static boolean |
requiresUnboxing(int implicitConversion) |
static void |
setClassDispositionFromBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding,
JDeclaredType type) |
static String |
signature(org.eclipse.jdt.internal.compiler.lookup.FieldBinding binding) |
static String |
signature(org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding) |
static String |
signature(org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding) |
public static String asDottedString(char[][] name)
public static String join(char[][] name, String separator)
separator
.public static String getClassName(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
JDT Core (at least 3.11.0.v20150407) returns $Local$
synthetic name for local
classes.
This method aware about local classes and instead of $Local$
synthetic name
returns fully qualified name of the local class in form of anonymous class (e.g.
test.Class1$2
).
public static String getDefiningCompilationUnitType(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
binding
.public static String getSourceName(org.eclipse.jdt.internal.compiler.lookup.TypeBinding classBinding)
public static String getSourceName(String qualifiedPackageName, String qualifiedSourceName)
public static String getBinaryName(org.eclipse.jdt.internal.compiler.lookup.TypeBinding classBinding)
public static String getBinaryName(String qualifiedPackageName, String qualifiedSourceName)
public static boolean isInnerClass(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding binding)
public static String formatMethodSignature(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
methodBinding
conforming with JSNI formatting.
See examples:
public static String formatBinding(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding)
public static String getAnnotationParameterString(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName)
public static boolean getAnnotationParameterBoolean(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName, boolean defaultValue)
public static Boolean getAnnotationParameterBoolean(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName)
public static org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding getAnnotationByName(org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations, String name)
public static org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding getAnnotationByName(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] annotationsBindings, String name)
public static org.eclipse.jdt.internal.compiler.lookup.TypeBinding getAnnotationParameterTypeBinding(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName)
public static org.eclipse.jdt.internal.compiler.lookup.TypeBinding[] getAnnotationParameterTypeBindingArray(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName)
public static org.eclipse.jdt.internal.compiler.impl.StringConstant[] getAnnotationParameterStringConstantArray(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding annotationBinding, String parameterName)
public static Set<String> getSuppressedWarnings(org.eclipse.jdt.internal.compiler.ast.Annotation[] annotations)
public static String signature(org.eclipse.jdt.internal.compiler.lookup.FieldBinding binding)
public static String signature(org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding)
public static String signature(org.eclipse.jdt.internal.compiler.lookup.TypeBinding binding)
public static void setClassDispositionFromBinding(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding, JDeclaredType type)
public static boolean isLocalClass(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding)
public static boolean isStaticClass(org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding)
public static boolean isJso(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding)
true
if typeBinding
is JavaScriptObject
or
any subtype.public static boolean isJsoSubclass(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding)
true
if typeBinding
is a subtype of
JavaScriptObject
, but not JavaScriptObject
itself.public static Iterable<org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding> getSuperInterfacesRequiringInitialization(org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding type)
public static boolean requiresBoxing(int implicitConversion)
public static boolean requiresUnboxing(int implicitConversion)
public static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding getBoxingPrimitiveType(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, int implicitConversion)
public static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding getUnboxingPrimitiveType(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, int implicitConversion)
public static org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding getBaseTypeBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, int typeId)
public static org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding getBoxedTypeBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType)
public static boolean needsCastBeforeUnbox(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, int implicitConversion)
public static org.eclipse.jdt.internal.compiler.lookup.MethodBinding getBoxingMethodBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType)
public static org.eclipse.jdt.internal.compiler.lookup.MethodBinding getUnboxingMethodBinding(org.eclipse.jdt.internal.compiler.lookup.ClassScope scope, org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding primitiveType)
Copyright © 2018. All rights reserved.