SimpleAtom

public class SimpleAtom implements Atom


A simple implementation of Atom suitable for subclassing.

Summary

Nested types

public enum SimpleAtom.ElementReferencePlacement

Controls whether the ElementReference appears as the first arg or last arg to the script.

Public constructors

Creates a SimpleAtom which runs the given script and places any ElementReference as the first argument to the script.

SimpleAtom(
    String script,
    SimpleAtom.ElementReferencePlacement elementPlacement
)

Creates a SimpleAtom which runs the given script and places any supplied ElementReference either as the first or last argument to the script.

Public methods

final List<Object>

The SimpleAtom presents an argument list to the script which follows some basic conventions.

final String

Returns the script this SimpleAtom was created with.

final Evaluation

The SimpleAtom's transform method checks the Evaluation object for success.

Public constructors

SimpleAtom

public SimpleAtom(String script)

Creates a SimpleAtom which runs the given script and places any ElementReference as the first argument to the script.

SimpleAtom

public SimpleAtom(
    String script,
    SimpleAtom.ElementReferencePlacement elementPlacement
)

Creates a SimpleAtom which runs the given script and places any supplied ElementReference either as the first or last argument to the script.

Public methods

getArguments

public final List<ObjectgetArguments(ElementReference elementRef)

The SimpleAtom presents an argument list to the script which follows some basic conventions.

If an ElementReference is provided, it is placed either in the first or last position based on the ElementReferencePlacement provided to the constructor.

The nonContextualArguments (if provided via getNonContextualArguments) will appear after the ElementReference.

getScript

public final String getScript()

Returns the script this SimpleAtom was created with.

transform

public final Evaluation transform(Evaluation e)

The SimpleAtom's transform method checks the Evaluation object for success.

If the Evaluation object has an error, the default behaviour is to throw an exception, subclasses may change this behaviour via the handleBadEvaluation method.