001/* 002 * $RCSfile: Parameter.java,v $ 003 * $Revision: 1.1.2.4 $ $Date: 2009/11/24 22:37:41 $ 004 * 005 * Copyright 2009 Kabira Technologies, Inc. All rights reserved. 006 */ 007package com.kabira.platform.management; 008 009import java.lang.annotation.Documented; 010import java.lang.annotation.ElementType; 011import java.lang.annotation.Inherited; 012import java.lang.annotation.Retention; 013import java.lang.annotation.RetentionPolicy; 014import java.lang.annotation.Target; 015 016/** 017 * ManagementTarget Command parameter. 018 * Must be present on all parameters of a method annotated as a @Command. Valid 019 * parameter types are String, Enum, Boolean, Character, Integer, Byte, Short, 020 * Long, Float, and Double. Other types will cause TargetException to be 021 * thrown when the target is registered. Arrays are not supported. 022 * see java.lang.String for descriptions of valid String formats for 023 * the supported parameter types. 024 */ 025@Documented 026@Inherited 027@Retention(RetentionPolicy.RUNTIME) 028@Target(ElementType.PARAMETER) 029public @interface Parameter 030{ 031 /** 032 * The parameter name as exposed to management clients 033 */ 034 String name(); 035 036 /** 037 * A description of the parameter. Used in the generated help for the 038 * command. 039 */ 040 String description() default ""; 041 042 /** 043 * Indicates that this parameter must be set by the caller. 044 * If the parameter is not set. the command will fail. 045 * If false, and no default is provided, the value of the parameter will be 046 * null 047 */ 048 boolean required() default false; 049 050 /** 051 * The default value of the parameter. 052 */ 053 Default defaultValue() default @Default(provided = false, value = ""); 054}