com.caucho.quercus.marshal
Class Marshal

java.lang.Object
  extended by com.caucho.quercus.marshal.Marshal
Direct Known Subclasses:
ArrayValueMarshal, BigDecimalMarshal, BigIntegerMarshal, BinaryInputMarshal, BinaryOutputMarshal, BinaryValueMarshal, BooleanMarshal, BooleanObjectMarshal, ByteMarshal, ByteObjectMarshal, CalendarMarshal, CallableMarshal, CharacterMarshal, CharacterObjectMarshal, ClassMarshal, DateMarshal, DoubleMarshal, DoubleObjectMarshal, DoubleValueMarshal, EnumMarshal, ExpectMarshal, ExtValueMarshal, FloatMarshal, FloatObjectMarshal, InputStreamMarshal, IntegerMarshal, IntegerObjectMarshal, JavaArrayMarshal, JavaMarshal, LongMarshal, LongObjectMarshal, LongValueMarshal, NullAsFalseMarshal, PathMarshal, ReferenceMarshal, ShortMarshal, ShortObjectMarshal, StringMarshal, StringValueMarshal, UnicodeValueMarshal, URLMarshal, ValueMarshal, VoidMarshal

public abstract class Marshal
extends java.lang.Object

Code for marshaling (PHP to Java) and unmarshaling (Java to PHP) arguments.


Field Summary
static int BINARY_BINARY_VALUE_COST
           
static int BINARY_BYTE_ARRAY_COST
           
static int BINARY_BYTE_OBJECT_ARRAY_COST
           
static int BINARY_CHARACTER_ARRAY_COST
           
static int BINARY_CHARACTER_OBJECT_ARRAY_COST
           
static int BINARY_STRING_COST
           
static int BINARY_STRING_VALUE_COST
           
static int COST_BINARY_TO_BYTE
           
static int COST_BINARY_TO_STRING
           
static int COST_EQUAL
           
static int COST_FROM_NULL
           
static int COST_IDENTICAL
           
static int COST_INCOMPATIBLE
           
static int COST_NUMERIC_LOSSLESS
           
static int COST_NUMERIC_LOSSY
           
static int COST_STRING_TO_BINARY
           
static int COST_STRING_TO_BYTE
           
static int COST_STRING_TO_CHAR
           
static int COST_STRING_TO_CHAR_ARRAY
           
static int COST_TO_BOOLEAN
           
static int COST_TO_BYTE_ARRAY
           
static int COST_TO_CHAR
           
static int COST_TO_CHAR_ARRAY
           
static int COST_TO_JAVA_OBJECT
           
static int COST_TO_STRING
           
static int COST_VALUE
           
static int DOUBLE_CONVERTIBLE_BYTE_COST
           
static int DOUBLE_CONVERTIBLE_BYTE_OBJECT_COST
           
static int DOUBLE_CONVERTIBLE_DOUBLE_COST
           
static int DOUBLE_CONVERTIBLE_DOUBLE_OBJECT_COST
           
static int DOUBLE_CONVERTIBLE_DOUBLE_VALUE_COST
           
static int DOUBLE_CONVERTIBLE_FLOAT_COST
           
static int DOUBLE_CONVERTIBLE_FLOAT_OBJECT_COST
           
static int DOUBLE_CONVERTIBLE_INTEGER_COST
           
static int DOUBLE_CONVERTIBLE_INTEGER_OBJECT_COST
           
static int DOUBLE_CONVERTIBLE_LONG_COST
           
static int DOUBLE_CONVERTIBLE_LONG_OBJECT_COST
           
static int DOUBLE_CONVERTIBLE_LONG_VALUE_COST
           
static int FOUR
           
protected static L10N L
           
static int LONG_CONVERTIBLE_BYTE_COST
           
static int LONG_CONVERTIBLE_BYTE_OBJECT_COST
           
static int LONG_CONVERTIBLE_DOUBLE_COST
           
static int LONG_CONVERTIBLE_DOUBLE_OBJECT_COST
           
static int LONG_CONVERTIBLE_DOUBLE_VALUE_COST
           
static int LONG_CONVERTIBLE_FLOAT_COST
           
static int LONG_CONVERTIBLE_FLOAT_OBJECT_COST
           
static int LONG_CONVERTIBLE_INTEGER_COST
           
static int LONG_CONVERTIBLE_INTEGER_OBJECT_COST
           
static int LONG_CONVERTIBLE_LONG_COST
           
static int LONG_CONVERTIBLE_LONG_OBJECT_COST
           
static int LONG_CONVERTIBLE_LONG_VALUE_COST
           
static int MAX
           
static int ONE
           
static int PHP5_BINARY_VALUE_COST
           
static int PHP5_BYTE_ARRAY_COST
           
static int PHP5_BYTE_OBJECT_ARRAY_COST
           
static int PHP5_CHARACTER_ARRAY_COST
           
static int PHP5_CHARACTER_OBJECT_ARRAY_COST
           
static int PHP5_STRING_COST
           
static int PHP5_STRING_VALUE_COST
           
static int THREE
           
static int TWO
           
static int UNICODE_BINARY_VALUE_COST
           
static int UNICODE_BYTE_ARRAY_COST
           
static int UNICODE_BYTE_OBJECT_ARRAY_COST
           
static int UNICODE_CHARACTER_ARRAY_COST
           
static int UNICODE_CHARACTER_OBJECT_ARRAY_COST
           
static int UNICODE_STRING_COST
           
static int UNICODE_STRING_VALUE_COST
           
static int ZERO
           
 
Constructor Summary
Marshal()
           
 
Method Summary
 java.lang.Class getExpectedClass()
           
 int getMarshalingCost(Expr expr)
           
 int getMarshalingCost(Value value)
           
protected  int getMarshalingCostImpl(Value value)
           
 boolean isBoolean()
          Returns true if the result is a primitive boolean.
 boolean isDouble()
          Returns true if the result is a double.
 boolean isLong()
          Returns true if the result is a long.
 boolean isReadOnly()
          Return true for read-only.
 boolean isReference()
          Return true for a reference
 boolean isString()
          Returns true if the result is a string.
 boolean isValue()
          Return true if is a Value.
