com.caucho.quercus.program
Class ClassDef

java.lang.Object
  extended by com.caucho.quercus.program.ClassDef
Direct Known Subclasses:
CompiledClassDef, InterpretedClassDef, JavaClassDef

public abstract class ClassDef
extends java.lang.Object

Represents a Quercus class definition


Nested Class Summary
static class ClassDef.FieldEntry
           
static class ClassDef.StaticFieldEntry
           
 
Constructor Summary
protected ClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList)
           
 
Method Summary
protected  void addInterface(java.lang.String iface)
           
 void addInterfaces(java.util.HashSet<java.lang.String> interfaceSet)
          Adds the interfaces to the set
 Value callNew(Env env, Expr[] args)
          Creates a new instance.
 Value callNew(Env env, Value[] args)
          Creates a new instance.
 ObjectValue createObject(Env env, QuercusClass cls)
           
 java.util.Set<java.util.Map.Entry<StringValue,ClassDef.FieldEntry>> fieldSet()
           
 Expr findConstant(java.lang.String name)
          Finds the matching constant
abstract  AbstractFunction findConstructor()
          Returns the constructor
 java.util.Set<java.util.Map.Entry<java.lang.String,AbstractFunction>> functionSet()
           
 AbstractFunction getCall()
           
 java.lang.String getComment()
          Returns the documentation for this class.
 java.lang.String getExtension()
           
 java.lang.String getFieldComment(StringValue name)
          Returns the comment for the specified field.
 java.lang.String[] getInterfaces()
          Returns the interfaces.
 Location getLocation()
          Returns the location for where the class was defined, null if it is unknown.
 java.lang.String getName()
          Returns the name.
 java.lang.String getParentName()
          Returns the parent name.
 java.lang.String getStaticFieldComment(java.lang.String name)
          Returns the comment for the specified static field.
 boolean hasNonPublicMethods()
           
 void init()
           
 void init(QuercusClass cl)
           
 void initClass(QuercusClass cl)
          Initialize the quercus class.
 boolean isA(java.lang.String name)
          Returns value for instanceof.
 boolean isAbstract()
          Return true for an abstract class.
 boolean isFinal()
           
 boolean isInterface()
          Return true for an interface class.
 ClassDef loadClassDef()
          forces a load of any lazy ClassDef
 ObjectValue newInstance(Env env, QuercusClass qcl)
          Creates a new instance.
 java.util.Set<java.util.Map.Entry<java.lang.String,ClassDef.StaticFieldEntry>> staticFieldSet()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDef

protected ClassDef(Location location,
                   java.lang.String name,
                   java.lang.String parentName,
                   java.lang.String[] ifaceList)
Method Detail

getLocation

public Location getLocation()
Returns the location for where the class was defined, null if it is unknown.


getName

public java.lang.String getName()
Returns the name.


getParentName

public java.lang.String getParentName()
Returns the parent name.


getExtension

public java.lang.String getExtension()

addInterface

protected void addInterface(java.lang.String iface)

loadClassDef

public ClassDef loadClassDef()
forces a load of any lazy ClassDef


getCall

public AbstractFunction getCall()

init

public void init()

init

public void init(QuercusClass cl)

getInterfaces

public java.lang.String[] getInterfaces()
Returns the interfaces.


addInterfaces

public void addInterfaces(java.util.HashSet<java.lang.String> interfaceSet)
Adds the interfaces to the set


isAbstract

public boolean isAbstract()
Return true for an abstract class.


isInterface

public boolean isInterface()
Return true for an interface class.


isFinal

public boolean isFinal()

hasNonPublicMethods

public boolean hasNonPublicMethods()

initClass

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


newInstance

public ObjectValue newInstance(Env env,
                               QuercusClass qcl)
Creates a new instance.


createObject

public ObjectValue createObject(Env env,
                                QuercusClass cls)

callNew

public Value callNew(Env env,
                     Expr[] args)
Creates a new instance.


callNew

public Value callNew(Env env,
                     Value[] args)
Creates a new instance.


isA

public boolean isA(java.lang.String name)
Returns value for instanceof.


findConstructor

public abstract AbstractFunction findConstructor()
Returns the constructor


findConstant

public Expr findConstant(java.lang.String name)
Finds the matching constant


getComment

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


getFieldComment

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


getStaticFieldComment

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


toString

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

fieldSet

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

staticFieldSet

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

functionSet

public java.util.Set<java.util.Map.Entry<java.lang.String,AbstractFunction>> functionSet()