Home Reference Source
import {ClassInfo} from 'jvm/lib/core/jvm/ClassInfo.js'
public class | source

ClassInfo

Extends:

MemberInfo → ClassInfo

A wrapper for the JVM Class File format with helper methods for adding and removing members from it.

Constructor Summary

Public Constructor
public

constructor(flags: Number, version: {major: Number, minor: Number}, name: string, superName: string, pool: ConstantPool)

Member Summary

Public Members
public get

Array of FieldInfo objects in the underlying JVM Class File.

public get

Array of interfaces represented as strings in the FQCN format that this class implements.

public get

The major version of the target Java SE platform this was compiled for.

public get

Array of MethodInfo objects in the underlying JVM Class File.

public get

The minor version of the target Java SE platform this was compiled for.

public get

ConstantPool of the underlying JVM Class File.

public get

The name of the super class for this JVM Class File.

Private Members
private

_fields: *[]

private
private

_methods: *[]

private

_pool: *

private
private

Method Summary

Public Methods
public

Adds a field to this instance's JVM Class File representation.

public

Adds a field to this instance's JVM Class File representation.

public

Adds a method to this instance's JVM Class File representation.

public

Helper method for casting this instance into a JSON string.

public

Serialized version of this class without circular references.

Inherited Summary

From class MemberInfo
public get

Access flags bit string

public get

Collection of {@link AttributeInfo>} objects belonging to this entry.

public get

name: string: *

The name of this entry in the JVM Class File.

private
private

_flags: *

private

_name: *

public

Adds the specified attribute to this entry's collection of attributes.

public

Finds the first attribute for a given name.

public

Finds all attributes that exactly match the specified name.

public

Checks to see if an access flag bit has been set.

public

Serialized version of this class without circular references.

Public Constructors

public constructor(flags: Number, version: {major: Number, minor: Number}, name: string, superName: string, pool: ConstantPool) source

Override:

MemberInfo#constructor

Params:

NameTypeAttributeDescription
flags Number

access flags bit string

version {major: Number, minor: Number}

Java SE compilation target versions

name string

name of the class file

superName string

Super class name

pool ConstantPool

ConstantPool reference for this class

Public Members

public get fields: Array<FieldInfo>: * source

Array of FieldInfo objects in the underlying JVM Class File.

Return:

Array<FieldInfo>

public get interfaces: Array<string>: * source

Array of interfaces represented as strings in the FQCN format that this class implements.

Return:

Array<string>

public get major: Number: * source

The major version of the target Java SE platform this was compiled for.

Return:

Number

public get methods: Array<MethodInfo>: * source

Array of MethodInfo objects in the underlying JVM Class File.

Return:

Array<MethodInfo>

public get minor: Number: * source

The minor version of the target Java SE platform this was compiled for.

Return:

Number

public get pool: ConstantPool: * source

ConstantPool of the underlying JVM Class File.

Return:

ConstantPool

public get superName: string | null: * source

The name of the super class for this JVM Class File.

Return:

string | null

Private Members

private _fields: *[] source

private _interfaces: *[] source

private _methods: *[] source

private _pool: * source

private _superName: * source

private _version: Object source

Public Methods

public addField(field: FieldInfo) source

Adds a field to this instance's JVM Class File representation.

Params:

NameTypeAttributeDescription
field FieldInfo

public addInterface(inter: string) source

Adds a field to this instance's JVM Class File representation.

Params:

NameTypeAttributeDescription
inter string

FQCN of the interface to assign to this class

public addMethod(method: MethodInfo) source

Adds a method to this instance's JVM Class File representation.

Params:

NameTypeAttributeDescription
method MethodInfo

public toJson(): string source

Helper method for casting this instance into a JSON string.

Return:

string

public toObject(): Object source

Serialized version of this class without circular references.

Override:

MemberInfo#toObject

Return:

Object