View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.core;
16  
17  import java.io.Serializable;
18  /**
19   * This is a simple bean allowing to describe the definition of a
20   * {@link Configurable} object or service parameter. This definition
21   * is made of this parameter name, description, a default value and
22   * whether parameter is mandatory or not. 
23   * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
24   * @version $Revision: 1.2 $
25   */
26  public class ParameterDefinition implements Serializable{
27  
28     // Attributes ---------------------------------------------------------------
29  
30     /** The name of this parameter. */
31     private String name;
32     /** The description of this parameter; */
33     private String description;
34     /** A default value (or at least an example) for this parameter. */
35     private String defaultValue;
36     /** Flag telling if this parameter is mandatory or optional. */
37     private boolean mandatory = true;
38  
39  
40     // Constructors -------------------------------------------------------------
41  
42     /**
43      * Creates a new instance of ParemeterDefinition with attributes.
44      * @param name The name of parameter
45      * @param description The description of parameter
46      * @param defaultValue A default value (or at least and example) for parameter
47      * @param mandatory Whetther this paramater is mandatory
48      */
49     public ParameterDefinition(String name, String description, String defaultValue, boolean mandatory){
50        this.name = name;
51        this.description = description;
52        this.defaultValue = defaultValue;
53        this.mandatory = mandatory;
54     }
55  
56  
57     // Public -------------------------------------------------------------------
58  
59     /** @return The name of this parameter. */
60     public String getName(){
61        return name;
62     }
63     /** @return The description of this parameter. */
64     public String getDescription(){
65        return description;
66     }
67     /** @return The default value for this parameter. */
68     public String getDefaultValue(){
69        return defaultValue;
70     }
71     /** @return Whether this parameter is mandatory or not. */
72     public boolean isMandatory(){
73        return mandatory;
74     }
75  }