Annotation Interface CometCScriptFunction


@Inherited @Documented @Retention(RUNTIME) @Target(METHOD) public @interface CometCScriptFunction
The interface Comet C-script function.
  • Field Details

  • Element Details

    • name

      String name

      Gets the name of this cscript function.

      This name must be a valid cscript function identifier, furthermore it must be unique within the Java Plugin providing this cscript function.

      If the name attribute is omitted, the native Java method name will be used for the cscript stub.

      cscript function names can include the colon ':' character, thus naming can follow a namespace like schema.

      Returns:
      the name of this cscript function. This name must be a valid cscript identifier, furthermore it must be unique within the Java Plugin providing this cscript function.
      Default:
      ""
    • pythonName

      String pythonName

      Gets the name of the python function.

      This name must be a valid python identifier.

      If the attribute is omitted, the native Java method name will be used for the python stub.

      Returns:
      name of the python function
      Default:
      ""
    • alias

      String alias

      Gets the alternative name of the cscript function.

      This attribute was introduced to allow renaming of functions according to new naming conventions, e.g. including a namespace.

      If the attribute is defined / non empty, the cscript function will be available on client side by name (or native Java method name) and alias

      Returns:
      alternative name of the cscript function
      Default:
      ""
    • callStyle

      Call style call style.
      Returns:
      callStyle of this function. See the CallStyle enum documentation for more information.
      Default:
      FUNCTION
    • failureValue

      String failureValue

      Value to indicate failures for FUNCTION style methods.

      The value to indicate failure for FUNCTION style methods.
      This could be an empty String (for functions with String return type) or "-1" for functions, which actually should return a valid Integer ID (which is never negative) or "0.0" for functions, which should return a valid Double dimension (which should never be zero) etc.

      If this attribute is omitted, a zero equivalent value will be used as the failure indicator value.

      Returns:
      the failure value for this method, if we use FUNCTION style
      Default:
      ""
    • resultDescription

      String resultDescription

      Short description of the method result

      This is for documentation purposes only.
      The result description is included in inline documentation of generated cscript headers.

      Returns:
      a short description of the method result
      Default:
      ""
    • errorReporting

      Error reporting method for this cscript function.

      Regardless of the error reporting, error handling is subject to the cscript developer, which calls the Java method exposed as a cscript function.
      Error reporting only controls, if and how errors caused by exception thrown from the underlying Java methods are reported to the user.
      Options are:

      • USER: error reporting is subject to the user, i.e. cscript developer. If log is enabled on client side, messages will be written to the log file.
      • ALERT: an alert dialog is opened showing the exception message as thrown from the underlying Java method
      • LOCALIZED: an alert dialog is opened showing the translated exception message as thrown from the underlying Java method

      Returns:
      method for error reporting
      Default:
      USER
    • mode

      Mode mode.
      Returns:
      mode
      Default:
      SYNCHRONOUS
    • polling

      int polling
      Polling int.
      Returns:
      int
      Default:
      -1
    • timeout

      long timeout
      Timeout long.
      Returns:
      long
      Default:
      -1L