ClassInfo
Extends:
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 |
interfaces: Array<string>: * 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 |
methods: Array<MethodInfo>: * 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 |
pool: ConstantPool: * 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 |
_interfaces: *[] |
|
private |
_methods: *[] |
|
private |
_pool: * |
|
private |
_superName: * |
|
private |
|
Method Summary
Public Methods | ||
public |
Adds a field to this instance's JVM Class File representation. |
|
public |
addInterface(inter: string) Adds a field to this instance's JVM Class File representation. |
|
public |
addMethod(method: MethodInfo) 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 |
accessFlags: Number: * Access flags bit string |
|
public get |
attributes: Array<AttributeInfo>: * Collection of {@link AttributeInfo>} objects belonging to this entry. |
|
public get |
The name of this entry in the JVM Class File. |
|
private |
_attributes: *[] |
|
private |
_flags: * |
|
private |
_name: * |
|
public |
addAttribute(attr: AttributeInfo) Adds the specified attribute to this entry's collection of attributes. |
|
public |
findAttributeByName(name: string): AttributeInfo | undefined Finds the first attribute for a given name. |
|
public |
findAttributesByName(name: string): Array<AttributeInfo> 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#constructorParams:
Name | Type | Attribute | Description |
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.
public get interfaces: Array<string>: * source
Array of interfaces represented as strings in the FQCN format that this class implements.
public get major: Number: * source
The major version of the target Java SE platform this was compiled for.
public get methods: Array<MethodInfo>: * source
Array of MethodInfo objects in the underlying JVM Class File.
public get minor: Number: * source
The minor version of the target Java SE platform this was compiled for.
Private Members
private _fields: *[] source
private _interfaces: *[] source
private _methods: *[] source
private _pool: * source
private _superName: * source
Public Methods
public addField(field: FieldInfo) source
Adds a field to this instance's JVM Class File representation.
Params:
Name | Type | Attribute | Description |
field | FieldInfo |
public addInterface(inter: string) source
Adds a field to this instance's JVM Class File representation.
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
method | MethodInfo |
public toObject(): Object source
Serialized version of this class without circular references.