Top Description Fields Constructors Methods
org.objectweb.asm.commons

public final Class ModuleTargetAttribute

extends Attribute
Class Inheritance
Imports
org.objectweb.asm.Attribute, .ByteVector, .ClassReader, .ClassWriter, .Label

A ModuleTarget attribute. This attribute is specific to the OpenJDK and may change in the future.
Author
Remi Forax

Field Summary

Modifier and TypeField and Description
public String
platform

The name of the platform on which the module can run.

Inherited from org.objectweb.asm.Attribute:
type

Constructor Summary

AccessConstructor and Description
public
ModuleTargetAttribute(final String
the name of the platform on which the module can run.
platform
)

Constructs a new ModuleTargetAttribute.

public

Method Summary

Modifier and TypeMethod and Description
protected Attribute
read(final ClassReader
the class that contains the attribute to be read.
classReader
,
final int
index of the first byte of the attribute's content in ClassReader. The 6 attribute header bytes (attribute_name_index and attribute_length) are not taken into account here.
offset
,
final int
the length of the attribute's content (excluding the 6 attribute header bytes).
length
,
final char[]
the buffer to be used to call the ClassReader methods requiring a 'charBuffer' parameter.
charBuffer
,
final int
index of the first byte of content of the enclosing Code attribute in ClassReader, 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.
codeOffset
,
final Label[]
the labels of the method's code, or null if the attribute to be read is not a Code attribute.
labels
)

Overrides org.objectweb.asm.Attribute.read.

Reads a type attribute.
protected ByteVector
write(final ClassWriter
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.
classWriter
,
final byte[]
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.
code
,
final int
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.
codeLength
,
final int
the maximum stack size of the method corresponding to this Code attribute, or -1 if this attribute is not a Code attribute.
maxStack
,
final int
the maximum number of local variables of the method corresponding to this code attribute, or -1 if this attribute is not a Code attribute.
maxLocals
)

Overrides org.objectweb.asm.Attribute.write.

Returns the byte array form of the content of this attribute.
Inherited from org.objectweb.asm.Attribute:
getLabelsisCodeAttributeisUnknown

Field Detail

platformback to summary
public String platform

The name of the platform on which the module can run.

Constructor Detail

ModuleTargetAttributeback to summary
public ModuleTargetAttribute(final String platform)

Constructs a new ModuleTargetAttribute.

Parameters
platform:String

the name of the platform on which the module can run.

ModuleTargetAttributeback to summary
public ModuleTargetAttribute()

Constructs an empty ModuleTargetAttribute. This object can be passed as a prototype to the ClassReader#accept(org.objectweb.asm.ClassVisitor, Attribute[], int) method.

Method Detail

readback to summary
protected Attribute read(final ClassReader classReader, final int offset, final int length, final char[] charBuffer, final int codeOffset, final Label[] labels)

Overrides org.objectweb.asm.Attribute.read.

Doc from org.objectweb.asm.Attribute.read.

Reads a type attribute. This method must return a new Attribute object, of type type, corresponding to the 'length' bytes starting at 'offset', in the given ClassReader.

Parameters
classReader:ClassReader

the class that contains the attribute to be read.

offset:int

index of the first byte of the attribute's content in ClassReader. The 6 attribute header bytes (attribute_name_index and attribute_length) are not taken into account here.

length:int

the length of the attribute's content (excluding the 6 attribute header bytes).

charBuffer:char[]

the buffer to be used to call the ClassReader methods requiring a 'charBuffer' parameter.

codeOffset:int

index of the first byte of content of the enclosing Code attribute in ClassReader, 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:Label[]

the labels of the method's code, or null if the attribute to be read is not a Code attribute.

Returns:Attribute

a new Attribute object corresponding to the specified bytes.

Annotations
@Override
writeback to summary
protected ByteVector write(final ClassWriter classWriter, final byte[] code, final int codeLength, final int maxStack, final int maxLocals)

Overrides org.objectweb.asm.Attribute.write.

Doc from org.objectweb.asm.Attribute.write.

Returns the byte array form of the content of this attribute. The 6 header bytes (attribute_name_index and attribute_length) must not be added in the returned ByteVector.

Parameters
classWriter:ClassWriter

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:byte[]

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.

codeLength:int

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:int

the maximum stack size of the method corresponding to this Code attribute, or -1 if this attribute is not a Code attribute.

maxLocals:int

the maximum number of local variables of the method corresponding to this code attribute, or -1 if this attribute is not a Code attribute.

Returns:ByteVector

the byte array form of this attribute.

Annotations
@Override