com.caucho.quercus.program
Class InterpretedClassDef

java.lang.Object
  extended by com.caucho.quercus.program.ClassDef
      extended by com.caucho.quercus.program.InterpretedClassDef
All Implemented Interfaces:
InstanceInitializer
Direct Known Subclasses:
ProClassDef

public class InterpretedClassDef
extends ClassDef
implements InstanceInitializer

Represents an interpreted PHP class definition.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.caucho.quercus.program.ClassDef
ClassDef.FieldEntry, ClassDef.StaticFieldEntry
 
Field Summary
protected  AbstractFunction _call
           
protected  java.lang.String _comment
           
protected  java.util.HashMap<java.lang.String,Expr> _constMap
           
protected  AbstractFunction _constructor
           
protected  AbstractFunction _destructor
           
protected  java.util.HashMap<StringValue,ClassDef.FieldEntry> _fieldMap
           
protected  java.util.HashMap<java.lang.String,AbstractFunction> _functionMap
           
protected  AbstractFunction _getField
           
protected  boolean _hasNonPublicMethods
           
protected  AbstractFunction _invoke
           
protected  boolean _isAbstract
           
protected  boolean _isFinal
           
protected  boolean _isInterface
           
protected  AbstractFunction _isset
           
protected  int _parseIndex
           
protected  AbstractFunction _setField
           
protected  java.util.HashMap<java.lang.String,ClassDef.StaticFieldEntry> _staticFieldMap
           
protected  AbstractFunction _toString
           
protected  AbstractFunction _unset
           
 
Constructor Summary
InterpretedClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, int index)
           
InterpretedClassDef(java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList)
           
 
Method Summary
 void addConstant(java.lang.String name, Expr value)
          Adds a const value.
 void addFunction(java.lang.String name, Function fun)
          Adds a function.
 void addStaticValue(Value name, Expr value)
          Adds a static value.
 void addStaticValue(Value name, Expr value, java.lang.String comment)
          Adds a static value.
 void addValue(Value name, Expr value, FieldVisibility visibility)
          Adds a value.
 void addValue(Value name, Expr value, FieldVisibility visibility, java.lang.String comment)
          Adds a value.
 java.util.Set<java.util.Map.Entry<StringValue,ClassDef.FieldEntry>> fieldSet()
           
 Expr findConstant(java.lang.String name)
          Return a const value.
 AbstractFunction findConstructor()
          Returns the constructor
 java.util.Set<java.util.Map.Entry<java.lang.String,AbstractFunction>> functionSet()
           
 Expr get(Value name)
          Adds a value.
 java.lang.String getComment()
          Returns the documentation for this class.
 java.lang.String getCompilationName()
           
 java.lang.String getFieldComment(StringValue name)
          Returns the comment for the specified field.
 boolean getHasNonPublicMethods()
           
 java.lang.String getStaticFieldComment(java.lang.String name)
          Returns the comment for the specified field.
 void init(Env env)
          Initialize the class.
 void initClass(QuercusClass cl)
          Initialize the quercus class.
 void initInstance(Env env, Value value)
          Initialize the fields
 boolean isAbstract()
          True for an abstract class.
 boolean isDeclaredField(StringValue name)
          Return true for a declared field.
 boolean isFinal()
           
 boolean isInterface()
          True for an interface class.
 boolean isTopScope()
          True if defined at the top-level scope
 void setAbstract(boolean isAbstract)
          true for an abstract class.
 void setComment(java.lang.String comment)
          Sets the documentation for this class.
 void setConstructor(AbstractFunction fun)
          Sets the constructor.
 void setFinal(boolean isFinal)
           
 void setInterface(boolean isInterface)
          true for an interface class.
 void setTopScope(boolean isTopScope)
          True if defined at the top-level scope
 java.util.Set<java.util.Map.Entry<java.lang.String,ClassDef.StaticFieldEntry>> staticFieldSet()
           
 
Methods inherited from class com.caucho.quercus.program.ClassDef
addInterface, addInterfaces, callNew, callNew, createObject, getCall, getExtension, getInterfaces, getLocation, getName, getParentName, hasNonPublicMethods, init, init, isA, loadClassDef, newInstance, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_isAbstract

protected boolean _isAbstract

_isInterface

protected boolean _isInterface

_isFinal

protected boolean _isFinal

_hasNonPublicMethods

protected boolean _hasNonPublicMethods

_functionMap

protected final java.util.HashMap<java.lang.String,AbstractFunction> _functionMap

