com.caucho.quercus.env
Class JavaValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ObjectValue
          extended by com.caucho.quercus.env.JavaValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BigDecimalValue, BigIntegerValue, JavaCalendarValue, JavaDateValue, JavaMapValue, JavaResourceValue, JavaURLValue

public class JavaValue
extends ObjectValue
implements java.io.Serializable

Represents a Quercus java value.

See Also:
Serialized Form

Field Summary
protected  Env _env
           
 
Fields inherited from class com.caucho.quercus.env.ObjectValue
_className, _incompleteObjectName, _quercusClass
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
JavaValue(Env env, java.lang.Object object, JavaClassDef def)
           
JavaValue(java.lang.Object object, JavaClassDef def, QuercusClass qClass)
           
 
Method Summary
 Value callMethod(Env env, StringValue methodName, int hash)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value[] args)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value[] args)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
          Evaluates a method.
 Value callMethodRef(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
          Evaluates a method.
 int cmpObject(ObjectValue rValue)
          Compare two objects
 java.util.Set<? extends java.util.Map.Entry<Value,Value>> entrySet()
          Returns a Set of entries.
 java.lang.String getClassName()
          Returns the value's class name.
 Value getField(Env env, StringValue name)
          Returns the field value.
protected  JavaClassDef getJavaClassDef()
           
 java.lang.String getType()
          Returns the type.
 boolean isObject()
          Returns true for an object.
 boolean isResource()
           
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
protected  void printRImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 Value putField(Env env, StringValue name, Value value)
          Sets the field value.
 void serialize(Env env, java.lang.StringBuilder sb, SerializeMap map)
          Serializes the value.
 double toDouble()
          Converts to a double.
static double toDouble(java.lang.String s)
          Converts to a double.
 java.io.InputStream toInputStream()
          Converts to an object.
 java.util.Map toJavaMap(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Object toJavaObject()
          Converts to an object.
 java.lang.Object toJavaObject(Env env, java.lang.Class type)
          Converts to a java object.
 java.lang.Object toJavaObjectNotNull(Env env, java.lang.Class type)
          Converts to a java object.
 Value toKey()
          Converts to a key.
 long toLong()
          Converts to a double.
 java.lang.String toString()
          Converts to a string.
 StringValue toString(Env env)
          Converts to a string.
protected  void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 
Methods inherited from class com.caucho.quercus.env.ObjectValue
append, call, eq, get, getCount, getIncompleteObjectName, getIterator, getKeyIterator, getName, getParentClassName, getQuercusClass, getValueIterator, initField, initObject, isA, isCallable, isIncompleteObject, isset, put, put, putField, putField, putField, putField, putField, putField, remove, setIncompleteObjectName, setQuercusClass, toAutoArray, toBoolean, varDumpObject
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, add, addOne, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eql, eqValue, findFunction, generate, geq, getArg, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getCountRecursive, getDirty, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getKeyArray, getObject, getObject, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueType, getVar, gt, hasCurrent, hashCode, increment, isA, isArray, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isEmpty, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isset, issetField, issetThisField, isString, isUnicode, isVar, key, keyExists, length, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, put, putField, putObject, putThisField, putThisField, putVar, reset, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaObjectMarshalCost, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump, varExport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_env

protected Env _env
Constructor Detail

JavaValue

public JavaValue(Env env,
                 java.lang.Object object,
                 JavaClassDef def)

JavaValue

public JavaValue(java.lang.Object object,
                 JavaClassDef def,
                 QuercusClass qClass)
Method Detail

getJavaClassDef

protected JavaClassDef getJavaClassDef()

getClassName

public java.lang.String getClassName()
Description copied from class: ObjectValue
Returns the value's class name.

Overrides:
getClassName in class ObjectValue

toLong

public long toLong()
Converts to a double.

Overrides:
toLong in class ObjectValue

toDouble

public double toDouble()
Converts to a double.

Overrides:
toDouble in class ObjectValue

toDouble

public static double toDouble(java.lang.String s)
Converts to a double.


toString

public StringValue toString(Env env)
Description copied from class: Value
Converts to a string.

Overrides:
toString in class Value

printRImpl

protected void printRImpl(Env env,
                          WriteStream out,
                          int depth,
                          java.util.IdentityHashMap<Value,java.lang.String> valueSet)
                   throws java.io.IOException
Overrides:
printRImpl in class Value
Throws:
java.io.IOException

varDumpImpl

protected void varDumpImpl(Env env,
                           WriteStream out,
                           int depth,
                           java.util.IdentityHashMap<Value,java.lang.String> valueSet)
                    throws java.io.IOException
Overrides:
varDumpImpl in class Value
Throws:
java.io.IOException

getField

public Value getField(Env env,
                      StringValue name)
Returns the field value.

Overrides:
getField in class Value

putField

public Value putField(Env env,
                      StringValue name,
                      Value value)
Sets the field value.

Overrides:
putField in class Value

entrySet

public java.util.Set<? extends java.util.Map.Entry<Value,Value>> entrySet()
Description copied from class: ObjectValue
Returns a Set of entries.

Specified by:
entrySet in class ObjectValue

toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class Value

cmpObject

public int cmpObject(ObjectValue rValue)
Description copied from class: ObjectValue
Compare two objects

Overrides:
cmpObject in class ObjectValue

isObject

public boolean isObject()
Returns true for an object.

Overrides:
isObject in class ObjectValue

isResource

public boolean isResource()
Overrides:
isResource in class Value

getType

public java.lang.String getType()
Returns the type.

Overrides:
getType in class ObjectValue

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value[] args)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4)
Evaluates a method.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4,
                        Value a5)
Evaluates a method.

Overrides:
callMethod in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value[] args)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4)
Evaluates a method.

Overrides:
callMethodRef in class Value

callMethodRef

public Value callMethodRef(Env env,
                           StringValue methodName,
                           int hash,
                           Value a1,
                           Value a2,
                           Value a3,
                           Value a4,
                           Value a5)
Evaluates a method.

Overrides:
callMethodRef in class Value

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb,
                      SerializeMap map)
Serializes the value.

Overrides:
serialize in class Value
sb - holds result of serialization
map - holds reference indexes

jsonEncode

public void jsonEncode(Env env,
                       StringValue sb)
Encodes the value in JSON.

Overrides:
jsonEncode in class ObjectValue

toString

public java.lang.String toString()
Converts to a string.

Overrides:
toString in class java.lang.Object

toJavaObject

public java.lang.Object toJavaObject()
Converts to an object.

Overrides:
toJavaObject in class Value

toJavaObject

public final java.lang.Object toJavaObject(Env env,
                                           java.lang.Class type)
Converts to a java object.

Overrides:
toJavaObject in class Value

toJavaObjectNotNull

public java.lang.Object toJavaObjectNotNull(Env env,
                                            java.lang.Class type)
Converts to a java object.

Overrides:
toJavaObjectNotNull in class Value

toJavaMap

public java.util.Map toJavaMap(Env env,
                               java.lang.Class type)
Converts to a java object.

Overrides:
toJavaMap in class Value

toInputStream

public java.io.InputStream toInputStream()
Converts to an object.

Overrides:
toInputStream in class Value
Returns:
InputStream