Enum CometCScriptFunction.CallStyle

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      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.
      PROCEDURE
      Procedures don't have a return value.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static CometCScriptFunction.CallStyle valueOf​(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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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
        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 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 name
        java.lang.NullPointerException - if the argument is null