com.caucho.quercus.env
Class ObjectExtValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ObjectValue
          extended by com.caucho.quercus.env.ObjectExtValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CopyObjectExtValue, ObjectExtJavaValue

public class ObjectExtValue
extends ObjectValue
implements java.io.Serializable

Represents a PHP object value.

See Also:
Serialized Form

Nested Class Summary
static class ObjectExtValue.Entry
           
static class ObjectExtValue.EntryIterator
           
 class ObjectExtValue.EntrySet
           
static class ObjectExtValue.KeyIterator
           
static class ObjectExtValue.KeyValueIterator
           
static class ObjectExtValue.ValueIterator
           
 
Field Summary
 
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
ObjectExtValue(Env env, java.util.IdentityHashMap<Value,Value> copyMap, ObjectExtValue copy)
           
ObjectExtValue(Env env, ObjectExtValue copy, CopyRoot root)
           
ObjectExtValue(QuercusClass cl)
           
 
Method Summary
 StringValue appendTo(BinaryBuilderValue sb)
          Append to a binary builder.
 StringValue appendTo(LargeStringBuilderValue sb)
          Append to a binary builder.
 StringValue appendTo(StringBuilderValue sb)
          Append to a binary builder.
 StringValue appendTo(UnicodeBuilderValue sb)
          Append to a string builder.
 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)
          calls the function.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4)
          calls the function.
 Value callMethod(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5)
          calls the function.
 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.
 void cleanup(Env env)
           
 Value clone(Env env)
          Clone the object
 Value copy()
          Copy for assignment.
 Value copy(Env env, java.util.IdentityHashMap<Value,Value> map)
          Copy for serialization
 Value copyTree(Env env, CopyRoot root)
          Copy for serialization
 java.util.Set<? extends java.util.Map.Entry<Value,Value>> entrySet()
          Returns a Set of entries.
 AbstractFunction findFunction(java.lang.String methodName)
          Finds the method name.
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getBaseIterator(Env env)
          Returns an iterator for the key => value pairs.
 Value getField(Env env, StringValue name)
          Gets a field value.
 Value getFieldArg(Env env, StringValue name, boolean isTop)
          Returns the value as an argument which may be a reference.
 Value getFieldArgRef(Env env, StringValue name)
          Returns the value as an argument which may be a reference.
protected  Value getFieldExt(Env env, StringValue name)
          Returns fields not explicitly specified by this value.
 Var getFieldVar(Env env, StringValue name)
          Returns the array ref.
 java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator(Env env)
          Returns an iterator for the key => value pairs.
 java.util.Iterator<Value> getKeyIterator(Env env)
          Returns an iterator for the keys.
 Value getObject(Env env)
          Returns the value for the variable, creating an object if the var is unset.
 int getSize()
          Returns the number of entries.
 Value getThisField(Env env, StringValue name)
          Gets a field value.
 Value getThisFieldArg(Env env, StringValue name)
          Returns the value as an argument which may be a reference.
 Value getThisFieldArgRef(Env env, StringValue name)
          Returns the value as an argument which may be a reference.
 Var getThisFieldVar(Env env, StringValue name)
          Returns the array ref.
 java.util.Iterator<Value> getValueIterator(Env env)
          Returns an iterator for the values.
 void initField(StringValue key, Value value, FieldVisibility visibility)
          Adds a new value to the object.
 void initObject(Env env, QuercusClass cls)
           
 boolean isFieldInit()
          Returns true if the object is in a __set() method call.
 boolean issetField(StringValue name)
          Returns true if the field is set
 void jsonEncode(Env env, StringValue sb)
          Encodes the value in JSON.
 void print(Env env)
          Converts to a string.
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)
          Adds a new value.
protected  Value putFieldExt(Env env, StringValue name, Value value)
           
 Value putThisField(Env env, StringValue name, Value value)
          Sets/adds field to this object.
 void serialize(Env env, java.lang.StringBuilder sb, SerializeMap serializeMap)
          Serializes the value.
 void setFieldInit(boolean isInit)
           
