本文整理汇总了Java中org.objectweb.asm.signature.SignatureReader.acceptType方法的典型用法代码示例。如果您正苦于以下问题:Java SignatureReader.acceptType方法的具体用法?Java SignatureReader.acceptType怎么用?Java SignatureReader.acceptType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.objectweb.asm.signature.SignatureReader
的用法示例。
在下文中一共展示了SignatureReader.acceptType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitLocalVariable
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
@Override
public void visitLocalVariable(final String name, final String desc,
final String signature, final Label start, final Label end,
final int index) {
buf.setLength(0);
buf.append(tab2).append("LOCALVARIABLE ").append(name).append(' ');
appendDescriptor(FIELD_DESCRIPTOR, desc);
buf.append(' ');
appendLabel(start);
buf.append(' ');
appendLabel(end);
buf.append(' ').append(index).append('\n');
if (signature != null) {
buf.append(tab2);
appendDescriptor(FIELD_SIGNATURE, signature);
TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
SignatureReader r = new SignatureReader(signature);
r.acceptType(sv);
buf.append(tab2).append("// declaration: ")
.append(sv.getDeclaration()).append('\n');
}
text.add(buf.toString());
}
示例2: parseSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
FieldAnalyzeVisitor parseSignature() {
final EntryMessage m = log.traceEntry("fieldSignature={}", fieldSignature);
boolean isStatic = (Opcodes.ACC_STATIC & this.access) > 0;
SignatureReader signatureReader = new SignatureReader(this.fieldSignature);
FieldSignatureVisitor visitor;
if (isStatic) {
visitor = new FieldSignatureVisitor(this.name, new ArrayList<>(4));
} else {
visitor = new FieldSignatureVisitor(this.name, this.classAnalyzeVisitor.classTypeParameters);
}
if (this.typeMap != null) {
visitor.setTypeMap(this.typeMap);
}
this.fieldSignatureVisitor = visitor;
signatureReader.acceptType(fieldSignatureVisitor);
return log.traceExit(m, this);
}
示例3: test
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void test() throws Exception {
if (line.length() > 2) {
String signature = line.substring(2);
SignatureWriter wrt = new SignatureWriter();
SignatureReader rdr = new SignatureReader(signature);
switch (line.charAt(0)) {
case 'C':
case 'M':
rdr.accept(wrt);
break;
case 'T':
rdr.acceptType(wrt);
break;
default:
return;
}
assertEquals(signature, wrt.toString());
}
}
示例4: testSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void testSignature() {
TraceSignatureVisitor d = new TraceSignatureVisitor(data.access);
SignatureReader r = new SignatureReader(data.signature);
switch (data.type) {
case 'C':
r.accept(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'F':
r.acceptType(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'M':
r.accept(d);
String fullMethodDeclaration = d.getReturnType()
+ d.getDeclaration()
+ (d.getExceptions() != null ? d.getExceptions() : "");
assertEquals(data.declaration, fullMethodDeclaration);
break;
}
}
示例5: translateSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
private String translateSignature(final String signature, boolean type) {
if (signature == null) {
return null;
}
SignatureReader r = new SignatureReader(signature);
SignatureWriter w = new SignatureWriter() {
public void visitClassType(final String name) {
String n = translator.getClassMirrorTranslation(name);
super.visitClassType(n);
}
};
if (type) {
r.acceptType(w);
} else {
r.accept(w);
}
return w.toString();
}
示例6: testSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void testSignature() {
TraceSignatureVisitor d = new TraceSignatureVisitor(data.access);
SignatureReader r = new SignatureReader(data.signature);
switch (data.type) {
case 'C':
r.accept(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'F':
r.acceptType(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'M':
r.accept(d);
String fullMethodDeclaration = d.getReturnType()
+ d.getDeclaration()
+ (d.getExceptions() != null ? d.getExceptions() : "");
assertEquals(data.declaration, fullMethodDeclaration);
break;
}
}
示例7: checkSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void checkSignature() {
SignatureWriter wrt = new SignatureWriter();
SignatureReader rdr = new SignatureReader(data.signature);
switch (data.type) {
case 'C':
rdr.accept(new CheckSignatureAdapter(
CheckSignatureAdapter.CLASS_SIGNATURE, wrt));
break;
case 'M':
rdr.accept(new CheckSignatureAdapter(
CheckSignatureAdapter.METHOD_SIGNATURE, wrt));
break;
case 'F':
rdr.acceptType(new CheckSignatureAdapter(
CheckSignatureAdapter.TYPE_SIGNATURE, wrt));
break;
default:
return;
}
assertEquals(data.signature, wrt.toString());
}
示例8: testSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void testSignature() {
TraceSignatureVisitor d = new TraceSignatureVisitor(data.access);
SignatureReader r = new SignatureReader(data.signature);
switch (data.type) {
case 'C':
r.accept(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'F':
r.acceptType(d);
assertEquals(data.declaration, d.getDeclaration());
break;
case 'M':
r.accept(d);
String fullMethodDeclaration = d.getReturnType()
+ d.getDeclaration()
+ (d.getExceptions() != null ? d.getExceptions() : "");
assertEquals(data.declaration, fullMethodDeclaration);
break;
}
}
示例9: checkSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void checkSignature() {
SignatureWriter wrt = new SignatureWriter();
SignatureReader rdr = new SignatureReader(data.signature);
switch (data.type) {
case 'C':
rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.CLASS_SIGNATURE,
wrt));
break;
case 'M':
rdr.accept(new CheckSignatureAdapter(CheckSignatureAdapter.METHOD_SIGNATURE,
wrt));
break;
case 'F':
rdr.acceptType(new CheckSignatureAdapter(CheckSignatureAdapter.TYPE_SIGNATURE,
wrt));
break;
default:
return;
}
assertEquals(data.signature, wrt.toString());
}
示例10: mapSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
/**
* @param signature
* signature for mapper
* @param typeSignature
* true if signature is a FieldTypeSignature, such as the
* signature parameter of the ClassVisitor.visitField or
* MethodVisitor.visitLocalVariable methods
* @return signature rewritten as a string
*/
public String mapSignature(String signature, boolean typeSignature) {
if (signature == null) {
return null;
}
SignatureReader r = new SignatureReader(signature);
SignatureWriter w = new SignatureWriter();
SignatureVisitor a = createSignatureRemapper(w);
if (typeSignature) {
r.acceptType(a);
} else {
r.accept(a);
}
return w.toString();
}
示例11: visitField
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
@Override
public FieldVisitor visitField(
int access, String name, String desc, String signature, Object value) {
String target = signature;
if (target == null) {
target = desc;
}
SignatureReader signatureReader = new SignatureReader(target);
this.visitor = new FieldSignatureVisitor(name, new ArrayList<>());
signatureReader.acceptType(this.visitor);
result.put(name, this.visitor.getResult());
return super.visitField(access, name, desc, signature, value);
}
示例12: fieldSignatureReference
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public static String fieldSignatureReference(String signature, String teamPackageName, boolean checkDisallowed) {
if (signature == null) return null;
BattlecodeSignatureWriter writer = new BattlecodeSignatureWriter(teamPackageName, checkDisallowed);
SignatureReader reader = new SignatureReader(signature);
reader.acceptType(writer);
return writer.toString();
}
示例13: mapSignature
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public String mapSignature(String signature, boolean isType, int api) {
if (signature != null) {
SignatureReader reader = new SignatureReader(signature);
final SignatureWriter writer = new SignatureWriter();
SignatureVisitor visitor = new BookSignatureVisitor(api, writer, this);
if (isType) {
reader.acceptType(visitor);
} else {
reader.accept(visitor);
}
return writer.toString();
}
return null;
}
示例14: visitLocalVariable
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
public void visitLocalVariable(
final String name,
final String desc,
final String signature,
final Label start,
final Label end,
final int index)
{
buf.setLength(0);
buf.append(tab2).append("LOCALVARIABLE ").append(name).append(' ');
appendDescriptor(FIELD_DESCRIPTOR, desc);
buf.append(' ');
appendLabel(start);
buf.append(' ');
appendLabel(end);
buf.append(' ').append(index).append('\n');
if (signature != null) {
buf.append(tab2);
appendDescriptor(FIELD_SIGNATURE, signature);
TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
SignatureReader r = new SignatureReader(signature);
r.acceptType(sv);
buf.append(tab2)
.append("// declaration: ")
.append(sv.getDeclaration())
.append('\n');
}
text.add(buf.toString());
if (mv != null) {
mv.visitLocalVariable(name, desc, signature, start, end, index);
}
}
示例15: getType
import org.objectweb.asm.signature.SignatureReader; //导入方法依赖的package包/类
private DataType getType(String desc, String signature) {
if (signature != null) {
SignatureVisitor sv = new SignatureVisitor(0);
SignatureReader r = new SignatureReader(signature);
r.acceptType(sv);
return DataType.getTypeFromObject(sv.getDeclaration());
} else {
return DataType.getTypeFromDesc(desc);
}
}