|
|||||||||
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,
String name,
Class ofType,
String doc)
|
|
PyDataDescr(String name,
Class ofType,
String doc)
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)
|
String |
getDoc()
|
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 Object |
invokeGet(PyObject obj)
|
void |
invokeSet(PyObject obj,
Object converted)
|
boolean |
isDataDescr()
|
void |
setType(PyType onType)
Sets the type the descriptor belongs to. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PyDataDescr(PyType onType, String name, Class ofType, String doc)
onType
- -
the type the descriptor belongs toname
- -
the name of the descriptor on descriptor typeofType
- -
the type returned by the descriptorpublic PyDataDescr(String name, Class ofType, String doc)
name
- -
the name of the descriptor on descriptor typeofType
- -
the type returned by the descriptorMethod Detail |
---|
public void setType(PyType onType)
setType
in class PyObject
public PyObject __get__(PyObject obj, PyObject type)
PyObject
__get__
in class PyObject
obj
- -
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 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, Object converted)
public void __delete__(PyObject obj)
__delete__
in class PyObject
public void getset_descriptor___delete__(PyObject obj)
public void invokeDelete(PyObject obj)
public boolean isDataDescr()
isDataDescr
in class PyObject
public String toString()
toString
in class PyObject
public String getDoc()
public String getName()
public PyObject getObjClass()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |