Tue, 10 Feb 2015 19:38:00 +0100
Upgrade embedded ical4j from ancient whatever to upstream version 1.0.6.
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.component;
34 import net.fortuna.ical4j.model.PropertyList;
35 import net.fortuna.ical4j.model.ValidationException;
36 import net.fortuna.ical4j.model.Validator;
37 import net.fortuna.ical4j.model.property.Method;
38 import net.fortuna.ical4j.util.CompatibilityHints;
40 /**
41 * $Id$
42 *
43 * Created on 3/11/2005
44 *
45 * Implementation of an experimental component as defined in RFC2445.
46 * @author Ben Fortuna
47 */
48 public class XComponent extends CalendarComponent {
50 private static final long serialVersionUID = -3622674849097714927L;
52 /**
53 * Creates a new experimental component with the specified name.
54 * @param name the name of the experimental component
55 */
56 public XComponent(final String name) {
57 super(name);
58 }
60 /**
61 * Creates a new experimental component with the specified name and properties.
62 * @param name the name of the experimental component
63 * @param properties a list of properties
64 */
65 public XComponent(final String name, final PropertyList properties) {
66 super(name, properties);
67 }
69 /**
70 * {@inheritDoc}
71 */
72 public final void validate(final boolean recurse)
73 throws ValidationException {
75 if (!CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_VALIDATION)
76 && !getName().startsWith(EXPERIMENTAL_PREFIX)) {
78 throw new ValidationException(
79 "Experimental components must have the following prefix: "
80 + EXPERIMENTAL_PREFIX);
81 }
83 if (recurse) {
84 validateProperties();
85 }
86 }
88 /**
89 * {@inheritDoc}
90 */
91 protected Validator getValidator(Method method) {
92 // No method validation required..
93 return EMPTY_VALIDATOR;
94 }
95 }