01: package org.python.core.adapter;
02:
03: import org.python.core.PyObject;
04:
05: /**
06: * PyObjectAdapters turn Java Objects into PyObjects.
07: */
08: public interface PyObjectAdapter {
09:
10: /**
11: * @return true if o can be adapted by this adapter.
12: */
13: public abstract boolean canAdapt(Object o);
14:
15: /**
16: * @return the PyObject version of o or null if canAdapt(o) returns false.
17: */
18: public abstract PyObject adapt(Object o);
19:
20: }
|