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(Object o)
Attempts to adapt o using the preClass, class and postClass adapters.
|
boolean |
canAdapt(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, addPreClass
public boolean canAdapt(Object o)
canAdapt
in interface PyObjectAdapter
canAdapt
in class ExtensiblePyObjectAdapter
public PyObject adapt(Object o)
ExtensiblePyObjectAdapter
adapt
in interface PyObjectAdapter
adapt
in class ExtensiblePyObjectAdapter