protected  void setQuercusClass(QuercusClass cl)
           
 java.util.Set<? extends java.util.Map.Entry<Value,Value>> sortedEntrySet()
          Returns a Set of entries, sorted by key.
 Value toArray()
          Converts to an array.
 java.lang.Object toJavaObject()
          Converts to an object.
 java.lang.String toJavaString()
          Converts to a java String object.
 Value toObject(Env env)
          Converts to an object.
 java.lang.String toString()
           
 StringValue toString(Env env)
          Converts to a string.
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 void unsetArray(Env env, StringValue name, Value index)
          Removes the field array ref.
 void unsetField(StringValue name)
          Removes a value.
 void unsetThisArray(Env env, StringValue name, Value index)
          Removes the field array ref.
 void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 void varExport(java.lang.StringBuilder sb)
          Exports the value.
 
Methods inherited from class com.caucho.quercus.env.ObjectValue
append, call, cmpObject, eq, get, getClassName, getCount, getIncompleteObjectName, getName, getParentClassName, getQuercusClass, getType, isA, isCallable, isIncompleteObject, isObject, isset, put, put, putField, putField, putField, putField, putField, putField, remove, setIncompleteObjectName, toAutoArray, toBoolean, toDouble, toLong, varDumpObject
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, add, addOne, 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, cmp, containsKey, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, current, div, div, end, eql, eqValue, generate, geq, getArg, getArray, getArray, getCallableName, getCalledClass, getCountRecursive, getDirty, getFieldArray, getFieldObject, getHashCode, getKeyArray, getObject, getRef, getResourceType, getThisFieldArray, getThisFieldObject, getValueArray, getValueType, getVar, gt, hasCurrent, hashCode, increment, isA, isArray, isBinary, isBoolean, isDefault, isDouble, isDoubleConvertible, isEmpty, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isResource, isset, 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, printDepth, printJavaChar, printJavaString, printR, put, putField, putObject, putThisField, putVar, reset, rshift, serialize, set, setCharValueAt, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArrayValue, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaURL, toKey, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongMarshalCost, toLongValue, toRef, toRefValue, toShortMarshalCost, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetThisField, valuesToArray, varDump
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectExtValue

public ObjectExtValue(QuercusClass cl)

ObjectExtValue

public ObjectExtValue(Env env,
                      ObjectExtValue copy,
                      CopyRoot root)

ObjectExtValue

public ObjectExtValue(Env env,
                      java.util.IdentityHashMap<Value,Value> copyMap,
                      ObjectExtValue copy)
Method Detail

setQuercusClass

protected void setQuercusClass(QuercusClass cl)
Overrides:
setQuercusClass in class ObjectValue

initObject

public void initObject(Env env,
                       QuercusClass cls)
Overrides:
initObject in class ObjectValue

getSize

public int getSize()
Returns the number of entries.

Overrides:
getSize in class Value

getField

public final Value getField(Env env,
                            StringValue name)
Gets a field value.

Overrides:
getField in class Value

getThisField

public Value getThisField(Env env,
                          StringValue name)
Gets a field value.

Overrides:
getThisField in class Value

getFieldExt

protected Value getFieldExt(Env env,
                            StringValue name)
Returns fields not explicitly specified by this value.


getFieldVar

public Var getFieldVar(Env env,
                       StringValue name)
Returns the array ref.

Overrides:
getFieldVar in class Value

getThisFieldVar

public Var getThisFieldVar(Env env,
                           StringValue name)
Returns the array ref.

Overrides:
getThisFieldVar in class Value

getFieldArg

public Value getFieldArg(Env env,
                         StringValue name,
                         boolean isTop)
Returns the value as an argument which may be a reference.

Overrides:
getFieldArg in class Value

getThisFieldArg

public Value getThisFieldArg(Env env,
                             StringValue name)
Returns the value as an argument which may be a reference.

Overrides:
getThisFieldArg in class Value

getFieldArgRef

public Value getFieldArgRef(Env env,
                            StringValue name)
Returns the value as an argument which may be a reference.

Overrides:
getFieldArgRef in class Value

getThisFieldArgRef

public Value getThisFieldArgRef(Env env,
                                StringValue name)
Returns the value as an argument which may be a reference.

Overrides:
getThisFieldArgRef in class Value

putField

public Value putField(Env env,
                      StringValue name,
                      Value value)
Adds a new value.

Overrides:
putField in class Value

putThisField

public Value putThisField(Env env,
                          StringValue name,
                          Value value)
Sets/adds field to this object.

Overrides:
putThisField in class Value

putFieldExt

protected Value putFieldExt(Env env,
                            StringValue name,
                            Value value)

setFieldInit

public void setFieldInit(boolean isInit)
Overrides:
setFieldInit in class Value

isFieldInit

public boolean isFieldInit()
Returns true if the object is in a __set() method call. Prevents infinite recursion.

Overrides:
isFieldInit in class Value

initField

public void initField(StringValue key,
                      Value value,
                      FieldVisibility visibility)
Adds a new value to the object.

Overrides:
initField in class ObjectValue

unsetField

public void unsetField(StringValue name)
Removes a value.

Overrides:
unsetField in class Value

unsetArray

public void unsetArray(Env env,
                       StringValue name,
                       Value index)
Removes the field array ref.

Overrides:
unsetArray in class Value

unsetThisArray

public void unsetThisArray(Env env,
                           StringValue name,
                           Value index)
Removes the field array ref.

Overrides:
unsetThisArray in class Value

getIterator

public java.util.Iterator<java.util.Map.Entry<Value,Value>> getIterator(Env env)
Returns an iterator for the key => value pairs.

Overrides:
getIterator in class ObjectValue

getBaseIterator

public java.util.Iterator<java.util.Map.Entry<Value,Value>> getBaseIterator(Env env)
Returns an iterator for the key => value pairs.

Overrides:
getBaseIterator in class Value

getKeyIterator

public java.util.Iterator<Value> getKeyIterator(Env env)
Returns an iterator for the keys.

Overrides:
getKeyIterator in class ObjectValue

getValueIterator

public java.util.Iterator<Value> getValueIterator(Env env)
Returns an iterator for the values.

Overrides:
getValueIterator in class ObjectValue

findFunction

public AbstractFunction findFunction(java.lang.String methodName)
Finds the method name.

Overrides:
findFunction in class Value

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)
calls the function.

Overrides:
callMethod in class Value

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value a1,
                        Value a2,
                        Value a3,
                        Value a4)
calls the function.

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)
calls the function.

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

getObject

public Value getObject(Env env)
Returns the value for the variable, creating an object if the var is unset.

Overrides:
getObject in class Value

copy

public Value copy()
Copy for assignment.

Overrides:
copy in class Value

copy

public Value copy(Env env,
                  java.util.IdentityHashMap<Value,Value> map)
Copy for serialization

Overrides:
copy in class Value

copyTree

public Value copyTree(Env env,
                      CopyRoot root)
Copy for serialization

Overrides:
copyTree in class Value

clone

public Value clone(Env env)
Clone the object

Overrides:
clone in class Value

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb,
                      SerializeMap serializeMap)
Description copied from class: Value
Serializes the value.

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

varExport

public void varExport(java.lang.StringBuilder sb)
Exports the value.

Overrides:
varExport in class Value

appendTo

public StringValue appendTo(UnicodeBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(StringBuilderValue sb)
Append to a binary builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(BinaryBuilderValue sb)
Append to a binary builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(LargeStringBuilderValue sb)
Append to a binary builder.

Overrides:
appendTo in class Value

toStringBuilder

public StringValue toStringBuilder(Env env)
Converts to a string builder

Overrides:
toStringBuilder in class Value

toJavaString

public java.lang.String toJavaString()
Converts to a java String object.

Overrides:
toJavaString in class Value

toString

public StringValue toString(Env env)
Converts to a string.

Overrides:
toString in class Value
Parameters:
env -

print

public void print(Env env)
Converts to a string.

Overrides:
print in class Value
Parameters:
env -

toArray

public Value toArray()
Converts to an array.

Overrides:
toArray in class Value

toObject

public Value toObject(Env env)
Converts to an object.

Overrides:
toObject in class Value

toJavaObject

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

Overrides:
toJavaObject 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

sortedEntrySet

public java.util.Set<? extends java.util.Map.Entry<Value,Value>> sortedEntrySet()
Returns a Set of entries, sorted by key.


varDumpImpl

public 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

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

jsonEncode

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

Overrides:
jsonEncode in class ObjectValue

cleanup

public void cleanup(Env env)

issetField

public boolean issetField(StringValue name)
Description copied from class: Value
Returns true if the field is set

Overrides:
issetField in class Value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object