Atom


interface Atom<R>

Known direct subclasses
SimpleAtom

A simple implementation of Atom suitable for subclassing.

TransformingAtom

Decorates another atom and transforms its output to another type.


An Atom is a thin wrapper around javascript.

The wrapped script can return a value or be a statement. The Atom can supply positional arguments to pass to the wrapped script. The Atom knows how to transform the result of the evaluation of the script into a higher level object.

Parameters
<R>

the result type of the atom.

Summary

Public functions

(Mutable)List<Any!>!
getArguments(elementContext: ElementReference?)

Creates a list of arguments to pass to the script.

String!

Provides the script to be evaluated.

R!
transform(evaluation: Evaluation!)

Converts an Evaluation into another more suitable type.

Public functions

getArguments

fun getArguments(elementContext: ElementReference?): (Mutable)List<Any!>!

Creates a list of arguments to pass to the script.

Parameters
elementContext: ElementReference?

null unless an ElementReference has been supplied to execute this atom with.

Returns
(Mutable)List<Any!>!

the List of objects to pass to the script as arguments.

getScript

fun getScript(): String!

Provides the script to be evaluated.

transform

fun transform(evaluation: Evaluation!): R!

Converts an Evaluation into another more suitable type.