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

public final Class ModuleHashesAttribute

extends Attribute
Class Inheritance
Imports
java.util.ArrayList, .List, jdk.internal.org.objectweb.asm.Attribute, .ByteVector, .ClassReader, .ClassWriter, .Label

A ModuleHashes 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
algorithm

The name of the hashing algorithm.

public List<byte[]>
hashes

The hash of the modules in modules.

public List<String>
modules

A list of module names.

Inherited from jdk.internal.org.objectweb.asm.Attribute:
type

Constructor Summary

AccessConstructor and Description
public
ModuleHashesAttribute(final String
the name of the hashing algorithm.
algorithm
,
final List<String>
a list of module names.
modules
,
final List<byte[]>
the hash of the modules in 'modules'. The two lists must have the same size.
hashes
)

Constructs a new ModuleHashesAttribute.

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.
codeAttributeOffset
,
final Label[]
the labels of the method's code, or null if the attribute to be read is not a Code attribute.
labels
)

Overrides jdk.internal.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 jdk.internal.org.objectweb.asm.Attribute.write.

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

Field Detail

algorithmback to summary
public String algorithm

The name of the hashing algorithm.

hashesback to summary
public List<byte[]> hashes

The hash of the modules in modules. The two lists must have the same size.

modulesback to summary
public List<String> modules

A list of module names.

Constructor Detail

ModuleHashesAttributeback to summary
public ModuleHashesAttribute(final String algorithm, final List<String> modules, final List<byte[]> hashes)

Constructs a new ModuleHashesAttribute.

Parameters
algorithm:String

the name of the hashing algorithm.

modules:List<String>

a list of module names.

hashes:List<byte[]>

the hash of the modules in 'modules'. The two lists must have the same size.

ModuleHashesAttributeback to summary
public ModuleHashesAttribute()

Constructs an empty ModuleHashesAttribute. 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 codeAttributeOffset, final Label[] labels)

Overrides jdk.internal.org.objectweb.asm.Attribute.read.

Doc from jdk.internal.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.

codeAttributeOffset: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 jdk.internal.org.objectweb.asm.Attribute.write.

Doc from jdk.internal.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