Methods Summary |
---|
public org.objectweb.asm.AnnotationVisitor | visitAnnotation(java.lang.String desc, boolean visible)
mOutput.write("@%s", desc);
return new AnnotationSourcer(mOutput);
|
public org.objectweb.asm.AnnotationVisitor | visitAnnotationDefault()
// pass
return null;
|
public void | visitAttribute(org.objectweb.asm.Attribute attr)
mOutput.write("%s /* non-standard method attribute */ ", attr.type);
|
public void | visitCode()
writeHeader();
// write the stub itself
mOutput.write("throw new RuntimeException(\"Stub\");");
|
public void | visitEnd()
writeHeader();
mOutput.write("\n}\n");
|
public void | visitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
// pass
|
public void | visitFrame(int type, int local, java.lang.Object[] local2, int stack, java.lang.Object[] stack2)
// pass
|
public void | visitIincInsn(int var, int increment)
// pass
|
public void | visitInsn(int opcode)
// pass
|
public void | visitIntInsn(int opcode, int operand)
// pass
|
public void | visitJumpInsn(int opcode, org.objectweb.asm.Label label)
// pass
|
public void | visitLabel(org.objectweb.asm.Label label)
// pass
|
public void | visitLdcInsn(java.lang.Object cst)
// pass
|
public void | visitLineNumber(int line, org.objectweb.asm.Label start)
// pass
|
public void | visitLocalVariable(java.lang.String name, java.lang.String desc, java.lang.String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)
// pass
|
public void | visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels)
// pass
|
public void | visitMaxs(int maxStack, int maxLocals)
// pass
|
public void | visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
// pass
|
public void | visitMultiANewArrayInsn(java.lang.String desc, int dims)
// pass
|
public org.objectweb.asm.AnnotationVisitor | visitParameterAnnotation(int parameter, java.lang.String desc, boolean visible)
// pass
return null;
|
public void | visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label[] labels)
// pass
|
public void | visitTryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, java.lang.String type)
// pass
|
public void | visitTypeInsn(int opcode, java.lang.String type)
// pass
|
public void | visitVarInsn(int opcode, int var)
// pass
|
private void | writeHeader()
if (!mNeedDeclaration) {
return;
}
AccessSourcer as = new AccessSourcer(mOutput);
as.write(mAccess, AccessSourcer.IS_METHOD);
// preprocess the signature to get the return type and the arguments
SignatureSourcer sigSourcer = null;
if (mSignature != null) {
SignatureReader sigReader = new SignatureReader(mSignature);
sigSourcer = new SignatureSourcer();
sigReader.accept(sigSourcer);
if (sigSourcer.hasFormalsContent()) {
// dump formal template parameter definitions
mOutput.write(" %s", sigSourcer.formalsToString());
}
}
// output return type (constructor have no return type)
if (!mIsConstructor) {
// The signature overrides desc, if present
if (sigSourcer == null || sigSourcer.getReturnType() == null) {
mOutput.write(" %s", Type.getReturnType(mDesc).getClassName());
} else {
mOutput.write(" %s", sigSourcer.getReturnType().toString());
}
}
// output name
mOutput.write(" %s(", mIsConstructor ? mClassName : mName);
// output arguments. The signature overrides desc, if present
if (mSignature == null) {
Type[] types = Type.getArgumentTypes(mDesc);
for(int i = 0; i < types.length; i++) {
if (i > 0) {
mOutput.write(", ");
}
mOutput.write("%s arg%d", types[i].getClassName(), i);
}
} else {
ArrayList<SignatureSourcer> params = sigSourcer.getParameters();
for(int i = 0; i < params.size(); i++) {
if (i > 0) {
mOutput.write(", ");
}
mOutput.write("%s arg%d", params.get(i).toString(), i);
}
}
mOutput.write(")");
// output throwable exceptions
if (mExceptions != null && mExceptions.length > 0) {
mOutput.write(" throws ");
for (int i = 0; i < mExceptions.length; i++) {
if (i > 0) {
mOutput.write(", ");
}
mOutput.write(mExceptions[i].replace('/", '."));
}
}
mOutput.write(" {\n");
mNeedDeclaration = false;
|