public class GloopMethods extends Object
Constructor and Description |
---|
GloopMethods() |
Modifier and Type | Method and Description |
---|---|
static String |
contextToJsonString(io.toro.gloop.engine.GloopExecutionContext context)
Outputs a JSON representation of the current gloop variable context
|
static void |
cursorAppend(io.toro.gloop.object.cursor.GloopCursor cursor,
Object value)
Adds all the value to the cursor.
|
static void |
cursorClose(io.toro.gloop.object.cursor.GloopCursor cursor)
Closes a cursor
|
static Object |
cursorGetValue(io.toro.gloop.object.cursor.GloopCursor cursor)
Gets the value of the current record from the cursor
|
static boolean |
cursorHasNext(io.toro.gloop.object.cursor.GloopCursor cursor)
Checks whether the given gloop cursor has another record
|
static int |
cursorLast(io.toro.gloop.object.cursor.GloopCursor cursor)
Automatically iterates through the cursor until the last record is reached
|
static void |
cursorNextRecord(io.toro.gloop.object.cursor.GloopCursor cursor)
Moves the cursor to the next record
|
static long |
cursorSize(io.toro.gloop.object.cursor.GloopCursor cursor)
Get the size of a cursor"
|
static int |
cursorSkip(io.toro.gloop.object.cursor.GloopCursor cursor,
int skipCount)
Skips the next X records in a cursor
|
static io.toro.gloop.object.property.GloopModel |
cursorToArray(io.toro.gloop.object.cursor.GloopCursor cursor)
Iterates through a cursor and creates an in-memory gloop model array
|
static io.toro.gloop.object.property.GloopModel |
dynamicModelToMapModelArray(io.toro.gloop.object.property.GloopModel anonymousModel) |
static String |
getSystemProperty(String name,
String defaultVal)
Gets a Java System Property @see java.lang.System#getSystemProperty()
|
static long |
getSystemTime()
Gets the current system time in milliseconds @see java.lang.System#currentTimeMillis()
|
static io.toro.gloop.object.property.GloopModel |
mapModelArrayToDynamicModel(io.toro.gloop.object.property.GloopModel mapModelArray) |
static Object |
runScriptlet(String scriptlet,
io.toro.gloop.engine.GloopExecutionContext context)
Run a piece of groovy code on the current context
|
static String |
setSystemProperty(String name,
String value)
Sets a Java System Property @see java.lang.System#setSystemProperty()
|
static void |
throwException(String message)
Throws an exception using the given message
|
static void |
throwException(String message,
Throwable cause) |
@GloopParameter(name="systemTime") public static long getSystemTime()
@GloopParameter(name="systemProperty") public static String getSystemProperty(String name, String defaultVal)
name
- The name of the property to getdefaultVal
- The default values to use if the property isn't setpublic static String setSystemProperty(String name, String value)
name
- The name of the property to getvalue
- The value to assign to the system propertypublic static Object runScriptlet(String scriptlet, io.toro.gloop.engine.GloopExecutionContext context)
scriptlet
- The groovy code snippet to execute agains the current contextcontext
- The Gloop Execution Context, Gloop maps this automaticallypublic static boolean cursorHasNext(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static void cursorNextRecord(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static Object cursorGetValue(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static void cursorAppend(@GloopParameter(allowNull=false) io.toro.gloop.object.cursor.GloopCursor cursor, @GloopParameter(allowNull=false) Object value)
cursor
- Gloop Cursorvalue
- The value to add to the cursorpublic static long cursorSize(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static int cursorSkip(io.toro.gloop.object.cursor.GloopCursor cursor, int skipCount)
cursor
- Gloop CursorskipCount
- how many records to try and skip overpublic static int cursorLast(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static void cursorClose(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursor@GloopObjectParameter(value="output{\ncursorValues[]*{\n}\n}") public static io.toro.gloop.object.property.GloopModel cursorToArray(io.toro.gloop.object.cursor.GloopCursor cursor)
cursor
- Gloop Cursorpublic static String contextToJsonString(io.toro.gloop.engine.GloopExecutionContext context)
context
- The Gloop Execution Context, Gloop maps this automaticallypublic static void throwException(@GloopParameter(allowNull=false) String message) throws Exception
message
- Exception messageException
public static void throwException(@GloopParameter(value="Exception Message",allowNull=false) String message, @GloopParameter(value="Cause",allowNull=false) Throwable cause) throws Exception
Exception
@GloopComment(value="This service maps `model map` Gloop Models to a new Model that will contain new Gloop properties, whose names will be equal to the `name` in an entry, and whose value will be the `value` in an entry.\n\nFor example: If you had a `model map` model with 2 entries whose names were `TORO` and `Martini` and whose values were `Cloud`, and `Ninja` respectively, the resulting model would be represented in JSON as follows:\n\n````json\n{\n \"TORO\": \"Cloud\",\n \"Martini\": \"Ninja\"\n}\n````\n\nIn this example the source JSON would have looked like this:\n````\n[\n {\n \"name\": \"TORO\",\n \"value\": \"Cloud\"\n },\n {\n \"name\": \"Martini\",\n \"value\": \"Ninja\"\n }\n]\n````") @GloopObjectParameter(value="output{\n output[]{\n name\n value:object\n }\n}") public static io.toro.gloop.object.property.GloopModel dynamicModelToMapModelArray(@GloopParameter(allowExtraProperties=true) io.toro.gloop.object.property.GloopModel anonymousModel)
@GloopComment(value="This service maps `model map` Gloop Models to a new Model that will contain new Gloop properties, whose names will be equal to the `name` in an entry, and whose value will be the `value` in an entry.\n\nFor example: If you had a `model map` model with 2 entries whose names were `TORO` and `Martini` and whose values were `Cloud`, and `Ninja` respectively, the resulting model would be represented in JSON as follows:\n\n````json\n{\n \"TORO\": \"Cloud\",\n \"Martini\": \"Ninja\"\n}\n````") @GloopParameter(allowExtraProperties=true) public static io.toro.gloop.object.property.GloopModel mapModelArrayToDynamicModel(@GloopObjectParameter(value="model[]{\n name\n value:object\n}\n") io.toro.gloop.object.property.GloopModel mapModelArray)
Copyright © 2019. All rights reserved.