mardi 3 mars 2015

ObjectWeb ASM 4.1 Attribute Creation


Vote count:

0




org.objectweb.asm.ClassReader has the following "accept" method. I could not figure out how to create the Attributes. Specifically, I would like to get SourceDebugExtension attribute list. Also, notice the document said "prototypes of the attributes that must be parsed". I am wondering what is prototypes of the attributes. Thanks!



/**
* Makes the given visitor visit the Java class of this {@link ClassReader}.
* This class is the one specified in the constructor (see
* {@link #ClassReader(byte[]) ClassReader}).
*
* @param classVisitor
* the visitor that must visit this class.
* @param attrs
* prototypes of the attributes that must be parsed during the
* visit of the class. Any attribute whose type is not equal to
* the type of one the prototypes will not be parsed: its byte
* array value will be passed unchanged to the ClassWriter.
* <i>This may corrupt it if this value contains references to
* the constant pool, or has syntactic or semantic links with a
* class element that has been transformed by a class adapter
* between the reader and the writer</i>.
* @param flags
* option flags that can be used to modify the default behavior
* of this class. See {@link #SKIP_DEBUG}, {@link #EXPAND_FRAMES}
* , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}.
*/
public void accept(final ClassVisitor classVisitor,
final Attribute[] attrs, final int flags)


asked 31 secs ago

t8ke

33






ObjectWeb ASM 4.1 Attribute Creation

Aucun commentaire:

Enregistrer un commentaire