All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cinchapi.impromptu.server.api.automate.Param Maven / Gradle / Ivy

/*
 * Cinchapi Inc. CONFIDENTIAL
 * Copyright (c) 2017 Cinchapi Inc. All Rights Reserved.
 *
 * All information contained herein is, and remains the property of Cinchapi.
 * The intellectual and technical concepts contained herein are proprietary to
 * Cinchapi and may be covered by U.S. and Foreign Patents, patents in process,
 * and are protected by trade secret or copyright law. Dissemination of this
 * information or reproduction of this material is strictly forbidden unless
 * prior written permission is obtained from Cinchapi. Access to the source code
 * contained herein is hereby forbidden to anyone except current Cinchapi
 * employees, managers or contractors who have executed Confidentiality and
 * Non-disclosure agreements explicitly covering such access.
 *
 * The copyright notice above does not evidence any actual or intended
 * publication or disclosure of this source code, which includes information
 * that is confidential and/or proprietary, and is a trade secret, of Cinchapi.
 *
 * ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE, OR PUBLIC
 * DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT THE EXPRESS WRITTEN
 * CONSENT OF COMPANY IS STRICTLY PROHIBITED, AND IN VIOLATION OF APPLICABLE
 * LAWS AND INTERNATIONAL TREATIES. THE RECEIPT OR POSSESSION OF THIS SOURCE
 * CODE AND/OR RELATED INFORMATION DOES NOT CONVEY OR IMPLY ANY RIGHTS TO
 * REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE, USE, OR
 * SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
 */
package com.cinchapi.impromptu.server.api.automate;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * An annotation that is applied to a {@link Action} parameter to provide form
 * generation instructions.
 * 
 * @author Jeff Nelson
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Param {

    /**
     * Return a description of the parameter.
     * 
     * @return the description
     */
    String description() default "";

    /**
     * Return the human readable prompt for the form field in which the value of
     * the param is entered by a user.
     * 
     * @return the prompt
     */
    String prompt() default "";

    /**
     * Return a boolean that indicates whether the field is required or not.
     * 
     * @return
     */
    boolean required() default true;

    /**
     * Return the form field type to use.
     * 
     * @return the type
     */
    Type type() default Type.TEXT;

    /**
     * Return the form field validation to use.
     * 
     * @return the validation scheme
     */
    Validation validation() default Validation.NONE;

    /**
     * Return the options to use, in the case of a {@link Type#SELECT} or
     * {@link Type#MULTISELECT} field.
     * 
     * @return the select options
     */
    String[] options() default {};

    /**
     * The field type to use so a user can provide the param.
     * 
     * @author Jeff Nelson
     */
    enum Type {
        PASSWORD, TEXT, LONGTEXT, SELECT, MULTISELECT, BOOLEAN
    }

    /**
     * The form field validation scheme to use.
     * 
     * @author Jeff Nelson
     */
    enum Validation {

        NONE, EMAIL
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy