Class Java

Description

The Java proxy class.

The Java proxy class. Use this class to create a Java instance. Use the Java function to access a Java type. Example which creates an instance:

  1.  $s new Java("java.lang.String""hello");

Located in /JavaProxy.inc (line 752)

java_AbstractJava
   |
   --Java
Method Summary
Java Java ()
void __call (string $method, array $args)
Methods
Constructor Java (line 794)

Create a new instance.

Create a new instance. This constructor can be used to create an instance of a Java class to access its features.
To access constants or procedures within a class, use the java function instead.
To convert a Java object into a PHP value, use the java_values() function.
Example which creates an instance:

  1.  $s new Java("java.lang.String""hello");
Example which accesses the System class:
  1.  $s Java("java.lang.System");
If the option JAVA_PREFER_VALUES is set, Java values are automatically coerced to PHP values. Example which sets the option JAVA_PREFER_VALUES:
  1.  define("JAVA_PREFER_VALUES"true);
  2.  require_once("java/Java.inc");
  3.  ...
  4.  if (java("java.lang.System")->getProperty("foo"false)) ...
Otherwise java_values() must be used to fetch a PHP value from a Java object or Java value. The same example which usually executes 5 times faster:
  1.  require_once("java/Java.inc");
  2.  ...
  3.  if (java_values(java("java.lang.System")->getProperty("foo"false))) ...

Java Java ()
__call (line 901)

Call a method on a Java object

Call a method on a Java object Example:

  1.  $s->substring(110);

void __call (string $method, array $args)
  • string $method: The method name
  • array $args: The argument array

Documentation generated on Mon, 05 Jan 2009 21:10:59 +0100 by phpDocumentor 1.4.2