KADABRA API

LARA API

LARA Common Language API

DataStore

Constructor

DataStore

new DataStore(data, definition)

Interface with Java class DataStore, used for storing arbitrary information.

Parameters

data: any
definition: any

Instance Members

addAlias

addAlias(key, alias)

Parameters

key: any
alias: any

copy

copy()

disableKeyChecking

disableKeyChecking()

get

get(key)

Parameters

key: any

Returns

any - the value corresponding to the given key, or undefined if no value or null value is found

getConfigurationFile

getConfigurationFile()

Returns

J#java.io.File - The configuration file, if one was used, or undefined otherwise.

getConfigurationFolder

getConfigurationFolder()

Returns

J#java.io.File - The folder of the configuration file, if one was used, or undefined otherwise.

getContextFolder

getContextFolder()

The folder that is considered the working folder of the current context.

1) If a configuration file was used, returns the path of the configuration file;
2) Otherwise, returns the folder from where the weaver was launched.

Returns

J#java.io.File - The folder where the code represented by the AST will be written at the end of execution.

getData

getData()

getKeys

getKeys()

getType

getType(key)

Parameters

key: any

Returns

any - java.lang.Class representing the type of the value of the given key

hasValue

hasValue(key)

Checks if the given key has an associated value in the DataStore.

Parameters

key: string - The name of the key to check

Returns

boolean - true if the data store has a value for the given key, false otherwise

load

load(fileOrBaseFolder, optionalFile)

Parameters

fileOrBaseFolder: any
optionalFile: any

put

put(key, value)

Store the given value with the given key.

Parameters

key: any
value: any

save

save(fileOrBaseFolder, optionalFile)

Parameters

fileOrBaseFolder: any
optionalFile: any