public class InterpretedClassDef extends ClassDef implements InstanceInitializer
ClassDef.FieldEntry, ClassDef.StaticFieldEntry
NULL_STRING_ARRAY
Constructor and Description |
---|
InterpretedClassDef(Location location,
java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList,
int index) |
InterpretedClassDef(Location location,
java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList,
java.lang.String[] traitList,
int index) |
InterpretedClassDef(java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList) |
InterpretedClassDef(java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList,
java.lang.String[] traitList) |
Modifier and Type | Method and Description |
---|---|
void |
addClassField(StringValue name,
Expr value,
FieldVisibility visibility,
java.lang.String comment)
Adds a value.
|
void |
addConstant(StringValue name,
Expr value)
Adds a const value.
|
void |
addFunction(StringValue 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.
|
java.util.Set<java.util.Map.Entry<StringValue,ClassField>> |
fieldSet() |
Expr |
findConstant(java.lang.String name)
Return a const value.
|
AbstractFunction |
findConstructor()
Returns the constructor
|
java.util.Set<java.util.Map.Entry<StringValue,AbstractFunction>> |
functionSet() |
AbstractFunction |
getCall() |
AbstractFunction |
getCallStatic() |
ClassField |
getClassField(StringValue name)
Adds a value.
|
java.lang.String |
getComment()
Returns the documentation for this class.
|
java.lang.String |
getCompilationInstanceName()
Unique instance name for the compiled class.
|
java.lang.String |
getCompilationName()
Unique name to use for compilation.
|
ClassField |
getField(StringValue name) |
java.lang.String |
getFieldComment(StringValue name)
Returns the comment for the specified field.
|
AbstractFunction |
getFunction(StringValue name) |
java.util.HashMap<StringValue,AbstractFunction> |
getFunctionMap() |
AbstractFunction |
getSerialize() |
java.lang.String |
getStaticFieldComment(StringValue name)
Returns the comment for the specified field.
|
AbstractFunction |
getUnserialize() |
boolean |
hasPrivateMethods()
Returns true if the class has private methods.
|
boolean |
hasProtectedMethods()
Returns true if class has protected or private methods.
|
boolean |
hasPublicMethods()
Returns true if class has public methods.
|
void |
init(Env env)
Initialize the class.
|
void |
initClassFields(QuercusClass cl,
java.lang.String declaringClassName)
Initialize the quercus class fields.
|
void |
initClassMethods(QuercusClass cl,
java.lang.String bindingClassName)
Initialize the quercus class methods.
|
void |
initInstance(Env env,
Value obj,
boolean isInitFieldValues)
Initialize the fields
|
boolean |
isAbstract()
True for an abstract class.
|
boolean |
isDeclaredField(StringValue name)
Return true for a declared field.
|
boolean |
isFinal()
Returns true for a final class.
|
boolean |
isInterface()
True for an interface class.
|
boolean |
isTopScope()
True if defined at the top-level scope
|
boolean |
isTrait()
True for an trait class.
|
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)
True for a final class.
|
void |
setInterface(boolean isInterface)
true for an interface class.
|
void |
setTopScope(boolean isTopScope)
True if defined at the top-level scope
|
void |
setTrait(boolean isTrait)
true for an trait class.
|
java.util.Set<java.util.Map.Entry<StringValue,ClassDef.StaticFieldEntry>> |
staticFieldSet() |
addInterface, addInterfaces, addTrait, addTraitAlias, addTraitInsteadOf, addTraits, callNew, callNew, createObject, getExtension, getInterfaces, getLocation, getName, getParentName, getTraitAliasMap, getTraitInsteadofMap, getTraits, hasNonPublicMethods, hasTrait, init, init, isA, loadClassDef, toString
protected boolean _isAbstract
protected boolean _isInterface
protected boolean _isTrait
protected boolean _isFinal
protected boolean _hasPublicMethods
protected boolean _hasProtectedMethods
protected boolean _hasPrivateMethods
protected final java.util.LinkedHashMap<StringValue,AbstractFunction> _functionMap
protected final java.util.LinkedHashMap<StringValue,ClassField> _fieldMap
protected final java.util.LinkedHashMap<StringValue,ClassDef.StaticFieldEntry> _staticFieldMap
protected final java.util.HashMap<StringValue,Expr> _constMap
protected AbstractFunction _constructor
protected AbstractFunction _destructor
protected AbstractFunction _getField
protected AbstractFunction _setField
protected AbstractFunction _isset
protected AbstractFunction _unset
protected AbstractFunction _call
protected AbstractFunction _callStatic
protected AbstractFunction _serializeFun
protected AbstractFunction _unserializeFun
protected AbstractFunction _invoke
protected AbstractFunction _toString
protected int _parseIndex
protected java.lang.String _comment
public InterpretedClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, int index)
public InterpretedClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, java.lang.String[] traitList, int index)
public InterpretedClassDef(java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, java.lang.String[] traitList)
public InterpretedClassDef(java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList)
public void setAbstract(boolean isAbstract)
public boolean isAbstract()
isAbstract
in class ClassDef
public void setInterface(boolean isInterface)
public boolean isInterface()
isInterface
in class ClassDef
public void setTrait(boolean isTrait)
public void setFinal(boolean isFinal)
public boolean isFinal()
public boolean hasPublicMethods()
public boolean hasProtectedMethods()
public boolean hasPrivateMethods()
public boolean isTopScope()
public void setTopScope(boolean isTopScope)
public java.lang.String getCompilationName()
public java.lang.String getCompilationInstanceName()
public void initClassMethods(QuercusClass cl, java.lang.String bindingClassName)
initClassMethods
in class ClassDef
cl
- add methods to this QuercusClassbindingClassName
- name of the owning class (for __CLASS__ resolution)public void initClassFields(QuercusClass cl, java.lang.String declaringClassName)
initClassFields
in class ClassDef
cl
- add fields to this QuercusClassdeclaringClassName
- name of the owning class (for static fields)public void setConstructor(AbstractFunction fun)
public AbstractFunction getCall()
public AbstractFunction getCallStatic()
getCallStatic
in class ClassDef
public AbstractFunction getSerialize()
getSerialize
in class ClassDef
public AbstractFunction getUnserialize()
getUnserialize
in class ClassDef
public void addFunction(StringValue name, Function fun)
public void addStaticValue(Value name, Expr value, java.lang.String comment)
public void addConstant(StringValue name, Expr value)
public Expr findConstant(java.lang.String name)
findConstant
in class ClassDef
public void addClassField(StringValue name, Expr value, FieldVisibility visibility, java.lang.String comment)
public ClassField getClassField(StringValue name)
public boolean isDeclaredField(StringValue name)
public void init(Env env)
public void initInstance(Env env, Value obj, boolean isInitFieldValues)
initInstance
in interface InstanceInitializer
public AbstractFunction findConstructor()
findConstructor
in class ClassDef
public void setComment(java.lang.String comment)
public java.lang.String getComment()
getComment
in class ClassDef
public java.lang.String getFieldComment(StringValue name)
getFieldComment
in class ClassDef
public java.lang.String getStaticFieldComment(StringValue name)
getStaticFieldComment
in class ClassDef
public java.util.Set<java.util.Map.Entry<StringValue,ClassField>> fieldSet()
public ClassField getField(StringValue name)
public java.util.Set<java.util.Map.Entry<StringValue,ClassDef.StaticFieldEntry>> staticFieldSet()
staticFieldSet
in class ClassDef
public java.util.Set<java.util.Map.Entry<StringValue,AbstractFunction>> functionSet()
functionSet
in class ClassDef
public AbstractFunction getFunction(StringValue name)
public java.util.HashMap<StringValue,AbstractFunction> getFunctionMap()