Enum CometCScriptFunction.CallStyle
- java.lang.Object
-
- java.lang.Enum<CometCScriptFunction.CallStyle>
-
- com.priint.pubserver.comet.bridge.CometCScriptFunction.CallStyle
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CometCScriptFunction.CallStyle>
- Enclosing class:
- CometCScriptFunction
public static enum CometCScriptFunction.CallStyle extends java.lang.Enum<CometCScriptFunction.CallStyle>
The enum Call style.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FUNCTIONFunctions return a (calculated) value, therefore we cannot use the result value of the corresponding cscript functions to indicate errors.
The result type is determined by the result type of the Java method annotated as CometCScriptFunction.PROCEDUREProcedures don't have a return value.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CometCScriptFunction.CallStylevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CometCScriptFunction.CallStyle[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PROCEDURE
public static final CometCScriptFunction.CallStyle PROCEDURE
Procedures don't have a return value. The result type of the corresponding cscript function therefore is an integer value indicating the result of the procedure call (0 = success, other values = error).
-
FUNCTION
public static final CometCScriptFunction.CallStyle FUNCTION
Functions return a (calculated) value, therefore we cannot use the result value of the corresponding cscript functions to indicate errors.
The result type is determined by the result type of the Java method annotated as CometCScriptFunction. Only certain types are supported:- Java type java.lang.String: cscript char *
- Java type List<String> or String[]: cscript type StringList
- Java type com.priint.pubserver.comet.bridge.entitydata.RecordID: cscript type idtype
- Java type List<RecordID>: cscript type idtypelist
- Java type com.priint.pubserver.comet.bridge.entitydata.Product: cscript type product
- Java type List<Product>: cscript type productlist
To indicate errors, you have to return significant values (e.g. -1 for an index, which cannot possibly be a valid index) OR add an integer pointer parameter after the last regular parameter of the function call.
In this case, the result / error code will be assigned to the variable denoted by this address.
-
-
Method Detail
-
values
public static CometCScriptFunction.CallStyle[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CometCScriptFunction.CallStyle c : CometCScriptFunction.CallStyle.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CometCScriptFunction.CallStyle valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-