com.caucho.quercus.env
Class DefinitionState

java.lang.Object
  extended by com.caucho.quercus.env.DefinitionState

public final class DefinitionState
extends java.lang.Object

Represents the state of the definitions: functions, classes and constants.


Constructor Summary
DefinitionState(QuercusContext quercus)
           
 
Method Summary
 void addClassDef(java.lang.String name, ClassDef cl)
          Adds a class, e.g.
 Value addFunction(java.lang.String name, AbstractFunction fun)
          Adds a function, e.g.
 Value addFunction(java.lang.String name, java.lang.String lowerName, AbstractFunction fun)
          Adds a function from a compiled include
 DefinitionState copy()
           
 DefinitionState copyLazy()
           
 ClassDef findClassDef(java.lang.String name)
          Adds a class, e.g.
 AbstractFunction findFunction(java.lang.String name)
          Finds the java reflection method for the function with the given name.
 long getCrc()
          returns the crc.
 Value getDeclaredClasses(Env env)
          Returns the declared classes.
 ArrayValue getDefinedFunctions()
          Returns an array of the defined functions.
 QuercusContext getQuercus()
          Returns the owning PHP engine.
 boolean isStrict()
          Returns true for strict mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinitionState

public DefinitionState(QuercusContext quercus)
Method Detail

isStrict

public final boolean isStrict()
Returns true for strict mode.


getQuercus

public QuercusContext getQuercus()
Returns the owning PHP engine.


getCrc

public long getCrc()
returns the crc.


getDefinedFunctions

public ArrayValue getDefinedFunctions()
Returns an array of the defined functions.


findFunction

public AbstractFunction findFunction(java.lang.String name)
Finds the java reflection method for the function with the given name.

Parameters:
name - the method name
Returns:
the found method or null if no method found.

addFunction

public Value addFunction(java.lang.String name,
                         AbstractFunction fun)
Adds a function, e.g. from an include.


addFunction

public Value addFunction(java.lang.String name,
                         java.lang.String lowerName,
                         AbstractFunction fun)
Adds a function from a compiled include

Parameters:
name - the function name, must be an intern() string
lowerName - the function name, must be an intern() string

addClassDef

public void addClassDef(java.lang.String name,
                        ClassDef cl)
Adds a class, e.g. from an include.


findClassDef

public ClassDef findClassDef(java.lang.String name)
Adds a class, e.g. from an include.


getDeclaredClasses

public Value getDeclaredClasses(Env env)
Returns the declared classes.

Returns:
an array of the declared classes()

copy

public DefinitionState copy()

copyLazy

public DefinitionState copyLazy()