|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.blueworld.lassopro.LassoCall
The core of the Lasso Java API v7.0.
All the interaction between an LJAPI module and Lasso Professional is achieved
by means of invoking various methods implemented in this class.
These functions can be used to perform the following tasks:
Most methods return the result code - either ERR_NOERR
signifying that no errors had occured during this method execution, or an integer error code.
LassoDSModule
,
LassoTagModule
,
LassoErrors
Method Summary | |
int |
acquireSem(java.lang.String named)
Acquires previously created semaphore |
int |
addColumnInfo(java.lang.String name,
int nullOK,
int type,
int protection)
Adds information about a particular column. |
int |
addDataSourceResult(java.lang.String data)
Adds a result value. |
int |
addResultHeader(java.lang.String header)
Simply appends the supplied data to the header. |
int |
addResultRow(byte[][] columns)
Another way to add the column binary data for the next result row. |
int |
addResultRow(java.lang.String[] columns)
Adds all the column data for the next result row |
int |
arrayGetElement(LassoTypeRef array,
int index,
LassoTypeRef outElement)
This method gets an array element from a previously created array instance. |
int |
arrayGetSize(LassoTypeRef array,
IntValue outLen)
This method gets an array element from a previously created array instance. |
int |
arrayRemoveElement(LassoTypeRef array,
int index)
This method removes an element from a previously created array instance. |
int |
arraySetElement(LassoTypeRef array,
int index,
LassoTypeRef element)
This method sets an array element in a previously created array instance. |
int |
childrenRun(LassoTypeRef outResult)
Same purpose and usage as the children_run LDML tag. |
int |
createSem(java.lang.String named)
Semaphores are a means by which access to shared resources can be control amongst several threads of execution. |
int |
destroySem(java.lang.String named)
Destroys existing semaphore |
int |
findInputColumn(java.lang.String name,
LassoValue outColumn)
Gets an individual input column by name. |
int |
findTagParam(java.lang.String paramName,
LassoValue outParam)
Finds and fetches a tag param by name. |
int |
findTagParam2(java.lang.String paramName,
LassoTypeRef outType)
This allows tag parameters to be acquired while preserving their types. |
int |
formatBuffer(java.lang.String buffer,
LassoValue outResult)
Formats the supplied buffer and put the resulting data in the data member of the LassoValue .
|
java.lang.String |
fullyQualifyPath(java.lang.String relativePath)
Converts a relative path into a from-the-server-root path. |
int |
getCookieValue(java.lang.String named,
LassoValue outValue)
Finds a cookie value |
int |
getDataHost(LassoValue outHost,
LassoValue outUsernamePassword)
Returns the host that maintains the current database. |
int |
getDataHost(LassoValue outHost,
LassoValue outDefaultSchema,
LassoValue outUsernamePassword)
Returns the host that maintains the current database. |
int |
getDataSourceModuleName(LassoValue outName)
Returns the name the datasource module originally registered under. |
int |
getDataSourceName(LassoValue outName,
IntValue outUseHostDefault,
LassoValue outUsernamePassword)
Gets the currently specified database name. |
java.lang.Object |
getDSConnection()
Returns the current datasource connection, or null if no connection has been set yet. |
int |
getInputColumn(int index,
LassoValue outColumn)
Gets an individual input column by index. |
int |
getInputColumnCount(IntValue outCount)
Gets the number of input columns for this database action. |
static java.lang.String |
getInternalPath(java.lang.String platformPath)
Converts a platform-specific pathname into an internal pathname |
int |
getLassoParam(int key,
LassoValue outParam)
Fetches an internal variable |
int |
getLogicalOp(IntValue outOp)
Gets the logical operator for this database action. |
int |
getMaxRows(IntValue outRows)
The maximum number of rows in the found set to return. |
static java.lang.String |
getPlatformSpecificPath(java.lang.String internalPath)
Converts an internal pathname into a platform-specific pathname |
int |
getPrimaryKeyColumn(LassoValue outColumn)
Gets the name and the value of the currently specified primary key column. |
int |
getPrimaryKeyColumn2(int index,
LassoValue outColumn)
Gets the name and the value of the indexed primary key column. |
int |
getRequestParam(int key,
LassoValue outParam)
Fetches an internal variable |
int |
getResultHeader(LassoValue outHeader)
Allows access to the result (HTTP) header |
int |
getReturnColumn(int index,
LassoValue outColumn)
gets an individual return column by index |
int |
getReturnColumnCount(IntValue outCount)
Gets the number of return columns for this action |
int |
getRowID(IntValue outId)
Gets the currently specified record id (FileMaker-specific). |
int |
getSchemaName(LassoValue outName)
Gets the currently specified schema name. |
int |
getSkipRows(IntValue outRows)
The number of rows that should be skipped in the found set. |
int |
getSortColumn(int index,
LassoValue outColumn)
Gets an individual sort column by index. |
int |
getSortColumnCount(IntValue outCount)
Gets the number of sort columns for this database action. |
int |
getTableName(LassoValue outName)
Gets the currently specified table name. |
int |
getTagEncoding(IntValue outMethod)
Deprecated. |
int |
getTagName(LassoValue outName)
Fetches the name of the tag that triggered this call, i. |
int |
getTagParam(int paramIndex,
LassoValue outParam)
Fetches the indicated parameter that was sent to the tag. |
int |
getTagParam2(int paramIndex,
LassoTypeRef outType)
This allows tag parameters to be acquired while preserving their types. |
int |
getTagParamCount(IntValue outCount)
Fetches the number of parameters that were passed to the tag |
int |
getTagSelf(LassoTypeRef outSelf)
Used in LJAPI tags that are members of a custom type. |
int |
getVariable(java.lang.String named,
int index,
LassoValue outValue)
Retrieves the specified variable value |
int |
getVariable2(java.lang.String named,
LassoTypeRef outValue)
This allows variables to be acquired while preserving their types. |
int |
getVariableCount(java.lang.String named,
IntValue outCount)
Retrieves the number of variables with the specified name |
byte[] |
handleExternalConversion(LassoTypeRef inInstance,
java.lang.String inEncoding)
The basis of table-level automatic encoding and translation Converts a Lasso type INTO single-byte or binary data using the specific encoding name The default for all database, column, table names should be "iso8859-1" |
int |
handleInternalConversion(byte[] inData,
java.lang.String inEncoding,
int inClosestLassoType,
LassoTypeRef outType)
Converts a single-byte or binary representation of a Lasso type BACK INTO an instance of that type. |
int |
includeRaw(java.lang.String filePath,
LassoValue out)
Works just like the include tag |
int |
isAdministrator()
Returns ERR_NOERR is the current user has administrator priveleges.
|
int |
isLassoLite()
Returns ERR_NOERR if Lasso edition is LassoLite |
boolean |
isValid()
Returns true if a native object instance this LassoCall refers to
has not been destroyed yet. |
static int |
log(int msgLevel,
java.lang.String message)
Log a message. |
int |
mapFindElement(LassoTypeRef map,
LassoTypeRef key,
LassoTypeRef outElement)
This method finds an element in a previously created map instance. |
int |
mapGetElement(LassoTypeRef map,
int index,
LassoTypeRef outPair)
This method gets an element from a previously created map instance using the element index. |
int |
mapGetSize(LassoTypeRef map,
IntValue outLen)
This function gets the size of a previously created map instance. |
int |
mapRemoveElement(LassoTypeRef map,
LassoTypeRef key)
This method removes an element from a previously created map instance. |
int |
mapSetElement(LassoTypeRef map,
LassoTypeRef key,
LassoTypeRef value)
This function sets an element in a previously created map instance. |
int |
operationAllowed(int secureOperation,
java.lang.String internalPathname)
Returns ERR_NOERR is the given operation is permitted by Lasso security. |
int |
outputTagBytes(byte[] data)
Alias for outputTagData |
int |
outputTagData(byte[] data)
Output some data onto the page. |
int |
outputTagData(java.lang.String data)
Output some data onto the page. |
int |
pairGetFirst(LassoTypeRef pair,
LassoTypeRef outValue)
This method gets the first element from a previously created pair instance. |
int |
pairGetSecond(LassoTypeRef pair,
LassoTypeRef outValue)
This method gets the second element from a previously created pair instance. |
int |
pairSetFirst(LassoTypeRef pair,
LassoTypeRef first)
This method sets the first element in a previously created pair instance. |
int |
pairSetSecond(LassoTypeRef pair,
LassoTypeRef second)
This method sets the second element in a previously created pair instance. |
static int |
registerConstant(java.lang.String name,
LassoTypeRef val)
Define named constant |
int |
releaseSem(java.lang.String named)
Releases previously aquired semaphore |
int |
removeVariable(java.lang.String named,
int index)
Removes the specified variable |
java.lang.String |
resolvePath(java.lang.String fromRootPath)
Converts a from-the-root path into a full internal path |
int |
returnTagValue(LassoTypeRef value)
This allows LJAPI tags to return sophisticated data types. |
static int |
runRequest(java.lang.String className,
java.lang.String methodName,
int tagAction,
int unused)
Creates and runs a new LJAPI call on the given Java module method. |
int |
setDSConnection(java.lang.Object inConnection)
Called to set the current connection for the datasource May recurse to deliver the ACTION_CLOSE message if there is already a valid db connection. |
int |
setDSDefaultCharset(java.lang.String inCharsetName)
Called to set the default charset to be used for string encoding, such as "ISO-8859-1", etc. |
int |
setNumRowsFound(int num)
Sets the number of rows found in the query. |
int |
setResultCode(int err)
Sets the result code that can be displayed |
int |
setResultHeader(java.lang.String header)
Sets the result header. |
int |
setResultMessage(java.lang.String msg)
Sets the result message that can be displayed |
int |
setRowID(int id)
Sets the currently specified record id (FileMaker-specific). |
int |
setVariable(java.lang.String named,
java.lang.String value,
int index)
Sets the specified variable |
int |
setVariable2(java.lang.String named,
LassoTypeRef value)
This allows variables to be set while preserving their types. |
int |
storeGetData(java.lang.String key,
LassoValue outValue)
Fetches data that has been stored. |
int |
storeHasData(java.lang.String key,
IntValue outLength)
Returns ERR_NOERR if the data, specified by key, exists.
|
int |
storePutData(java.lang.String key,
byte[] data)
Adds the data to Lasso's storage. |
int |
storePutData(java.lang.String key,
java.lang.String data)
Adds the data to Lasso's storage. |
int |
switchToUser(java.lang.String username,
java.lang.String password)
Pass "anonymous" with no password to switch to lowest priveleges |
int |
tagGetExpectedParam(LassoTypeRef inTagType,
int index,
LassoValue outResult,
IntValue outRequired)
Provides access to indexed tag parameter |
int |
tagGetExpectedParamCount(LassoTypeRef inTagType,
IntValue outCount)
Provides access to tag parameters as specified by the -required/-optional keywords. |
int |
tagGetReturnType(LassoTypeRef inTagType,
LassoValue outResult)
Provides access to tag parameters as specified by the -returntype keyword |
int |
tagParamIsDefined(java.lang.String paramName)
Returns ERR_NOERR if the parameter was defined, anything else means it wasn't. |
int |
tagSetReturnType(LassoTypeRef inTagType,
java.lang.String typeName)
Provides access to tag parameters as specified by the -returntype keywords. |
int |
typeAddMember(LassoTypeRef toType,
java.lang.String named,
LassoTypeRef member)
This is used to add new members to type instances. |
int |
typeAlloc(java.lang.String typeName,
LassoTypeRef[] params,
LassoTypeRef outType)
typeAlloc will attempt to allocate a new type instance. |
int |
typeAllocArray(LassoTypeRef outArray,
LassoTypeRef[] inElements)
Allocates new Lasso type tag of type array . |
int |
typeAllocBoolean(LassoTypeRef outBool,
boolean value)
This function allows new instances of boolean data types to be allocated. |
int |
typeAllocCustom(LassoTypeRef outCustom,
java.lang.String typeName)
This function is used within module methods that were registered as being a type initializer (FLAG_INITIALIZER). |
int |
typeAllocDecimal(LassoTypeRef outDecimal,
double value)
Allocates new Lasso type tag of type decimal . |
int |
typeAllocDecimal(LassoTypeRef outDecimal,
double value,
int precision)
Allocates new Lasso type tag of type decimal with the given precision. |
int |
typeAllocFromProto(LassoTypeRef inProto,
LassoTypeRef outType)
Allocate a new type based on the given type. |
int |
typeAllocInteger(LassoTypeRef outInteger,
long value)
Allocates new Lasso type tag of type integer . |
int |
typeAllocMap(LassoTypeRef outMap,
LassoTypeRef[] inElements)
This method allows new instances of map data types to be allocated. |
int |
typeAllocMap(LassoTypeRef outMap,
LassoTypeRef[] inKeys,
LassoTypeRef[] inValues)
Same as above, only in this case the map keys and values are passed in a separate parameters. |
int |
typeAllocNull(LassoTypeRef outNull)
Allocates new Lasso type tag of type null . |
int |
typeAllocOneOff(java.lang.String inName,
java.lang.String inParentTypeName,
LassoTypeRef outType)
This method allocates a new type with the given name. |
int |
typeAllocPair(LassoTypeRef outPair,
LassoTypeRef inFirst,
LassoTypeRef inSecond)
Allocates new Lasso type tag of type pair . |
int |
typeAllocReference(LassoTypeRef outRef,
LassoTypeRef referenced)
Allocates new Lasso type tag of type reference . |
int |
typeAllocString(LassoTypeRef outString,
byte[] value)
Allocates new Lasso type tag of type string . |
int |
typeAllocString(LassoTypeRef outString,
java.lang.String value)
Allocates new Lasso type tag of type string . |
int |
typeAllocStringConv(LassoTypeRef outString,
java.lang.String value,
java.lang.String conv)
Allocates new Lasso type tag of type string from a Java string using specified encoding. |
int |
typeAllocTag(LassoTypeRef outTag,
java.lang.String className,
java.lang.String methodName)
Allocates new Lasso type tag of type tag . |
int |
typeAppendString(LassoTypeRef type,
java.lang.String value)
This function appends a string to an existing string instance. |
int |
typeAssign(LassoTypeRef left_hand_side,
LassoTypeRef right_hand_side)
typeAssign performs an assignment of one type to another.
|
int |
typeDetach(LassoTypeRef toDetach)
Prevents the type from being destroyed once the LJAPI call returns. |
int |
typeFree(LassoTypeRef inType)
typeFree will attempt to free a type created through typeAlloc (or any other method). |
int |
typeFreeCustomJavaObject(LassoTypeRef type)
Releases the Java object previously attached to a custom type. |
int |
typeGetBoolean(LassoTypeRef type,
IntValue outValue)
This method gets the data from a previously created boolean instance. |
byte[] |
typeGetBytes(LassoTypeRef type)
This method returns the data of a type instance as an array of bytes. |
java.lang.Object |
typeGetCustomJavaObject(LassoTypeRef type)
Retrieves the Java object previously attached to a custom type. |
int |
typeGetDecimal(LassoTypeRef type,
FloatValue outValue)
This method gets the data from a previously created decimal instance. |
int |
typeGetInteger(LassoTypeRef type,
IntValue outValue)
This method gets the data from a previously created integer instance. |
int |
typeGetMember(LassoTypeRef fromType,
java.lang.String named,
LassoTypeRef outMember)
This function is used to retrieve a member from a type instance. |
int |
typeGetName(LassoTypeRef target,
LassoValue outName)
Retrieves the name of the target type. |
int |
typeGetProperties(LassoTypeRef targetType,
LassoTypeRef outPair)
This method has two uses. |
int |
typeGetString(LassoTypeRef type,
LassoValue outValue)
This method gets the data from a previously created string instance. |
int |
typeInheritFrom(LassoTypeRef inChild,
LassoTypeRef inNewParent)
Change the inheritence structure of a type. |
int |
typeIsA(LassoTypeRef target,
java.lang.String typeName)
Returns ERR_NOERR is the target is of the specified type. |
int |
typeRunTag(LassoTypeRef tagType,
java.lang.String named,
LassoTypeRef[] params,
LassoTypeRef returnValue,
LassoTypeRef optionalTarget)
Used to execute a given tag. |
int |
typeRunTag(LassoTypeRef tagType,
java.lang.String named,
LassoTypeRef param,
LassoTypeRef returnValue,
LassoTypeRef optionalTarget)
Convenience function. |
int |
typeSetBoolean(LassoTypeRef type,
boolean value)
This method sets the value of a previously created boolean type instance. |
int |
typeSetBytes(LassoTypeRef type,
byte[] value)
This method sets the data of a type instance. |
int |
typeSetCustomJavaObject(LassoTypeRef type,
java.lang.Object object)
typeSetCustomJavaObject permits attachment of Java objects to custom types.
|
int |
typeSetDecimal(LassoTypeRef type,
double value)
This method sets the value of a previously created decimal type instance. |
int |
typeSetDecimal(LassoTypeRef type,
double value,
int precision)
This method sets the value of a previously created decimal type instance using specified precision. |
int |
typeSetInteger(LassoTypeRef type,
long value)
This method sets the value of a previously created integer type instance. |
int |
typeSetString(LassoTypeRef type,
java.lang.String value)
This method sets the value of a previously created string type instance. |
int |
typeStealValue(LassoTypeRef inThief,
LassoTypeRef inVictim)
This function transfers the data from one type to another type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean isValid()
true
if a native object instance this LassoCall refers to
has not been destroyed yet. Always evaluates to false
when called
outside the scope of the current call.
public static int registerConstant(java.lang.String name, LassoTypeRef val)
public int getRequestParam(int key, LassoValue outParam)
key
- one of the RequestParams
constantsoutParam
- resulting valueRequestParams
public int getLassoParam(int key, LassoValue outParam)
key
- one of the LassoParams
constantsoutParam
- resulting valueLassoParams
public int isLassoLite()
ERR_NOERR
if Lasso edition is LassoLite
public int setResultCode(int err)
public int setResultMessage(java.lang.String msg)
public int getTagName(LassoValue outName)
public int getTagParamCount(IntValue outCount)
public int getTagParam(int paramIndex, LassoValue outParam)
public int tagParamIsDefined(java.lang.String paramName)
ERR_NOERR
if the parameter was defined, anything else means it wasn't.
public int findTagParam(java.lang.String paramName, LassoValue outParam)
ERR_NOERR
means the param was found
public int getTagEncoding(IntValue outMethod)
public int outputTagData(java.lang.String data)
public int outputTagData(byte[] data)
public int outputTagBytes(byte[] data)
outputTagData
public int getResultHeader(LassoValue outHeader)
public int setResultHeader(java.lang.String header)
public int addResultHeader(java.lang.String header)
public int getVariableCount(java.lang.String named, IntValue outCount)
named
- name of a variableoutCount
- count of variables with the specified namepublic int getVariable(java.lang.String named, int index, LassoValue outValue)
named
- name of a variableindex
- indexes are zero-basedoutValue
- value of the named variablepublic int setVariable(java.lang.String named, java.lang.String value, int index)
public int removeVariable(java.lang.String named, int index)
public int getCookieValue(java.lang.String named, LassoValue outValue)
public java.lang.Object getDSConnection()
null
if no connection has been set yet.
public int setDSConnection(java.lang.Object inConnection)
ACTION_CLOSE
message if there is already a valid db connection.
inConnection
- an object representing valid datasource connection.public int setDSDefaultCharset(java.lang.String inCharsetName)
public int addDataSourceResult(java.lang.String data)
getInputColumn
& findInputColumn
can be used by tags to get input form params.
public int getDataSourceName(LassoValue outName, IntValue outUseHostDefault, LassoValue outUsernamePassword)
outName
- on return, contains the database name stored in the data
field.outUseHostDefault
- true
if user name and password returned in outUsernamePassword
variable should be used by default.outUsernamePassword
- user name and password to be used for logging in to the datasource host.public int getSchemaName(LassoValue outName)
outName
- on return, contains the schema name stored in the data
field.public int getTableName(LassoValue outName)
outName
- on return, contains the table name stored in the data
field.public int getDataHost(LassoValue outHost, LassoValue outUsernamePassword)
outHost
- host address and port are returned in the name
and data
fieldsoutUsernamePassword
- host default username and passwordpublic int getDataHost(LassoValue outHost, LassoValue outDefaultSchema, LassoValue outUsernamePassword)
public int getSkipRows(IntValue outRows)
public int getMaxRows(IntValue outRows)
public int getRowID(IntValue outId)
public int setRowID(int id)
public int getPrimaryKeyColumn(LassoValue outColumn)
public int getPrimaryKeyColumn2(int index, LassoValue outColumn)
public int getInputColumnCount(IntValue outCount)
public int getSortColumnCount(IntValue outCount)
public int getInputColumn(int index, LassoValue outColumn)
public int getSortColumn(int index, LassoValue outColumn)
public int findInputColumn(java.lang.String name, LassoValue outColumn)
public int getLogicalOp(IntValue outOp)
public int getReturnColumnCount(IntValue outCount)
public int getReturnColumn(int index, LassoValue outColumn)
public int addColumnInfo(java.lang.String name, int nullOK, int type, int protection)
name
- column namenullOK
- does the column type allows null values?type
- column type: TYPE_CHAR, TYPE_INT, TYPE_BOOLEAN, TYPE_DECIMAL, TYPE_DATETIME or TYPE_BLOBprotection
- is column value read only? Should be either PROTECTION_NONE or PROTECTION_READ_ONLYLassoValue
,
LassoDSModule
public int addResultRow(java.lang.String[] columns)
public int addResultRow(byte[][] columns)
String data[] = { "apples", "oranges", "pears", "cherries" }; int count = data.length; byte cols[][] = new byte[count][]; for ( i = 0; i < count; i++ ) cols[i] = data[i].getBytes(); lasso.addResultRow( cols );
public int setNumRowsFound(int num)
addResultRow
call
as the skip recs and max recs parameters effect that number.
public int createSem(java.lang.String named)
public int destroySem(java.lang.String named)
public int acquireSem(java.lang.String named)
public int releaseSem(java.lang.String named)
public int formatBuffer(java.lang.String buffer, LassoValue outResult)
LassoValue
.
The buffer should consist of plain text and bracketed Lasso tags.
public int includeRaw(java.lang.String filePath, LassoValue out)
public int storeHasData(java.lang.String key, IntValue outLength)
ERR_NOERR
if the data, specified by key, exists.
The length of the stored data can be returned in the length parameter.
This parameter may be null
if the length is not required.
public int storePutData(java.lang.String key, java.lang.String data)
key
is the unique identifier for the data.
public int storePutData(java.lang.String key, byte[] data)
key
is the unique identifier for the data.
public int storeGetData(java.lang.String key, LassoValue outValue)
key
- the unique identifier for the data.
The data will be returned in the data
field of the LassoValue
object.public int isAdministrator()
ERR_NOERR
is the current user has administrator priveleges.
This is useful for doing module administration that only the admin should be able to do.
public int operationAllowed(int secureOperation, java.lang.String internalPathname)
ERR_NOERR
is the given operation is permitted by Lasso security.
secureOperation
- one of the constants defined in LassoSecureOperations
classinternalPathname
- full path to the file using the *internal pathname* format.public int switchToUser(java.lang.String username, java.lang.String password)
public int typeAlloc(java.lang.String typeName, LassoTypeRef[] params, LassoTypeRef outType)
public int typeFree(LassoTypeRef inType)
public int typeAllocNull(LassoTypeRef outNull)
null
.
public int typeAllocString(LassoTypeRef outString, java.lang.String value)
string
.
public int typeAllocString(LassoTypeRef outString, byte[] value)
string
.
public int typeAllocStringConv(LassoTypeRef outString, java.lang.String value, java.lang.String conv)
string
from a Java string using specified encoding.
public int typeAllocInteger(LassoTypeRef outInteger, long value)
integer
.
public int typeAllocDecimal(LassoTypeRef outDecimal, double value)
decimal
.
public int typeAllocDecimal(LassoTypeRef outDecimal, double value, int precision)
decimal
with the given precision.
public int typeAllocPair(LassoTypeRef outPair, LassoTypeRef inFirst, LassoTypeRef inSecond)
pair
.
public int typeAllocReference(LassoTypeRef outRef, LassoTypeRef referenced)
reference
.
public int typeAllocTag(LassoTypeRef outTag, java.lang.String className, java.lang.String methodName)
tag
.
public int typeAllocArray(LassoTypeRef outArray, LassoTypeRef[] inElements)
array
.
outArray
- resulting typeinElements
- the elements to instantite new array type with. Can be null.public int typeAllocMap(LassoTypeRef outMap, LassoTypeRef[] inElements)
public int typeAllocMap(LassoTypeRef outMap, LassoTypeRef[] inKeys, LassoTypeRef[] inValues)
public int typeAllocBoolean(LassoTypeRef outBool, boolean value)
public int typeAllocCustom(LassoTypeRef outCustom, java.lang.String typeName)
__type_name__
member to the provided value.
The new type does not yet have a lineage and has no members added to it besides __type_name__
.
New data or tag members should be added using typeAddMember
.
The new custom type should be the return value of the type initializer.
Any inherited members will be added to the type after the LJAPI call returns.
Warning: Do not call this unless you are in a type initializer. If you are not in a type initializer, the result will be a type that will never be fully initialized.
public int typeAllocFromProto(LassoTypeRef inProto, LassoTypeRef outType)
public int typeAllocOneOff(java.lang.String inName, java.lang.String inParentTypeName, LassoTypeRef outType)
null
or empty string is passed in), type "null" will be the default.
If a parent type is provided, it must have been a validly registered type initializer.
OnCreate
will be called for the parent and beyond
public int typeInheritFrom(LassoTypeRef inChild, LassoTypeRef inNewParent)
inChild
- targetinNewParent
- new parent typepublic int typeAppendString(LassoTypeRef type, java.lang.String value)
public int typeStealValue(LassoTypeRef inThief, LassoTypeRef inVictim)
public byte[] handleExternalConversion(LassoTypeRef inInstance, java.lang.String inEncoding)
public int handleInternalConversion(byte[] inData, java.lang.String inEncoding, int inClosestLassoType, LassoTypeRef outType)
inClosestLassoType
- desired Lasso type. pass one of the TYPE_XXX constants defined in LassoValue
outType
- resulting Lasso type intancepublic int typeGetString(LassoTypeRef type, LassoValue outValue)
public byte[] typeGetBytes(LassoTypeRef type)
public int typeGetInteger(LassoTypeRef type, IntValue outValue)
public int typeGetDecimal(LassoTypeRef type, FloatValue outValue)
public int typeGetBoolean(LassoTypeRef type, IntValue outValue)
public int typeSetString(LassoTypeRef type, java.lang.String value)
public int typeSetBytes(LassoTypeRef type, byte[] value)
public int typeSetInteger(LassoTypeRef type, long value)
public int typeSetDecimal(LassoTypeRef type, double value)
public int typeSetDecimal(LassoTypeRef type, double value, int precision)
public int typeSetBoolean(LassoTypeRef type, boolean value)
public int typeGetProperties(LassoTypeRef targetType, LassoTypeRef outPair)
targetType
parameter is not null
,
it is used to get all the data and tag members from a given type.
They are returned as an array of pairs in the outPair
value.
The first element of each pair is the map of data members for the type. The second element is the map of tag members.
Each element in the array represents the members of each type inherited by the targetType
.
If the targetType
parameter is null
, typeGetProperties
will return an array containing the variable maps for the currently active request.
public int typeGetName(LassoTypeRef target, LassoValue outName)
target
type.
public int typeIsA(LassoTypeRef target, java.lang.String typeName)
ERR_NOERR
is the target is of the specified type.
public int typeRunTag(LassoTypeRef tagType, java.lang.String named, LassoTypeRef[] params, LassoTypeRef returnValue, LassoTypeRef optionalTarget)
params
, returnValue
, and optionalTarget
parameters may all be null
.
tagType
- must be a valid instance of an executable tag of type LASSO_TAG
named
- optionally sets the tag name at the time of execution. Could be null
params
- optional tag parameters. Could be null
.returnValue
- the result of this tag executionoptionalTarget
- to be used in a member tag calls. Otherwise it should be null
public int typeRunTag(LassoTypeRef tagType, java.lang.String named, LassoTypeRef param, LassoTypeRef returnValue, LassoTypeRef optionalTarget)
tagType
- must be a valid instance of an executable tag of type LASSO_TAG
named
- optionally sets the tag name at the time of execution. Could be null
param
- Optional. Single tag parameter. Could be null
.returnValue
- the result of this tag executionoptionalTarget
- would be used in a member tag call. Otherwise it should be null
public int getTagSelf(LassoTypeRef outSelf)
outSelf.isNull()
will evaluate to true
.
public int returnTagValue(LassoTypeRef value)
public int getVariable2(java.lang.String named, LassoTypeRef outValue)
public int setVariable2(java.lang.String named, LassoTypeRef value)
public int getTagParam2(int paramIndex, LassoTypeRef outType)
public int findTagParam2(java.lang.String paramName, LassoTypeRef outType)
public int tagGetReturnType(LassoTypeRef inTagType, LassoValue outResult)
public int tagSetReturnType(LassoTypeRef inTagType, java.lang.String typeName)
public int tagGetExpectedParamCount(LassoTypeRef inTagType, IntValue outCount)
public int tagGetExpectedParam(LassoTypeRef inTagType, int index, LassoValue outResult, IntValue outRequired)
public int childrenRun(LassoTypeRef outResult)
children_run
LDML tag.
public int typeGetMember(LassoTypeRef fromType, java.lang.String named, LassoTypeRef outMember)
public int typeAddMember(LassoTypeRef toType, java.lang.String named, LassoTypeRef member)
public int arrayGetSize(LassoTypeRef array, IntValue outLen)
public int arrayGetElement(LassoTypeRef array, int index, LassoTypeRef outElement)
public int arraySetElement(LassoTypeRef array, int index, LassoTypeRef element)
public int arrayRemoveElement(LassoTypeRef array, int index)
public int mapGetSize(LassoTypeRef map, IntValue outLen)
public int mapFindElement(LassoTypeRef map, LassoTypeRef key, LassoTypeRef outElement)
public int mapGetElement(LassoTypeRef map, int index, LassoTypeRef outPair)
public int mapSetElement(LassoTypeRef map, LassoTypeRef key, LassoTypeRef value)
key
,
the element will be added to the map, otherwise the old element will be replaced by a new value
.
public int mapRemoveElement(LassoTypeRef map, LassoTypeRef key)
public int pairGetFirst(LassoTypeRef pair, LassoTypeRef outValue)
public int pairGetSecond(LassoTypeRef pair, LassoTypeRef outValue)
public int pairSetFirst(LassoTypeRef pair, LassoTypeRef first)
public int pairSetSecond(LassoTypeRef pair, LassoTypeRef second)
public int typeSetCustomJavaObject(LassoTypeRef type, java.lang.Object object)
typeSetCustomJavaObject
permits attachment of Java objects to custom types.
Java object is retained until the typeFreeCustomJavaObject
is called, or the
type is destroyed. One of the most common uses of this feature is to attach the
LassoTagModule
instance to a custom LDML type created by that module.
In this case, Lasso will attempt to reuse the Java object and invoke member methods on the
attached module instead of creating new module instance for each corresponding call.
As an added bonus, module methods will always be executed in the current "context".
So, for example, instead of:
Note: if the attached object class implementsLassoTypeRef type = new LassoTypeRef(); lasso.getTagSelf(type); Object obj = lasso.typeGetCustomJavaObject(type); obj.counter++;
one could simply write:this.counter++;
Cloneable
interface, an attempt will be made to invoke its clone
method during assignment
operation, when OnAssign
member itslef is not implemented by the module.
public java.lang.Object typeGetCustomJavaObject(LassoTypeRef type)
null
if no object has been associated with this custom type instance.
public int typeFreeCustomJavaObject(LassoTypeRef type)
public int typeAssign(LassoTypeRef left_hand_side, LassoTypeRef right_hand_side)
typeAssign
performs an assignment of one type to another.
The result will be the same as if the following had been executed in LDML:
#left_hand_side = #right_hand_side
public int typeDetach(LassoTypeRef toDetach)
typeFree
or a memory leak will occur.
public static int runRequest(java.lang.String className, java.lang.String methodName, int tagAction, int unused)
methodName
will be run within that threads context.
If there is no currently active request on the current thread, a new request will be created and run based off the global context.
className
- name of the java class implementing the methodmethodName
- java method. Must have the same signature as TAG_METHOD_PROTOTYPE
tagAction
- this parameter will be passed to the methodName
and can be used to signal or pass information to the functionunused
- reserved for future usepublic int getDataSourceModuleName(LassoValue outName)
public static java.lang.String getPlatformSpecificPath(java.lang.String internalPath)
public static java.lang.String getInternalPath(java.lang.String platformPath)
public java.lang.String fullyQualifyPath(java.lang.String relativePath)
public java.lang.String resolvePath(java.lang.String fromRootPath)
public static int log(int msgLevel, java.lang.String message)
msgLevel
- one of the LOG_LEVEL constantsmessage
- message text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |