FieldVariable

public final class FieldVariable extends Field

Adds a variable to an Input.

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

FieldVariable(String name, String variable)

Public Method Summary

FieldVariable
clone()
static FieldVariable
fromJson(JSONObject json)
String
String
boolean
setFromString(String text)
Sets the values of the field from a string.
void
setVariable(String variable)
Sets the variable in this field.

Inherited Method Summary

Public Constructors

public FieldVariable (String name, String variable)

Parameters
name
variable

Public Methods

public FieldVariable clone ()

public static FieldVariable fromJson (JSONObject json)

Parameters
json

public String getSerializedValue ()

Returns
  • The value serialized into a string.

public String getVariable ()

Returns
  • The name of the variable that is set.

public boolean setFromString (String text)

Sets the values of the field from a string.

This is used for setting values of all types of fields when loading a workspace from XML. It is also used, however, as the primary means of setting text fields (e.g., inputs, labels, dates).

There should be a concrete implementation for each field type.

Parameters
text The text value for this field from the XML.
Returns
  • True if the value was set, false otherwise.

public void setVariable (String variable)

Sets the variable in this field. All variables are considered global and must be unique. Two variables with the same name will be considered the same variable at generation.

Parameters
variable