Enum Class CometCScriptFunction.CallStyle

java.lang.Object
java.lang.Enum<CometCScriptFunction.CallStyle>
com.priint.pubserver.comet.bridge.CometCScriptFunction.CallStyle
All Implemented Interfaces:
Serializable, Comparable<CometCScriptFunction.CallStyle>, Constable
Enclosing class:
CometCScriptFunction

public static enum CometCScriptFunction.CallStyle extends Enum<CometCScriptFunction.CallStyle>
The enum Call style.
  • Enum Constant Details

    • 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
      More types are probably to be supported in future versions.
      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 Details

    • values

      public static CometCScriptFunction.CallStyle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CometCScriptFunction.CallStyle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null