本文整理汇总了Java中org.eclipse.jdt.internal.core.util.Util.getDeclaringTypeSignature方法的典型用法代码示例。如果您正苦于以下问题:Java Util.getDeclaringTypeSignature方法的具体用法?Java Util.getDeclaringTypeSignature怎么用?Java Util.getDeclaringTypeSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.core.util.Util
的用法示例。
在下文中一共展示了Util.getDeclaringTypeSignature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MethodPattern
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
public MethodPattern(
char[] selector,
char[] declaringQualification,
char[] declaringSimpleName,
char[] returnQualification,
char[] returnSimpleName,
String returnSignature,
char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
IMethod method,
int limitTo,
int matchRule) {
this(selector,
declaringQualification,
declaringSimpleName,
returnQualification,
returnSimpleName,
parameterQualifications,
parameterSimpleNames,
method.getDeclaringType(),
limitTo,
matchRule);
// Set flags
try {
this.varargs = (method.getFlags() & Flags.AccVarargs) != 0;
} catch (JavaModelException e) {
// do nothing
}
// Get unique key for parameterized constructors
String genericDeclaringTypeSignature = null;
if (method.isResolved()) {
String key = method.getKey();
BindingKey bindingKey = new BindingKey(key);
if (bindingKey.isParameterizedType()) {
genericDeclaringTypeSignature = Util.getDeclaringTypeSignature(key);
// Store type signature and arguments for declaring type
if (genericDeclaringTypeSignature != null) {
this.typeSignatures = Util.splitTypeLevelsSignature(genericDeclaringTypeSignature);
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures));
}
}
} else {
this.methodParameters = true;
storeTypeSignaturesAndArguments(this.declaringType);
}
// Store type signatures and arguments for return type
if (returnSignature != null) {
this.returnTypeSignatures = Util.splitTypeLevelsSignature(returnSignature);
}
// Store type signatures and arguments for method parameters type
if (parameterSignatures != null) {
int length = parameterSignatures.length;
if (length > 0) {
this.parametersTypeSignatures = new char[length][][];
this.parametersTypeArguments = new char[length][][][];
for (int i=0; i<length; i++) {
this.parametersTypeSignatures[i] = Util.splitTypeLevelsSignature(parameterSignatures[i]);
this.parametersTypeArguments[i] = Util.getAllTypeArguments(this.parametersTypeSignatures[i]);
}
}
}
// Store type signatures and arguments for method
this.methodArguments = extractMethodArguments(method);
if (hasMethodArguments()) this.mustResolve = true;
}
示例2: ConstructorPattern
import org.eclipse.jdt.internal.core.util.Util; //导入方法依赖的package包/类
public ConstructorPattern(
char[] declaringSimpleName,
char[] declaringQualification,
char[][] parameterQualifications,
char[][] parameterSimpleNames,
String[] parameterSignatures,
IMethod method,
int limitTo,
int matchRule) {
this(declaringSimpleName,
declaringQualification,
parameterQualifications,
parameterSimpleNames,
limitTo,
matchRule);
// Set flags
try {
this.varargs = (method.getFlags() & Flags.AccVarargs) != 0;
} catch (JavaModelException e) {
// do nothing
}
// Get unique key for parameterized constructors
String genericDeclaringTypeSignature = null;
if (method.isResolved()) {
String key = method.getKey();
BindingKey bindingKey = new BindingKey(key);
if (bindingKey.isParameterizedType()) {
genericDeclaringTypeSignature = Util.getDeclaringTypeSignature(key);
// Store type signature and arguments for declaring type
if (genericDeclaringTypeSignature != null) {
this.typeSignatures = Util.splitTypeLevelsSignature(genericDeclaringTypeSignature);
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures));
}
}
} else {
this.constructorParameters = true;
storeTypeSignaturesAndArguments(method.getDeclaringType());
}
// store type signatures and arguments for method parameters type
if (parameterSignatures != null) {
int length = parameterSignatures.length;
if (length > 0) {
this.parametersTypeSignatures = new char[length][][];
this.parametersTypeArguments = new char[length][][][];
for (int i=0; i<length; i++) {
this.parametersTypeSignatures[i] = Util.splitTypeLevelsSignature(parameterSignatures[i]);
this.parametersTypeArguments[i] = Util.getAllTypeArguments(this.parametersTypeSignatures[i]);
}
}
}
// Store type signatures and arguments for method
this.constructorArguments = extractMethodArguments(method);
if (hasConstructorArguments()) this.mustResolve = true;
}