001//
002//  Copyright 2012 Cloud Software Group, Inc. ALL RIGHTS RESERVED. 
003//  Cloud Software Group, Inc. Confidential Information
004//
005//  $Revision: 1.5 $ $Date: 2013/01/03 00:57:06 $
006//
007package com.tibco.xp.studio.annotation;
008
009import java.lang.annotation.Documented;
010import java.lang.annotation.ElementType;
011import java.lang.annotation.Retention;
012import java.lang.annotation.RetentionPolicy;
013import java.lang.annotation.Target;
014
015/**
016 * Expose a static method as a catalog function
017 */
018@Documented
019@Retention(RetentionPolicy.CLASS)
020@Target(ElementType.METHOD)
021public @interface Function
022{   
023    /**
024     * Indicate whether method has side-effects.
025     * <p>
026     * A method has side effects if it modifies application concepts.
027     * <p>
028     * The default value is true.
029     * @return True if method has side-effects.  False if method has no side-effects.
030     */
031    boolean hasSideEffects() default true;
032    
033    /**
034     * Disable optimization of rule function
035     * <p>
036     * Setting this value to true indicates that the result of this
037     * function cannot be cached to optimize performance - it must always be evaluated.
038     * <p>
039     * Setting this value to false indicates that the result of this function can be cached
040     * to optimize performance.  In some cases, this function will be skipped being 
041     * called during rule execution.
042     * <p>
043     * The default value is true.
044     * @return True to disable optimization, false to enable optimization.
045     */
046    boolean disableOptimization() default true;
047    
048    /**
049     * Function executes asynchronously
050     * <p>
051     * Setting this value to true indicates that the function 
052     * executes asynchronously.
053     * <p>
054     * Setting this value to false indicates that the function
055     * executes synchronously.
056     * <p>
057     * The default value is false.
058     * @return True to indicate asynchronous execution, false synchronous.
059     */
060    boolean asynchronous() default false;
061    
062    /**
063     * Description of any cautions associated with this function.
064     * <p>
065     * The default value is an empty string.
066     * @return Cautions associated with this function.
067     */
068    String cautions() default "";
069    
070    /**
071     * Example on how to use this function.
072     * <p>
073     * The default value is an empty string.
074     * @return Example function use.
075     */
076    String example() default "";
077}