|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.python.core.PyObject
org.python.core.PyDescriptor
org.python.core.PyDataDescr
public abstract class PyDataDescr
Implements type checking and return type coercion for a data descriptor. A subclass must at least implement invokeGet which is called in __get__ operations. If the descriptor supports setting and deleting, the subclass must also override invokeSet and invokeDel respectively. When implementing those methods, their respective implementsDescr* methods should be overriden as well.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.python.core.PyObject |
|---|
PyObject.ConversionException |
| Field Summary |
|---|
| Fields inherited from class org.python.core.PyObject |
|---|
TYPE |
| Constructor Summary | |
|---|---|
PyDataDescr(PyType onType,
java.lang.String name,
java.lang.Class ofType)
|
|
PyDataDescr(java.lang.String name,
java.lang.Class ofType)
This constructor does not initialize the type the descriptor belongs to. setType must be called before this descriptor can be used. |
|
| Method Summary | |
|---|---|
void |
__delete__(PyObject obj)
|
PyObject |
__get__(PyObject obj,
PyObject type)
Get descriptor for this PyObject. |
void |
__set__(PyObject obj,
PyObject value)
|
java.lang.String |
getName()
Return the name this descriptor is exposed as. |
PyObject |
getObjClass()
Return the owner class of this descriptor. |
void |
getset_descriptor___delete__(PyObject obj)
|
PyObject |
getset_descriptor___get__(PyObject obj,
PyObject type)
|
void |
getset_descriptor___set__(PyObject obj,
PyObject value)
|
void |
invokeDelete(PyObject obj)
|
abstract java.lang.Object |
invokeGet(PyObject obj)
|
void |
invokeSet(PyObject obj,
java.lang.Object converted)
|
boolean |
isDataDescr()
|
void |
setType(PyType onType)
Sets the type the descriptor belongs to. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PyDataDescr(PyType onType,
java.lang.String name,
java.lang.Class ofType)
onType - -
the type the descriptor belongs toname - -
the name of the descriptor on descriptor typeofType - -
the type returned by the descriptor
public PyDataDescr(java.lang.String name,
java.lang.Class ofType)
name - -
the name of the descriptor on descriptor typeofType - -
the type returned by the descriptor| Method Detail |
|---|
public void setType(PyType onType)
setType in class PyObject
public PyObject __get__(PyObject obj,
PyObject type)
PyObject
__get__ in class PyObjectobj - -
the instance accessing this descriptor. Can be null if this is
being accessed by a type.type - -
the type accessing this descriptor. Will be null if obj exists
as obj is of the type accessing the descriptor.
public PyObject getset_descriptor___get__(PyObject obj,
PyObject type)
public abstract java.lang.Object invokeGet(PyObject obj)
public void __set__(PyObject obj,
PyObject value)
__set__ in class PyObject
public void getset_descriptor___set__(PyObject obj,
PyObject value)
public void invokeSet(PyObject obj,
java.lang.Object converted)
public void __delete__(PyObject obj)
__delete__ in class PyObjectpublic void getset_descriptor___delete__(PyObject obj)
public void invokeDelete(PyObject obj)
public boolean isDataDescr()
isDataDescr in class PyObjectpublic java.lang.String toString()
toString in class PyObjectpublic java.lang.String getName()
public PyObject getObjClass()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||