Skip to content

Provided classes

Kei Inoue edited this page Apr 15, 2019 · 11 revisions

Core

PHPJava\Core\Stream\Reader\FileReader

Introduction

FileReader class is provided APIs for reading pre-compiled Java class file.

How to use

For an example as follows:

$javaClass = new JavaClass(
    new FileReader('/path/to/File.class')
);

// or 

$javaClass = new JavaClass(
    new FileReader('/path/to/File')
);

Provided methods

Name

public function __construct(string $file)
Introduction

Initiate a Java Class Reader.

Parameters
Name Type Description
$file string Specify file path which you want emulating Java class file.

Name

public function getBinaryReader(): BinaryReader
Introduction

Return an initiated BinaryReader instance.

Parameters

No parameters.

Name

public function getJavaPathName(): string
Introduction

Get a real Java class file name.

Parameters

No parameters.

Name

public function getFileName(): string
Introduction

Get a real Java class file path.

Parameters

No parameters.

Name

public function __toString(): string
Introduction

Get a real Java class file path.

Parameters

No parameters.


PHPJava\Core\Stream\Reader\InlineReader

Introduction

InlineReader class is provided APIs for reading pre-compiled Java class in inline.

How to use

For an example as follows:

$javaClass = new JavaClass(
    new InlineReader('File.class', pack('N', 0xCAFEBABE))
);

or
 
$javaClass = new JavaClass(
    new InlineReader('/path/to/TheFile.class', file_get_contents('/path/to/away/TheFile.class'))
);

Provided methods

Name

public function __construct(string $fileName, string $code)
Introduction

Initiate a Java Class Reader.

Parameters
Name Type Description
$fileName string Specify virtual file name for Java class.
$code string Specify raw Java class binary.

Name

public function getBinaryReader(): BinaryReader
Introduction

Return an initiated BinaryReader instance.

Parameters

No parameters.

Name

public function getJavaPathName(): string
Introduction

Get a real Java class file name.

Parameters

No parameters.

Name

public function getFileName(): string
Introduction

Get a real Java class file path.

Parameters

No parameters.

Name

public function __toString(): string
Introduction

Get a real Java class file path.

Parameters

No parameters.


PHPJava\Core\JavaClass

Introduction

JavaClass class is provided APIs for reading Java class which implemented PHPJava\Core\Stream\Reader\ReaderInterface.

How to use

For an example as follows:

$javaClass = new JavaClass(
    new FileReader('/path/to/File.class')
);

// or 

$javaClass = new JavaClass(
    new FileReader('/path/to/File')
);

Provided methods

Name

public function __construct(ReaderInterface $reader, array $options = [])
Introduction

Initiate a Java Class.

Parameters
Name Type Description
$reader ReaderInterface Specify reader as such as FileReader or InlineReader
$options array Set JavaClass runtime options.

Name

public function getOptions(): array
Introduction

Return set runtime options on a JavaClass.

Parameters

No parameters.

Name

public function getClassName(bool $shortName = false): string
Introduction

Return running Java's class name.

Parameters
Name Type Description
$shortName bool Specify to return value which fully qualified class name or short name. (NOTE: Fully qualified return value is including $ if it is a inner class)

Name

public function getInnerClasses(): array
Introduction

Return included inner classes in JavaClass.

Parameters

No parameter.

Name

public function getFields(): array
Introduction

Return specified fields in JavaClass.

Parameters

No parameter.

Name

public function getMethods(): array
Introduction

Return specified methods in JavaClass.

Parameters

No parameter.

Name

public function getInvoker(): JavaClassInvoker
Introduction

Return an Invoker which is caller for JavaClass's method.

Parameters

No parameter.

Name

public function appendDebug(mixed $log): void
Introduction

Append one line trace. Maybe, you do not use this method.

Parameters
Name Type Description
$log mixed Specify a log

Name

public function hasParentClass(): bool
Introduction

Check the JavaClass's parent class.

Parameters

No parameter.

Name

public function setParentClass(JavaClass $class): JavaClass
Introduction

Set parent class.

Parameters
Name Type Description
$class JavaClass Specify JavaClass

Name

public function getParentClass(): JavaClass
Introduction

Return parent class.

Parameters

No parameter.

Name

public function getSuperClass()
Introduction

No feature.

Parameters

No feature.

Name

public function debug(): void
Introduction

Output debug trace.

Parameters

No parameter.


PHPJava\Core\JavaArchive

Introduction

JavaArchive class is provided APIs for executing .jar file.

How to use

TBD

Provided methods

TBD

PHPJava\Core\JVM\Parameters\GlobalOptions

Introduction

GlobalOptions class is provided APIs for changing behavior settings to execute PHPJava.

How to use

TBD

Provided methods

TBD


Types

PHPJava\Kernel\Types_Boolean

Introduction

_Boolean class is provided APIs for emulating Java's boolean on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Byte

Introduction

_Byte class is provided APIs for emulating Java's byte on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Char

Introduction

_Char class is provided APIs for emulating Java's char on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Double

Introduction

_Double class is provided APIs for emulating Java's double on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Float

Introduction

_Float class is provided APIs for emulating Java's float on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Int

Introduction

_Int class is provided APIs for emulating Java's int on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Long

Introduction

_Long class is provided APIs for emulating Java's long on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Short

Introduction

_Short class is provided APIs for emulating Java's short on PHPJava.

How to use

TBD

Provided methods

TBD


PHPJava\Kernel\Types_Array\Generator

Introduction

Generator class is provided APIs for generating an array with specified Java's type by PHPJava.

How to use

TBD

Provided methods

TBD


Utilities

PHPJava\Utilities\TypeResolver

Introduction

TypeResolver class is provided APIs for resolving Java's signature, converting types to PHP to Java and vice versa.

How to use

TBD

Provided methods

TBD


PHPJava\Utilities\Formatter

Introduction

Formatter class is provided APIs for formatting method names, parameter names and so on.

How to use

TBD

Provided methods

TBD

Clone this wiki locally