本文整理汇总了Java中org.apache.bcel.classfile.Code.getAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java Code.getAttributes方法的具体用法?Java Code.getAttributes怎么用?Java Code.getAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bcel.classfile.Code
的用法示例。
在下文中一共展示了Code.getAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TypeAnalysis
import org.apache.bcel.classfile.Code; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param method
* TODO
* @param methodGen
* the MethodGen whose CFG we'll be analyzing
* @param cfg
* the control flow graph
* @param dfs
* DepthFirstSearch of the method
* @param typeMerger
* object to merge types
* @param visitor
* a TypeFrameModelingVisitor to use to model the effect of
* instructions
* @param lookupFailureCallback
* lookup failure callback
* @param exceptionSetFactory
* factory for creating ExceptionSet objects
*/
public TypeAnalysis(Method method, MethodGen methodGen, CFG cfg, DepthFirstSearch dfs, TypeMerger typeMerger,
TypeFrameModelingVisitor visitor, RepositoryLookupFailureCallback lookupFailureCallback,
ExceptionSetFactory exceptionSetFactory) {
super(dfs);
this.method = method;
Code code = method.getCode();
if (code == null)
throw new IllegalArgumentException(method.getName() + " has no code");
for (Attribute a : code.getAttributes()) {
if (a instanceof LocalVariableTypeTable)
visitor.setLocalTypeTable((LocalVariableTypeTable) a);
}
this.methodGen = methodGen;
this.cfg = cfg;
this.typeMerger = typeMerger;
this.visitor = visitor;
this.thrownExceptionSetMap = new HashMap<BasicBlock, CachedExceptionSet>();
this.lookupFailureCallback = lookupFailureCallback;
this.exceptionSetFactory = exceptionSetFactory;
this.instanceOfCheckMap = new HashMap<BasicBlock, InstanceOfCheck>();
if (DEBUG) {
System.out.println("\n\nAnalyzing " + methodGen);
}
}
示例2: TypeAnalysis
import org.apache.bcel.classfile.Code; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param method
* TODO
* @param methodGen
* the MethodGen whose CFG we'll be analyzing
* @param cfg
* the control flow graph
* @param dfs
* DepthFirstSearch of the method
* @param typeMerger
* object to merge types
* @param visitor
* a TypeFrameModelingVisitor to use to model the effect of
* instructions
* @param lookupFailureCallback
* lookup failure callback
* @param exceptionSetFactory
* factory for creating ExceptionSet objects
*/
public TypeAnalysis(Method method, MethodGen methodGen, CFG cfg, DepthFirstSearch dfs, TypeMerger typeMerger,
TypeFrameModelingVisitor visitor, RepositoryLookupFailureCallback lookupFailureCallback,
ExceptionSetFactory exceptionSetFactory) {
super(dfs);
this.method = method;
Code code = method.getCode();
if (code == null)
throw new IllegalArgumentException(method.getName() + " has no code");
for (Attribute a : code.getAttributes()) {
if (a instanceof LocalVariableTypeTable)
visitor.setLocalTypeTable((LocalVariableTypeTable) a);
}
this.methodGen = methodGen;
this.cfg = cfg;
this.typeMerger = typeMerger;
this.visitor = visitor;
this.thrownExceptionSetMap = new HashMap<BasicBlock, CachedExceptionSet>();
this.lookupFailureCallback = lookupFailureCallback;
this.exceptionSetFactory = exceptionSetFactory;
this.instanceOfCheckMap = new HashMap<BasicBlock, InstanceOfCheck>();
if (DEBUG) {
System.out.println("\n\nAnalyzing " + methodGen);
}
}
示例3: visitCode
import org.apache.bcel.classfile.Code; //导入方法依赖的package包/类
@Override
public void visitCode(Code obj) {
code = obj;
super.visitCode(obj);
CodeException[] exceptions = obj.getExceptionTable();
for (CodeException exception : exceptions)
exception.accept(this);
Attribute[] attributes = obj.getAttributes();
for (Attribute attribute : attributes)
attribute.accept(this);
visitAfter(obj);
code = null;
}
示例4: getStackMapTable
import org.apache.bcel.classfile.Code; //导入方法依赖的package包/类
static @CheckForNull StackMapTable getStackMapTable(Code code) {
for(Attribute a : code.getAttributes())
if (a instanceof StackMapTable)
return (StackMapTable) a;
return null;
}