public abstract class ClassDef extends java.lang.Object implements InstanceInitializer
Modifier and Type | Class and Description |
---|---|
static class |
ClassDef.FieldEntry |
static class |
ClassDef.StaticFieldEntry |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String[] |
NULL_STRING_ARRAY |
Modifier | Constructor and Description |
---|---|
protected |
ClassDef(Location location,
java.lang.String name,
java.lang.String parentName) |
protected |
ClassDef(Location location,
java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList) |
protected |
ClassDef(Location location,
java.lang.String name,
java.lang.String parentName,
java.lang.String[] ifaceList,
java.lang.String[] traitList) |
Modifier and Type | Method and Description |
---|---|
protected void |
addInterface(java.lang.String iface) |
void |
addInterfaces(java.util.HashSet<java.lang.String> interfaceSet)
Adds the interfaces to the set
|
void |
addTrait(java.lang.String trait)
Adds a PHP 5.4 trait.
|
void |
addTraitAlias(StringValue funName,
StringValue funNameAlias,
java.lang.String traitName) |
void |
addTraitInsteadOf(StringValue funName,
java.lang.String traitName,
java.lang.String insteadofTraitName) |
void |
addTraits(java.util.HashSet<java.lang.String> traitSet)
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)
Creates a new object.
|
java.util.Set<java.util.Map.Entry<StringValue,ClassField>> |
fieldSet() |
Expr |
findConstant(java.lang.String name)
Finds the matching constant
|
abstract AbstractFunction |
findConstructor()
Returns the constructor
|
java.util.Set<java.util.Map.Entry<StringValue,AbstractFunction>> |
functionSet() |
AbstractFunction |
getCall() |
AbstractFunction |
getCallStatic() |
java.lang.String |
getComment()
Returns the documentation for this class.
|
java.lang.String |
getExtension()
Returns the name of the extension that this class is part of.
|
ClassField |
getField(StringValue name) |
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.
|
AbstractFunction |
getSerialize() |
java.lang.String |
getStaticFieldComment(StringValue name)
Returns the comment for the specified static field.
|
TraitAliasMap |
getTraitAliasMap() |
TraitInsteadofMap |
getTraitInsteadofMap() |
java.lang.String[] |
getTraits()
Returns the interfaces.
|
AbstractFunction |
getUnserialize() |
boolean |
hasNonPublicMethods()
Returns true if the class has private/protected methods.
|
boolean |
hasTrait(java.lang.String traitName)
Returns true if this class locally declares usage of this trait.
|
void |
init() |
void |
init(QuercusClass cl) |
void |
initClassFields(QuercusClass cl,
java.lang.String bindingClassName)
Initialize the quercus class fields.
|
void |
initClassMethods(QuercusClass cl,
java.lang.String bindingClassName)
Initialize the quercus class methods.
|
boolean |
isA(Env env,
java.lang.String name)
Returns value for instanceof.
|
boolean |
isAbstract()
Return true for an abstract class.
|
boolean |
isFinal()
Returns true for a final class.
|
boolean |
isInterface()
Return true for an interface class.
|
boolean |
isTrait()
True for an trait class.
|
ClassDef |
loadClassDef()
forces a load of any lazy ClassDef
|
java.util.Set<java.util.Map.Entry<StringValue,ClassDef.StaticFieldEntry>> |
staticFieldSet() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
initInstance
protected ClassDef(Location location, java.lang.String name, java.lang.String parentName)
protected ClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList)
protected ClassDef(Location location, java.lang.String name, java.lang.String parentName, java.lang.String[] ifaceList, java.lang.String[] traitList)
public Location getLocation()
public java.lang.String getName()
public java.lang.String getParentName()
public java.lang.String getExtension()
protected void addInterface(java.lang.String iface)
public void addTrait(java.lang.String trait)
public boolean hasTrait(java.lang.String traitName)
public final TraitInsteadofMap getTraitInsteadofMap()
public final TraitAliasMap getTraitAliasMap()
public void addTraitInsteadOf(StringValue funName, java.lang.String traitName, java.lang.String insteadofTraitName)
public void addTraitAlias(StringValue funName, StringValue funNameAlias, java.lang.String traitName)
public ClassDef loadClassDef()
public AbstractFunction getCall()
public AbstractFunction getCallStatic()
public AbstractFunction getSerialize()
public AbstractFunction getUnserialize()
public void init()
public void init(QuercusClass cl)
public java.lang.String[] getInterfaces()
public java.lang.String[] getTraits()
public void addInterfaces(java.util.HashSet<java.lang.String> interfaceSet)
public void addTraits(java.util.HashSet<java.lang.String> traitSet)
public boolean isAbstract()
public boolean isInterface()
public boolean isTrait()
public boolean isFinal()
public boolean hasNonPublicMethods()
public void initClassMethods(QuercusClass cl, java.lang.String bindingClassName)
cl
- add methods to this QuercusClassbindingClassName
- name of the owning class (for __CLASS__ resolution)public void initClassFields(QuercusClass cl, java.lang.String bindingClassName)
cl
- add fields to this QuercusClassbindingClassName
- name of the owning class (for static fields)public ObjectValue createObject(Env env, QuercusClass cls)
public boolean isA(Env env, java.lang.String name)
public abstract AbstractFunction findConstructor()
public Expr findConstant(java.lang.String name)
public java.lang.String getComment()
public java.lang.String getFieldComment(StringValue name)
public java.lang.String getStaticFieldComment(StringValue name)
public java.lang.String toString()
toString
in class java.lang.Object
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()
public java.util.Set<java.util.Map.Entry<StringValue,AbstractFunction>> functionSet()