src/net/fortuna/ical4j/model/property/TzId.java

Tue, 10 Feb 2015 19:58:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 10 Feb 2015 19:58:00 +0100
changeset 4
45d57ecba757
permissions
-rw-r--r--

Upgrade the upgraded ical4j component to use org.apache.commons.lang3.

     1 /**
     2  * Copyright (c) 2012, Ben Fortuna
     3  * All rights reserved.
     4  *
     5  * Redistribution and use in source and binary forms, with or without
     6  * modification, are permitted provided that the following conditions
     7  * are met:
     8  *
     9  *  o Redistributions of source code must retain the above copyright
    10  * notice, this list of conditions and the following disclaimer.
    11  *
    12  *  o Redistributions in binary form must reproduce the above copyright
    13  * notice, this list of conditions and the following disclaimer in the
    14  * documentation and/or other materials provided with the distribution.
    15  *
    16  *  o Neither the name of Ben Fortuna nor the names of any other contributors
    17  * may be used to endorse or promote products derived from this software
    18  * without specific prior written permission.
    19  *
    20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    31  */
    32 package net.fortuna.ical4j.model.property;
    34 import net.fortuna.ical4j.model.Escapable;
    35 import net.fortuna.ical4j.model.ParameterList;
    36 import net.fortuna.ical4j.model.Property;
    37 import net.fortuna.ical4j.model.PropertyFactoryImpl;
    38 import net.fortuna.ical4j.model.ValidationException;
    40 /**
    41  * $Id$
    42  * 
    43  * Created: [Apr 6, 2004]
    44  *
    45  * Defines a TZID iCalendar component property.
    46  * 
    47  * <pre>
    48  *     4.8.3.1 Time Zone Identifier
    49  *     
    50  *        Property Name: TZID
    51  *     
    52  *        Purpose: This property specifies the text value that uniquely
    53  *        identifies the &quot;VTIMEZONE&quot; calendar component.
    54  *     
    55  *        Value Type: TEXT
    56  *     
    57  *        Property Parameters: Non-standard property parameters can be
    58  *        specified on this property.
    59  *     
    60  *        Conformance: This property MUST be specified in a &quot;VTIMEZONE&quot;
    61  *        calendar component.
    62  *     
    63  *        Description: This is the label by which a time zone calendar
    64  *        component is referenced by any iCalendar properties whose data type
    65  *        is either DATE-TIME or TIME and not intended to specify a UTC or a
    66  *        &quot;floating&quot; time. The presence of the SOLIDUS character (US-ASCII
    67  *        decimal 47) as a prefix, indicates that this TZID represents an
    68  *        unique ID in a globally defined time zone registry (when such
    69  *        registry is defined).
    70  *     
    71  *             Note: This document does not define a naming convention for time
    72  *             zone identifiers. Implementers may want to use the naming
    73  *             conventions defined in existing time zone specifications such as
    74  *             the public-domain Olson database [TZ]. The specification of
    75  *             globally unique time zone identifiers is not addressed by this
    76  *             document and is left for future study.
    77  *     
    78  *        Format Definition: This property is defined by the following
    79  *        notation:
    80  *     
    81  *          tzid       = &quot;TZID&quot; tzidpropparam &quot;:&quot; [tzidprefix] text CRLF
    82  *     
    83  *          tzidpropparam      = *(&quot;;&quot; xparam)
    84  *     
    85  *          ;tzidprefix        = &quot;/&quot;
    86  *          ; Defined previously. Just listed here for reader convenience.
    87  *     
    88  *        Example: The following are examples of non-globally unique time zone
    89  *        identifiers:
    90  *     
    91  *          TZID:US-Eastern
    92  *     
    93  *          TZID:California-Los_Angeles
    94  *     
    95  *        The following is an example of a fictitious globally unique time zone
    96  *        identifier:
    97  *     
    98  *          TZID:/US-New_York-New_York
    99  * </pre>
   100  * 
   101  * @author Ben Fortuna
   102  */
   103 public class TzId extends Property implements Escapable {
   105     private static final long serialVersionUID = -522764921502407137L;
   107     /**
   108      * Timezone identifier prefix.
   109      */
   110     public static final String PREFIX = "/";
   112     private String value;
   114     /**
   115      * Default constructor.
   116      */
   117     public TzId() {
   118         super(TZID, PropertyFactoryImpl.getInstance());
   119     }
   121     /**
   122      * @param aValue a value string for this component
   123      */
   124     public TzId(final String aValue) {
   125         super(TZID, PropertyFactoryImpl.getInstance());
   126         setValue(aValue);
   127     }
   129     /**
   130      * @param aList a list of parameters for this component
   131      * @param aValue a value string for this component
   132      */
   133     public TzId(final ParameterList aList, final String aValue) {
   134         super(TZID, aList, PropertyFactoryImpl.getInstance());
   135         setValue(aValue);
   136     }
   138     /**
   139      * {@inheritDoc}
   140      */
   141     public final void setValue(final String aValue) {
   142         this.value = aValue;
   143     }
   145     /**
   146      * {@inheritDoc}
   147      */
   148     public final String getValue() {
   149         return value;
   150     }
   152     /**
   153      * {@inheritDoc}
   154      */
   155     public final void validate() throws ValidationException {
   156         // TODO: Auto-generated method stub
   157     }
   158 }

mercurial