public class ClassicPyObjectAdapter extends ExtensiblePyObjectAdapter
Py.java2py(java.lang.Object) to adapt objects.
Pre-class adapters are added to handle instances of PyObject, PyProxy and null values. Class
adapters are added to handle builtin Java classes: String, Integer, Float, Double, Byte, Long,
Short, Character, Class and Boolean. An adapter is added to the post-class adapters to handle
wrapping arrays properly. Finally, if all of the added adapters can handle an object, it's
wrapped in a PyJavaInstance.| Constructor and Description |
|---|
ClassicPyObjectAdapter() |
| Modifier and Type | Method and Description |
|---|---|
PyObject |
adapt(java.lang.Object o)
Attempts to adapt o using the preClass, class and postClass adapters.
|
boolean |
canAdapt(java.lang.Object o)
Always returns true as we just return new PyJavaInstance(o) if the adapters added to the
superclass can't handle o.
|
add, addPostClass, addPreClasspublic boolean canAdapt(java.lang.Object o)
canAdapt in interface PyObjectAdaptercanAdapt in class ExtensiblePyObjectAdapterpublic PyObject adapt(java.lang.Object o)
ExtensiblePyObjectAdapteradapt in interface PyObjectAdapteradapt in class ExtensiblePyObjectAdapter