_fieldMap

protected final java.util.HashMap<StringValue,ClassDef.FieldEntry> _fieldMap

_staticFieldMap

protected final java.util.HashMap<java.lang.String,ClassDef.StaticFieldEntry> _staticFieldMap

_constMap

protected final java.util.HashMap<java.lang.String,Expr> _constMap

_constructor

protected AbstractFunction _constructor

_destructor

protected AbstractFunction _destructor

_getField

protected AbstractFunction _getField

_setField

protected AbstractFunction _setField

_isset

protected AbstractFunction _isset

_unset

protected AbstractFunction _unset

_call

protected AbstractFunction _call

_invoke

protected AbstractFunction _invoke

_toString

protected AbstractFunction _toString

_parseIndex

protected int _parseIndex

_comment

protected java.lang.String _comment
Constructor Detail

InterpretedClassDef

public InterpretedClassDef(Location location,
                           java.lang.String name,
                           java.lang.String parentName,
                           java.lang.String[] ifaceList,
                           int index)

InterpretedClassDef

public InterpretedClassDef(java.lang.String name,
                           java.lang.String parentName,
                           java.lang.String[] ifaceList)
Method Detail

setAbstract

public void setAbstract(boolean isAbstract)
true for an abstract class.


isAbstract

public boolean isAbstract()
True for an abstract class.

Overrides:
isAbstract in class ClassDef

setInterface

public void setInterface(boolean isInterface)
true for an interface class.


isInterface

public boolean isInterface()
True for an interface class.

Overrides:
isInterface in class ClassDef

setFinal

public void setFinal(boolean isFinal)

isFinal

public boolean isFinal()
Overrides:
isFinal in class ClassDef

getHasNonPublicMethods

public boolean getHasNonPublicMethods()

isTopScope

public boolean isTopScope()
True if defined at the top-level scope


setTopScope

public void setTopScope(boolean isTopScope)
True if defined at the top-level scope


getCompilationName

public java.lang.String getCompilationName()

initClass

public void initClass(QuercusClass cl)
Initialize the quercus class.

Overrides:
initClass in class ClassDef

setConstructor

public void setConstructor(AbstractFunction fun)
Sets the constructor.


addFunction

public void addFunction(java.lang.String name,
                        Function fun)
Adds a function.


addStaticValue

public void addStaticValue(Value name,
                           Expr value)
Adds a static value.


addStaticValue

public void addStaticValue(Value name,
                           Expr value,
                           java.lang.String comment)
Adds a static value.


addConstant

public void addConstant(java.lang.String name,
                        Expr value)
Adds a const value.


findConstant

public Expr findConstant(java.lang.String name)
Return a const value.

Overrides:
findConstant in class ClassDef

addValue

public void addValue(Value name,
                     Expr value,
                     FieldVisibility visibility)
Adds a value.


addValue

public void addValue(Value name,
                     Expr value,
                     FieldVisibility visibility,
                     java.lang.String comment)
Adds a value.


get

public Expr get(Value name)
Adds a value.


isDeclaredField

public boolean isDeclaredField(StringValue name)
Return true for a declared field.


init

public void init(Env env)
Initialize the class.


initInstance

public void initInstance(Env env,
                         Value value)
Initialize the fields

Specified by:
initInstance in interface InstanceInitializer

findConstructor

public AbstractFunction findConstructor()
Returns the constructor

Specified by:
findConstructor in class ClassDef

setComment

public void setComment(java.lang.String comment)
Sets the documentation for this class.


getComment

public java.lang.String getComment()
Returns the documentation for this class.

Overrides:
getComment in class ClassDef

getFieldComment

public java.lang.String getFieldComment(StringValue name)
Returns the comment for the specified field.

Overrides:
getFieldComment in class ClassDef

getStaticFieldComment

public java.lang.String getStaticFieldComment(java.lang.String name)
Returns the comment for the specified field.

Overrides:
getStaticFieldComment in class ClassDef

fieldSet

public java.util.Set<java.util.Map.Entry<StringValue,ClassDef.FieldEntry>> fieldSet()
Overrides:
fieldSet in class ClassDef

staticFieldSet

public java.util.Set<java.util.Map.Entry<java.lang.String,ClassDef.StaticFieldEntry>> staticFieldSet()
Overrides:
staticFieldSet in class ClassDef

functionSet

public java.util.Set<java.util.Map.Entry<java.lang.String,AbstractFunction>> functionSet()
Overrides:
functionSet in class ClassDef