当前位置: 首页>>代码示例>>Java>>正文


Java SignatureReader.acceptType方法代码示例

本文整理汇总了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());
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:26,代码来源:Textifier.java

示例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);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:19,代码来源:FieldAnalyzeVisitor.java

示例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());
    }
}
 
开发者ID:typetools,项目名称:annotation-tools,代码行数:20,代码来源:SignatureTest.java

示例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;
    }

}
 
开发者ID:typetools,项目名称:annotation-tools,代码行数:24,代码来源:TraceSignatureVisitorTest.java

示例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();
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:20,代码来源:NameTranslatorClassVisitor.java

示例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;
    }
}
 
开发者ID:lrytz,项目名称:asm-legacy-svn-clone,代码行数:23,代码来源:TraceSignatureVisitorUnitTest.java

示例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());
}
 
开发者ID:lrytz,项目名称:asm-legacy-svn-clone,代码行数:22,代码来源:CheckSignatureAdapterUnitTest.java

示例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;
    }
}
 
开发者ID:nxmatic,项目名称:objectweb-asm-4.0,代码行数:23,代码来源:TraceSignatureVisitorUnitTest.java

示例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());
}
 
开发者ID:nxmatic,项目名称:objectweb-asm-4.0,代码行数:22,代码来源:CheckSignatureAdapterUnitTest.java

示例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();
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:24,代码来源:Remapper.java

示例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);
}
 
开发者ID:mopemope,项目名称:meghanada-server,代码行数:14,代码来源:FieldSignatureVisitorTest.java

示例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();
}
 
开发者ID:battlecode,项目名称:battlecode-server-2016,代码行数:8,代码来源:ClassReferenceUtil.java

示例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;
}
 
开发者ID:PaperModLoader,项目名称:Book,代码行数:15,代码来源:Mappings.java

示例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);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:TraceMethodVisitor.java

示例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);
	}
}
 
开发者ID:JozefCeluch,项目名称:thesis-disassembler,代码行数:11,代码来源:FieldBlock.java


注:本文中的org.objectweb.asm.signature.SignatureReader.acceptType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。