public final class ModuleTargetAttribute extends Attribute
| Constructor and Description |
|---|
ModuleTargetAttribute()
Constructs an empty attribute that can be used as prototype to be passed as argument of the method
ClassReader.accept(org.objectweb.asm.ClassVisitor, Attribute[], int). |
ModuleTargetAttribute(String platform)
Constructs an attribute with a platform name.
|
| Modifier and Type | Method and Description |
|---|---|
protected Attribute |
read(ClassReader cr,
int off,
int len,
char[] buf,
int codeOff,
Label[] labels)
Reads a
Attribute.type attribute. |
protected ByteVector |
write(ClassWriter cw,
byte[] code,
int len,
int maxStack,
int maxLocals)
Returns the byte array form of the content of this attribute.
|
getLabels, isCodeAttribute, isUnknownpublic String platform
public ModuleTargetAttribute(String platform)
platform - the platform name on which the module can run.public ModuleTargetAttribute()
ClassReader.accept(org.objectweb.asm.ClassVisitor, Attribute[], int).protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels)
AttributeAttribute.type attribute. This method must return a new Attribute object,
of type Attribute.type, corresponding to the 'length' bytes starting at 'offset', in the given
ClassReader.read in class Attributecr - the class that contains the attribute to be read.off - index of the first byte of the attribute's content in ClassReader.b. The
6 attribute header bytes (attribute_name_index and attribute_length) are not taken into
account here.len - the length of the attribute's content (excluding the 6 attribute header bytes).buf - the buffer to be used to call the ClassReader methods requiring a
'charBuffer' parameter.codeOff - index of the first byte of content of the enclosing Code attribute
in ClassReader.b, or -1 if the attribute to be read is not a code attribute. The 6
attribute header bytes (attribute_name_index and attribute_length) are not taken into
account here.labels - the labels of the method's code, or null if the attribute to be read is
not a code attribute.Attribute object corresponding to the specified bytes.protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals)
Attributewrite in class Attributecw - the class to which this attribute must be added. This parameter can be used
to add the items that corresponds to this attribute to the constant pool of this class.code - the bytecode of the method corresponding to this code attribute, or null
if this attribute is not a code attribute. Corresponds to the 'code' field of the Code
attribute.len - the length of the bytecode of the method corresponding to this code
attribute, or 0 if this attribute is not a code attribute. Corresponds to the 'code_length'
field of the Code attribute.maxStack - the maximum stack size of the method corresponding to this code attribute, or
-1 if this attribute is not a code attribute.maxLocals - the maximum number of local variables of the method corresponding to this code
attribute, or -1 if this attribute is not a code attribute.Copyright © 2018. All rights reserved.