View Javadoc

1   /*
2    * $Id: Parameter.java [Apr 5, 2004]
3    *
4    * Copyright (c) 2004, Ben Fortuna
5    * All rights reserved.
6    *
7    * Redistribution and use in source and binary forms, with or without
8    * modification, are permitted provided that the following conditions
9    * are met:
10   *
11   * 	o Redistributions of source code must retain the above copyright
12   * notice, this list of conditions and the following disclaimer.
13   *
14   * 	o Redistributions in binary form must reproduce the above copyright
15   * notice, this list of conditions and the following disclaimer in the
16   * documentation and/or other materials provided with the distribution.
17   *
18   * 	o Neither the name of Ben Fortuna nor the names of any other contributors
19   * may be used to endorse or promote products derived from this software
20   * without specific prior written permission.
21   *
22   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25   * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28   * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29   * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30   * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33   */
34  package net.fortuna.ical4j.model;
35  
36  /***
37   * Defines an iCalendar parameter. Subclasses of this class provide additional
38   * validation and typed values for specific iCalendar parameters.
39   *
40   * @author benf
41   */
42  public abstract class Parameter {
43  
44      /***
45       * Alternate text representation
46       */
47      public static final String ALTREP = "ALTREP";
48  
49      /***
50       * Common name
51       */
52      public static final String CN = "CN";
53  
54      /***
55       * Calendar user type
56       */
57      public static final String CUTYPE = "CUTYPE";
58  
59      /***
60       * Delegator
61       */
62      public static final String DELEGATED_FROM = "DELEGATED-FROM";
63  
64      /***
65       * Delegatee
66       */
67      public static final String DELEGATED_TO = "DELEGATED-TO";
68  
69      /***
70       * Directory entry
71       */
72      public static final String DIR = "DIR";
73  
74      /***
75       * Inline encoding
76       */
77      public static final String ENCODING = "ENCODING";
78  
79      /***
80       * Format type
81       */
82      public static final String FMTTYPE = "FMTTYPE";
83  
84      /***
85       * Free/busy time type
86       */
87      public static final String FBTYPE = "FBTYPE";
88  
89      /***
90       * Language for text
91       */
92      public static final String LANGUAGE = "LANGUAGE";
93  
94      /***
95       * Group or list membership
96       */
97      public static final String MEMBER = "MEMBER";
98  
99      /***
100      * Participation status
101      */
102     public static final String PARTSTAT = "PARTSTAT";
103 
104     /***
105      * Recurrence identifier range
106      */
107     public static final String RANGE = "RANGE";
108 
109     /***
110      * Alarm trigger relationship
111      */
112     public static final String RELATED = "RELATED";
113 
114     /***
115      * Relationship type
116      */
117     public static final String RELTYPE = "RELTYPE";
118 
119     /***
120      * Participation role
121      */
122     public static final String ROLE = "ROLE";
123 
124     /***
125      * RSVP expectation
126      */
127     public static final String RSVP = "RSVP";
128 
129     /***
130      * Sent by
131      */
132     public static final String SENT_BY = "SENT-BY";
133 
134     /***
135      * Reference to time zone object
136      */
137     public static final String TZID = "TZID";
138 
139     /***
140      * Property value data type
141      */
142     public static final String VALUE = "VALUE";
143 
144     private static final String EXPERIMENTAL_PREFIX = "X-";
145 
146     private String name;
147 
148     /***
149      * Constructor.
150      * @param aName name of this parameter
151      * @param aValue value of this parameter
152      */
153     public Parameter(final String aName) {
154         this.name = aName;
155     }
156 
157     /***
158      * @see java.lang.Object#toString()
159      */
160     public final String toString() {
161 
162         return getName() + "=" + getValue();
163     }
164 
165     /***
166      * @return Returns the name.
167      */
168     public final String getName() {
169         return name;
170     }
171 
172     /***
173      * @return Returns the value.
174      */
175     public abstract String getValue();
176 }