Class JythonModel

    • Constructor Summary

      Constructors 
      Constructor Description
      JythonModel​(org.python.core.PyObject object, JythonWrapper wrapper)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object exec​(java.util.List arguments)
      Executes the method call.
      TemplateModel get​(java.lang.String key)
      Calls PyObject.__findattr__(java.lang.String), then if it returns null calls PyObject.__finditem__(java.lang.String).
      java.lang.Object getAdaptedObject​(java.lang.Class hint)
      Retrieves the underlying object, or some other object semantically equivalent to its value narrowed by the class hint.
      boolean getAsBoolean()
      Returns the value of PyObject.__nonzero__().
      java.lang.String getAsString()
      Returns the value of Object.toString().
      java.lang.Object getWrappedObject()
      Retrieves the original object wrapped by this model.
      boolean isEmpty()
      Returns PyObject.__len__() == 0.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • object

        protected final org.python.core.PyObject object
    • Constructor Detail

      • JythonModel

        public JythonModel​(org.python.core.PyObject object,
                           JythonWrapper wrapper)
    • Method Detail

      • getAdaptedObject

        public java.lang.Object getAdaptedObject​(java.lang.Class hint)
        Description copied from interface: AdapterTemplateModel
        Retrieves the underlying object, or some other object semantically equivalent to its value narrowed by the class hint.
        Specified by:
        getAdaptedObject in interface AdapterTemplateModel
        Parameters:
        hint - the desired class of the returned value. An implementation should make reasonable effort to retrieve an object of the requested class, but if that is impossible, it must at least return the underlying object as-is. As a minimal requirement, an implementation must always return the exact underlying object when hint.isInstance(underlyingObject) holds. When called with java.lang.Object.class, it should return a generic Java object (i.e. if the model is wrapping a scripting language object that is further wrapping a Java object, the deepest underlying Java object should be returned).
        Returns:
        the underlying object, or its value accommodated for the hint class.