Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/aendvari/cerberus/component/descriptor/SignatureProperty.java


1   /*
2    * SignatureProperty.java
3    *
4    * Copyright (c) 2001, 2002 Aendvari, Ltd. All Rights Reserved.
5    *
6    * See the file LICENSE for terms of use.
7    *
8    */
9   
10  package com.aendvari.cerberus.component.descriptor;
11  
12  import java.util.ArrayList;
13  import java.util.Collection;
14  
15  /**
16   * <p>Describes a single property of a {@link MessageSignature}.<p>
17   *
18   * @author  Trevor Milne
19   *
20   */
21  
22  public class SignatureProperty extends ComponentProperty
23  {
24    /** Specifies whether the property is required. */
25    protected boolean required;
26  
27    /** The type of the property. */
28    protected String type;
29  
30  
31    /* Constants. */
32  
33  
34    /** Constants for the type of properties. */
35    public interface Type
36    {
37      public static String Undefined  = "";
38      public static String Boolean  = "Boolean";
39      public static String Byte    = "Byte";
40      public static String Short    = "Short";
41      public static String Integer  = "Integer";
42      public static String Long    = "Long";
43      public static String Float    = "Float";
44      public static String Double    = "Double";
45      public static String String    = "String";
46    }
47  
48  
49    /* Constructors. */
50  
51  
52    /**
53     * Constructs a <code>SignatureProperty</code> instance.
54     *
55     */
56  
57    public SignatureProperty()
58    {
59      super();
60  
61      required = false;
62      type = Type.Undefined;
63    }
64  
65    /**
66     * Constructs a <code>SignatureProperty</code> instance as a copy of the one supplied.
67     *
68     * @param    property          The <code>SignatureProperty</code> to copy.
69     *
70     */
71  
72    public SignatureProperty(SignatureProperty property)
73    {
74      super(property);
75  
76      required = property.getRequired();
77      type = property.getType();
78    }
79  
80  
81    /* Accessors. */
82  
83  
84    /* Required. */
85  
86    /**
87     * Sets the required state of this property.
88     *
89     * @param    setRequired          The property's required state.
90     *
91     */
92  
93    public void setRequired(boolean setRequired)
94    {
95      required = setRequired;
96    }
97  
98    /**
99     * Returns the required state of this property.
100    *
101    * @return                  True if required, false otherwise.
102    *
103    */
104 
105   public boolean getRequired()
106   {
107     return required;
108   }
109 
110   /* Type. */
111 
112   /**
113    * Sets the type of this property.
114    *
115    * @param    setType            The property's type. See {@link Type}.
116    *
117    */
118 
119   public void setType(String setType)
120   {
121     type = setType;
122   }
123 
124   /**
125    * Returns the type of this property.
126    *
127    * @return                  The property's type. See {@link Type}.
128    *
129    */
130 
131   public String getType()
132   {
133     return type;
134   }
135 }
136