View Javadoc

1   /*
2    * Copyright (c) 2004 UNINETT FAS
3    *
4    * This program is free software; you can redistribute it and/or modify it
5    * under the terms of the GNU General Public License as published by the Free
6    * Software Foundation; either version 2 of the License, or (at your option)
7    * any later version.
8    *
9    * This program is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11   * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12   * more details.
13   *
14   * You should have received a copy of the GNU General Public License along with
15   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16   * Place - Suite 330, Boston, MA 02111-1307, USA.
17   *
18   * $Id: Attribute.java,v 1.3 2005/07/25 11:06:26 catoolsen Exp $
19   */
20  
21  package no.feide.moria.webservices.v2_2;
22  
23  import java.io.Serializable;
24  
25  /***
26   * @author Bjørn Ola Smievoll <b.o.smievoll@conduct.no>
27   * @version $Revision: 1.3 $
28   */
29  public final class Attribute
30  implements Serializable {
31  
32      /***
33       * Serial version UID (generated).
34       */
35      private static final long serialVersionUID = -3264658154719205385L;
36  
37      /*** The name of this Attribute. */
38      private String name = null;
39  
40      /***
41       * The actual separator character(s) used for encoding. Added as a field to
42       * allow it to be visible across SOAP calls.
43       */
44      private String separator = null;
45  
46      /*** The encoded values of this Attribute. */
47      private String values = null;
48  
49  
50      /***
51       * Gets the name of this attribute.
52       * @return Returns the name.
53       */
54      public String getName() {
55  
56          return name;
57      }
58  
59  
60      /***
61       * Sets the name of the attribute.
62       * @param name
63       *            The name to set.
64       */
65      public void setName(final String name) {
66  
67          this.name = name;
68      }
69  
70  
71      /***
72       * Get the actual separator value used for encoding the attribute values.
73       * @return The separator character(s).
74       */
75      public String getSeparator() {
76  
77          return separator;
78  
79      }
80      
81      
82      /***
83       * Set the actual separator value used for encoding the attribute values.
84       * @param separator The separator character(s).
85       */
86      public void setSeparator(final String separator) {
87          
88          this.separator = separator;
89          
90      }
91  
92  
93      /***
94       * Get the encoded <code>String</code> containing the values of the
95       * attribute, separated by <code>separator</code>. All natural occurences
96       * of <code>separator</code> in the original values will show up as two
97       * <code>separator</code> character sequences. Be sure to check the actual
98       * separator value using <code>getSeparator()</code>.
99       * @return The value array.
100      * @see #getSeparator()
101      */
102     public String getValues() {
103 
104         return values;
105 
106     }
107 
108 
109     /***
110      * Sets the values for the attribute. Must use the separator (given by
111      * <code>getSeparator()</code>) between the values, and any natural
112      * occurences of the separator in an attribute value must be replaced with
113      * two subsequent occurences of the separator. 
114      * @param values
115      *            The values to set.
116      * @see #getSeparator()
117      */
118     public void setValues(final String values) {
119 
120         this.values = values;
121     }
122 
123 }