abstract  java.lang.Object marshal(Env env, Expr expr, java.lang.Class argClass)
           
 java.lang.Object marshal(Env env, Value value, java.lang.Class argClass)
           
 Value unmarshal(Env env, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

protected static final L10N L

ZERO

public static final int ZERO
See Also:
Constant Field Values

COST_IDENTICAL

public static final int COST_IDENTICAL
See Also:
Constant Field Values

COST_VALUE

public static final int COST_VALUE
See Also:
Constant Field Values

ONE

public static final int ONE
See Also:
Constant Field Values

COST_EQUAL

public static final int COST_EQUAL
See Also:
Constant Field Values

TWO

public static final int TWO
See Also:
Constant Field Values

COST_NUMERIC_LOSSLESS

public static final int COST_NUMERIC_LOSSLESS
See Also:
Constant Field Values

THREE

public static final int THREE
See Also:
Constant Field Values

COST_NUMERIC_LOSSY

public static final int COST_NUMERIC_LOSSY
See Also:
Constant Field Values

COST_FROM_NULL

public static final int COST_FROM_NULL
See Also:
Constant Field Values

COST_STRING_TO_CHAR_ARRAY

public static final int COST_STRING_TO_CHAR_ARRAY
See Also:
Constant Field Values

COST_TO_JAVA_OBJECT

public static final int COST_TO_JAVA_OBJECT
See Also:
Constant Field Values

COST_STRING_TO_CHAR

public static final int COST_STRING_TO_CHAR
See Also:
Constant Field Values

COST_BINARY_TO_BYTE

public static final int COST_BINARY_TO_BYTE
See Also:
Constant Field Values

COST_STRING_TO_BYTE

public static final int COST_STRING_TO_BYTE
See Also:
Constant Field Values

COST_BINARY_TO_STRING

public static final int COST_BINARY_TO_STRING
See Also:
Constant Field Values

COST_STRING_TO_BINARY

public static final int COST_STRING_TO_BINARY
See Also:
Constant Field Values

COST_TO_STRING

public static final int COST_TO_STRING
See Also:
Constant Field Values

COST_TO_CHAR_ARRAY

public static final int COST_TO_CHAR_ARRAY
See Also:
Constant Field Values

COST_TO_CHAR

public static final int COST_TO_CHAR
See Also:
Constant Field Values

COST_TO_BOOLEAN

public static final int COST_TO_BOOLEAN
See Also:
Constant Field Values

COST_TO_BYTE_ARRAY

public static final int COST_TO_BYTE_ARRAY
See Also:
Constant Field Values

FOUR

public static final int FOUR
See Also:
Constant Field Values

COST_INCOMPATIBLE

public static final int COST_INCOMPATIBLE
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values

PHP5_STRING_VALUE_COST

public static final int PHP5_STRING_VALUE_COST
See Also:
Constant Field Values

PHP5_BYTE_ARRAY_COST

public static final int PHP5_BYTE_ARRAY_COST
See Also:
Constant Field Values

PHP5_CHARACTER_ARRAY_COST

public static final int PHP5_CHARACTER_ARRAY_COST
See Also:
Constant Field Values

PHP5_STRING_COST

public static final int PHP5_STRING_COST
See Also:
Constant Field Values

PHP5_BYTE_OBJECT_ARRAY_COST

public static final int PHP5_BYTE_OBJECT_ARRAY_COST
See Also:
Constant Field Values

PHP5_CHARACTER_OBJECT_ARRAY_COST

public static final int PHP5_CHARACTER_OBJECT_ARRAY_COST
See Also:
Constant Field Values

PHP5_BINARY_VALUE_COST

public static final int PHP5_BINARY_VALUE_COST
See Also:
Constant Field Values

UNICODE_STRING_VALUE_COST

public static final int UNICODE_STRING_VALUE_COST
See Also:
Constant Field Values

UNICODE_BINARY_VALUE_COST

public static final int UNICODE_BINARY_VALUE_COST
See Also:
Constant Field Values

UNICODE_CHARACTER_ARRAY_COST

public static final int UNICODE_CHARACTER_ARRAY_COST
See Also:
Constant Field Values

UNICODE_STRING_COST

public static final int UNICODE_STRING_COST
See Also:
Constant Field Values

UNICODE_BYTE_ARRAY_COST

public static final int UNICODE_BYTE_ARRAY_COST
See Also:
Constant Field Values

UNICODE_CHARACTER_OBJECT_ARRAY_COST

public static final int UNICODE_CHARACTER_OBJECT_ARRAY_COST
See Also:
Constant Field Values

UNICODE_BYTE_OBJECT_ARRAY_COST

public static final int UNICODE_BYTE_OBJECT_ARRAY_COST
See Also:
Constant Field Values

BINARY_BINARY_VALUE_COST

public static final int BINARY_BINARY_VALUE_COST
See Also:
Constant Field Values

BINARY_STRING_VALUE_COST

public static final int BINARY_STRING_VALUE_COST
See Also:
Constant Field Values

BINARY_BYTE_ARRAY_COST

public static final int BINARY_BYTE_ARRAY_COST
See Also:
Constant Field Values

BINARY_STRING_COST

public static final int BINARY_STRING_COST
See Also:
Constant Field Values

BINARY_CHARACTER_ARRAY_COST

public static final int BINARY_CHARACTER_ARRAY_COST
See Also:
Constant Field Values

BINARY_BYTE_OBJECT_ARRAY_COST

public static final int BINARY_BYTE_OBJECT_ARRAY_COST
See Also:
Constant Field Values

BINARY_CHARACTER_OBJECT_ARRAY_COST

public static final int BINARY_CHARACTER_OBJECT_ARRAY_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_DOUBLE_VALUE_COST

public static final int DOUBLE_CONVERTIBLE_DOUBLE_VALUE_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_DOUBLE_COST

public static final int DOUBLE_CONVERTIBLE_DOUBLE_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_DOUBLE_OBJECT_COST

public static final int DOUBLE_CONVERTIBLE_DOUBLE_OBJECT_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_FLOAT_COST

public static final int DOUBLE_CONVERTIBLE_FLOAT_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_FLOAT_OBJECT_COST

public static final int DOUBLE_CONVERTIBLE_FLOAT_OBJECT_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_LONG_VALUE_COST

public static final int DOUBLE_CONVERTIBLE_LONG_VALUE_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_LONG_COST

public static final int DOUBLE_CONVERTIBLE_LONG_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_LONG_OBJECT_COST

public static final int DOUBLE_CONVERTIBLE_LONG_OBJECT_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_INTEGER_COST

public static final int DOUBLE_CONVERTIBLE_INTEGER_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_INTEGER_OBJECT_COST

public static final int DOUBLE_CONVERTIBLE_INTEGER_OBJECT_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_BYTE_COST

public static final int DOUBLE_CONVERTIBLE_BYTE_COST
See Also:
Constant Field Values

DOUBLE_CONVERTIBLE_BYTE_OBJECT_COST

public static final int DOUBLE_CONVERTIBLE_BYTE_OBJECT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_DOUBLE_VALUE_COST

public static final int LONG_CONVERTIBLE_DOUBLE_VALUE_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_LONG_VALUE_COST

public static final int LONG_CONVERTIBLE_LONG_VALUE_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_DOUBLE_COST

public static final int LONG_CONVERTIBLE_DOUBLE_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_DOUBLE_OBJECT_COST

public static final int LONG_CONVERTIBLE_DOUBLE_OBJECT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_FLOAT_COST

public static final int LONG_CONVERTIBLE_FLOAT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_FLOAT_OBJECT_COST

public static final int LONG_CONVERTIBLE_FLOAT_OBJECT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_LONG_COST

public static final int LONG_CONVERTIBLE_LONG_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_LONG_OBJECT_COST

public static final int LONG_CONVERTIBLE_LONG_OBJECT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_INTEGER_COST

public static final int LONG_CONVERTIBLE_INTEGER_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_INTEGER_OBJECT_COST

public static final int LONG_CONVERTIBLE_INTEGER_OBJECT_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_BYTE_COST

public static final int LONG_CONVERTIBLE_BYTE_COST
See Also:
Constant Field Values

LONG_CONVERTIBLE_BYTE_OBJECT_COST

public static final int LONG_CONVERTIBLE_BYTE_OBJECT_COST
See Also:
Constant Field Values
Constructor Detail

Marshal

public Marshal()
Method Detail

isBoolean

public boolean isBoolean()
Returns true if the result is a primitive boolean.


isString

public boolean isString()
Returns true if the result is a string.


isLong

public boolean isLong()
Returns true if the result is a long.


isDouble

public boolean isDouble()
Returns true if the result is a double.


isReadOnly

public boolean isReadOnly()
Return true for read-only.


isReference

public boolean isReference()
Return true for a reference


isValue

public boolean isValue()
Return true if is a Value.


marshal

public abstract java.lang.Object marshal(Env env,
                                         Expr expr,
                                         java.lang.Class argClass)

marshal

public java.lang.Object marshal(Env env,
                                Value value,
                                java.lang.Class argClass)

unmarshal

public Value unmarshal(Env env,
                       java.lang.Object value)

getMarshalingCost

public final int getMarshalingCost(Value value)

getMarshalingCostImpl

protected int getMarshalingCostImpl(Value value)

getMarshalingCost

public int getMarshalingCost(Expr expr)

getExpectedClass

public java.lang.Class getExpectedClass()