freemarker.ext.jython

## Class JythonVersionAdapter

- java.lang.Object
- - freemarker.ext.jython.JythonVersionAdapter

    public abstract class JythonVersionAdapter
    extends Object

Functions that has a different implementation depending on the Jython version used. This was introduced to work around class-loading errors because of different classes/methods being present in different Jython versions.

### Constructor Summary

Constructors
Constructor and Description
`JythonVersionAdapter()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract String` `getPythonClassName(org.python.core.PyObject pyObject)` Returns `pyObject.__class__.__name__`
`abstract boolean` `isPyInstance(Object obj)` Returns `obj instanceof Py[Java]Instance`.
`abstract Object` `pyInstanceToJava(Object pyInstance)` Returns `((PyInstance) py[Java]Instance).__tojava__(java.lang.Object.class)`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JythonVersionAdapter

    public JythonVersionAdapter()

### Method Detail

#### isPyInstance

    public abstract boolean isPyInstance(Object obj)

Returns `obj instanceof Py[Java]Instance`.

#### pyInstanceToJava

    public abstract Object pyInstanceToJava(Object pyInstance)

Returns `((PyInstance) py[Java]Instance).__tojava__(java.lang.Object.class)`.

#### getPythonClassName

    public abstract String getPythonClassName(org.python.core.PyObject pyObject)

Returns `pyObject.__class__.__name__`