Stay organized with collections Save and categorize content based on your preferences.

Atom

public 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 methods

abstract List<Object>

Creates a list of arguments to pass to the script.

abstract String

Provides the script to be evaluated.

abstract R
transform(Evaluation evaluation)

Converts an Evaluation into another more suitable type.

Public methods

getArguments

abstract List<ObjectgetArguments(ElementReference elementContext)

Creates a list of arguments to pass to the script.

Parameters
ElementReference elementContext

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

Returns
List<Object>

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

getScript

abstract String getScript()

Provides the script to be evaluated.

transform

abstract R transform(Evaluation evaluation)

Converts an Evaluation into another more suitable type.