Interface JSConvertable

All Known Implementing Classes:
JSCollection, JSFunction, JSObject, JSPrimitive

public interface JSConvertable
The JSConvertable interface defines a method for converting an object to its JavaScript representation. Classes implementing this interface must provide an implementation for the toJS() method.
Author:
Alexey Glazyrin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final JSConvertable
    A predefined instance of JSConvertable representing the JavaScript `null` value.
    static final JSConvertable
    A predefined instance of JSConvertable representing the JavaScript `undefined` value.
  • Method Summary

    Modifier and Type
    Method
    Description
    Converts the object to a JavaScript string representation.
  • Field Details

    • UNDEFINED

      static final JSConvertable UNDEFINED
      A predefined instance of JSConvertable representing the JavaScript `undefined` value.
    • NULL

      static final JSConvertable NULL
      A predefined instance of JSConvertable representing the JavaScript `null` value.
  • Method Details

    • toJS

      String toJS()
      Converts the object to a JavaScript string representation.
      Returns:
      the JavaScript representation of the object