src/net/fortuna/ical4j/model/PropertyFactoryImpl.java

branch
ICAL4J_EMBED_1
changeset 15
cc93757aeca3
parent 14
5ae3e5665a0b
child 18
6dcaece8ec41
     1.1 --- a/src/net/fortuna/ical4j/model/PropertyFactoryImpl.java	Thu Feb 12 18:02:00 2015 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,1014 +0,0 @@
     1.4 -/**
     1.5 - * Copyright (c) 2012, Ben Fortuna
     1.6 - * All rights reserved.
     1.7 - *
     1.8 - * Redistribution and use in source and binary forms, with or without
     1.9 - * modification, are permitted provided that the following conditions
    1.10 - * are met:
    1.11 - *
    1.12 - *  o Redistributions of source code must retain the above copyright
    1.13 - * notice, this list of conditions and the following disclaimer.
    1.14 - *
    1.15 - *  o Redistributions in binary form must reproduce the above copyright
    1.16 - * notice, this list of conditions and the following disclaimer in the
    1.17 - * documentation and/or other materials provided with the distribution.
    1.18 - *
    1.19 - *  o Neither the name of Ben Fortuna nor the names of any other contributors
    1.20 - * may be used to endorse or promote products derived from this software
    1.21 - * without specific prior written permission.
    1.22 - *
    1.23 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    1.24 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    1.25 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    1.26 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    1.27 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    1.28 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    1.29 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    1.30 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    1.31 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    1.32 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    1.33 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.34 - */
    1.35 -package net.fortuna.ical4j.model;
    1.36 -
    1.37 -import java.io.IOException;
    1.38 -import java.net.URISyntaxException;
    1.39 -import java.text.ParseException;
    1.40 -
    1.41 -import net.fortuna.ical4j.model.property.Action;
    1.42 -import net.fortuna.ical4j.model.property.Attach;
    1.43 -import net.fortuna.ical4j.model.property.Attendee;
    1.44 -import net.fortuna.ical4j.model.property.CalScale;
    1.45 -import net.fortuna.ical4j.model.property.Categories;
    1.46 -import net.fortuna.ical4j.model.property.Clazz;
    1.47 -import net.fortuna.ical4j.model.property.Comment;
    1.48 -import net.fortuna.ical4j.model.property.Completed;
    1.49 -import net.fortuna.ical4j.model.property.Contact;
    1.50 -import net.fortuna.ical4j.model.property.Country;
    1.51 -import net.fortuna.ical4j.model.property.Created;
    1.52 -import net.fortuna.ical4j.model.property.Description;
    1.53 -import net.fortuna.ical4j.model.property.DtEnd;
    1.54 -import net.fortuna.ical4j.model.property.DtStamp;
    1.55 -import net.fortuna.ical4j.model.property.DtStart;
    1.56 -import net.fortuna.ical4j.model.property.Due;
    1.57 -import net.fortuna.ical4j.model.property.Duration;
    1.58 -import net.fortuna.ical4j.model.property.ExDate;
    1.59 -import net.fortuna.ical4j.model.property.ExRule;
    1.60 -import net.fortuna.ical4j.model.property.ExtendedAddress;
    1.61 -import net.fortuna.ical4j.model.property.FreeBusy;
    1.62 -import net.fortuna.ical4j.model.property.Geo;
    1.63 -import net.fortuna.ical4j.model.property.LastModified;
    1.64 -import net.fortuna.ical4j.model.property.Locality;
    1.65 -import net.fortuna.ical4j.model.property.Location;
    1.66 -import net.fortuna.ical4j.model.property.LocationType;
    1.67 -import net.fortuna.ical4j.model.property.Method;
    1.68 -import net.fortuna.ical4j.model.property.Name;
    1.69 -import net.fortuna.ical4j.model.property.Organizer;
    1.70 -import net.fortuna.ical4j.model.property.PercentComplete;
    1.71 -import net.fortuna.ical4j.model.property.Postalcode;
    1.72 -import net.fortuna.ical4j.model.property.Priority;
    1.73 -import net.fortuna.ical4j.model.property.ProdId;
    1.74 -import net.fortuna.ical4j.model.property.RDate;
    1.75 -import net.fortuna.ical4j.model.property.RRule;
    1.76 -import net.fortuna.ical4j.model.property.RecurrenceId;
    1.77 -import net.fortuna.ical4j.model.property.Region;
    1.78 -import net.fortuna.ical4j.model.property.RelatedTo;
    1.79 -import net.fortuna.ical4j.model.property.Repeat;
    1.80 -import net.fortuna.ical4j.model.property.RequestStatus;
    1.81 -import net.fortuna.ical4j.model.property.Resources;
    1.82 -import net.fortuna.ical4j.model.property.Sequence;
    1.83 -import net.fortuna.ical4j.model.property.Status;
    1.84 -import net.fortuna.ical4j.model.property.StreetAddress;
    1.85 -import net.fortuna.ical4j.model.property.Summary;
    1.86 -import net.fortuna.ical4j.model.property.Tel;
    1.87 -import net.fortuna.ical4j.model.property.Transp;
    1.88 -import net.fortuna.ical4j.model.property.Trigger;
    1.89 -import net.fortuna.ical4j.model.property.TzId;
    1.90 -import net.fortuna.ical4j.model.property.TzName;
    1.91 -import net.fortuna.ical4j.model.property.TzOffsetFrom;
    1.92 -import net.fortuna.ical4j.model.property.TzOffsetTo;
    1.93 -import net.fortuna.ical4j.model.property.TzUrl;
    1.94 -import net.fortuna.ical4j.model.property.Uid;
    1.95 -import net.fortuna.ical4j.model.property.Url;
    1.96 -import net.fortuna.ical4j.model.property.Version;
    1.97 -import net.fortuna.ical4j.model.property.XProperty;
    1.98 -
    1.99 -/**
   1.100 - * A factory for creating iCalendar properties. Note that if relaxed parsing is enabled (via specifying the system
   1.101 - * property: icalj.parsing.relaxed=true) illegal property names are allowed.
   1.102 - * 
   1.103 - * @author Ben Fortuna
   1.104 - * 
   1.105 - * $Id$ [05-Apr-2004]
   1.106 - */
   1.107 -public class PropertyFactoryImpl extends AbstractContentFactory implements PropertyFactory {
   1.108 -
   1.109 -    private static final long serialVersionUID = -7174232004486979641L;
   1.110 -    
   1.111 -    private static PropertyFactoryImpl instance = new PropertyFactoryImpl();
   1.112 -
   1.113 -    /**
   1.114 -     * Constructor made private to prevent instantiation.
   1.115 -     */
   1.116 -    protected PropertyFactoryImpl() {
   1.117 -        registerDefaultFactory(Property.ACTION, new ActionFactory());
   1.118 -        registerDefaultFactory(Property.ATTACH, new AttachFactory());
   1.119 -        registerDefaultFactory(Property.ATTENDEE, new AttendeeFactory());
   1.120 -        registerDefaultFactory(Property.CALSCALE, new CalScaleFactory());
   1.121 -        registerDefaultFactory(Property.CATEGORIES, new CategoriesFactory());
   1.122 -        registerDefaultFactory(Property.CLASS, new ClazzFactory());
   1.123 -        registerDefaultFactory(Property.COMMENT, new CommentFactory());
   1.124 -        registerDefaultFactory(Property.COMPLETED, new CompletedFactory());
   1.125 -        registerDefaultFactory(Property.CONTACT, new ContactFactory());
   1.126 -        registerDefaultFactory(Property.COUNTRY, new CountryFactory());
   1.127 -        registerDefaultFactory(Property.CREATED, new CreatedFactory());
   1.128 -        registerDefaultFactory(Property.DESCRIPTION, new DescriptionFactory());
   1.129 -        registerDefaultFactory(Property.DTEND, new DtEndFactory());
   1.130 -        registerDefaultFactory(Property.DTSTAMP, new DtStampFactory());
   1.131 -        registerDefaultFactory(Property.DTSTART, new DtStartFactory());
   1.132 -        registerDefaultFactory(Property.DUE, new DueFactory());
   1.133 -        registerDefaultFactory(Property.DURATION, new DurationFactory());
   1.134 -        registerDefaultFactory(Property.EXDATE, new ExDateFactory());
   1.135 -        registerDefaultFactory(Property.EXRULE, new ExRuleFactory());
   1.136 -        registerDefaultFactory(Property.EXTENDED_ADDRESS, new ExtendedAddressFactory());
   1.137 -        registerDefaultFactory(Property.FREEBUSY, new FreeBusyFactory());
   1.138 -        registerDefaultFactory(Property.GEO, new GeoFactory());
   1.139 -        registerDefaultFactory(Property.LAST_MODIFIED, new LastModifiedFactory());
   1.140 -        registerDefaultFactory(Property.LOCALITY, new LocalityFactory());
   1.141 -        registerDefaultFactory(Property.LOCATION, new LocationFactory());
   1.142 -        registerDefaultFactory(Property.LOCATION_TYPE, new LocationTypeFactory());
   1.143 -        registerDefaultFactory(Property.METHOD, new MethodFactory());
   1.144 -        registerDefaultFactory(Property.NAME, new NameFactory());
   1.145 -        registerDefaultFactory(Property.ORGANIZER, new OrganizerFactory());
   1.146 -        registerDefaultFactory(Property.PERCENT_COMPLETE, new PercentCompleteFactory());
   1.147 -        registerDefaultFactory(Property.POSTALCODE, new PostalcodeFactory());
   1.148 -        registerDefaultFactory(Property.PRIORITY, new PriorityFactory());
   1.149 -        registerDefaultFactory(Property.PRODID, new ProdIdFactory());
   1.150 -        registerDefaultFactory(Property.RDATE, new RDateFactory());
   1.151 -        registerDefaultFactory(Property.RECURRENCE_ID, new RecurrenceIdFactory());
   1.152 -        registerDefaultFactory(Property.REGION, new RegionFactory());
   1.153 -        registerDefaultFactory(Property.RELATED_TO, new RelatedToFactory());
   1.154 -        registerDefaultFactory(Property.REPEAT, new RepeatFactory());
   1.155 -        registerDefaultFactory(Property.REQUEST_STATUS, new RequestStatusFactory());
   1.156 -        registerDefaultFactory(Property.RESOURCES, new ResourcesFactory());
   1.157 -        registerDefaultFactory(Property.RRULE, new RRuleFactory());
   1.158 -        registerDefaultFactory(Property.SEQUENCE, new SequenceFactory());
   1.159 -        registerDefaultFactory(Property.STATUS, new StatusFactory());
   1.160 -        registerDefaultFactory(Property.STREET_ADDRESS, new StreetAddressFactory());
   1.161 -        registerDefaultFactory(Property.SUMMARY, new SummaryFactory());
   1.162 -        registerDefaultFactory(Property.TEL, new TelFactory());
   1.163 -        registerDefaultFactory(Property.TRANSP, new TranspFactory());
   1.164 -        registerDefaultFactory(Property.TRIGGER, new TriggerFactory());
   1.165 -        registerDefaultFactory(Property.TZID, new TzIdFactory());
   1.166 -        registerDefaultFactory(Property.TZNAME, new TzNameFactory());
   1.167 -        registerDefaultFactory(Property.TZOFFSETFROM, new TzOffsetFromFactory());
   1.168 -        registerDefaultFactory(Property.TZOFFSETTO, new TzOffsetToFactory());
   1.169 -        registerDefaultFactory(Property.TZURL, new TzUrlFactory());
   1.170 -        registerDefaultFactory(Property.UID, new UidFactory());
   1.171 -        registerDefaultFactory(Property.URL, new UrlFactory());
   1.172 -        registerDefaultFactory(Property.VERSION, new VersionFactory());
   1.173 -    }
   1.174 -
   1.175 -    private static class ActionFactory implements PropertyFactory {
   1.176 -        private static final long serialVersionUID = 1L;
   1.177 -
   1.178 -        public Property createProperty(final String name,
   1.179 -                final ParameterList parameters, final String value)
   1.180 -                throws IOException, URISyntaxException, ParseException {
   1.181 -            return new Action(parameters, value);
   1.182 -        }
   1.183 -
   1.184 -        public Property createProperty(final String name) {
   1.185 -            return new Action();
   1.186 -        }
   1.187 -    }
   1.188 -
   1.189 -    private static class AttachFactory implements PropertyFactory {
   1.190 -        private static final long serialVersionUID = 1L;
   1.191 -
   1.192 -        public Property createProperty(final String name,
   1.193 -                final ParameterList parameters, final String value)
   1.194 -                throws IOException, URISyntaxException, ParseException {
   1.195 -            return new Attach(parameters, value);
   1.196 -        }
   1.197 -
   1.198 -        public Property createProperty(final String name) {
   1.199 -            return new Attach();
   1.200 -        }
   1.201 -    }
   1.202 -
   1.203 -    private static class AttendeeFactory implements PropertyFactory {
   1.204 -        private static final long serialVersionUID = 1L;
   1.205 -
   1.206 -        public Property createProperty(final String name,
   1.207 -                final ParameterList parameters, final String value)
   1.208 -                throws IOException, URISyntaxException, ParseException {
   1.209 -            return new Attendee(parameters, value);
   1.210 -        }
   1.211 -
   1.212 -        public Property createProperty(final String name) {
   1.213 -            return new Attendee();
   1.214 -        }
   1.215 -    }
   1.216 -
   1.217 -    private static class CalScaleFactory implements PropertyFactory {
   1.218 -        private static final long serialVersionUID = 1L;
   1.219 -
   1.220 -        public Property createProperty(final String name,
   1.221 -                final ParameterList parameters, final String value)
   1.222 -                throws IOException, URISyntaxException, ParseException {
   1.223 -            return new CalScale(parameters, value);
   1.224 -        }
   1.225 -
   1.226 -        public Property createProperty(final String name) {
   1.227 -            return new CalScale();
   1.228 -        }
   1.229 -    }
   1.230 -
   1.231 -    private static class CategoriesFactory implements PropertyFactory {
   1.232 -        private static final long serialVersionUID = 1L;
   1.233 -
   1.234 -        public Property createProperty(final String name,
   1.235 -                final ParameterList parameters, final String value)
   1.236 -                throws IOException, URISyntaxException, ParseException {
   1.237 -            return new Categories(parameters, value);
   1.238 -        }
   1.239 -
   1.240 -        public Property createProperty(final String name) {
   1.241 -            return new Categories();
   1.242 -        }
   1.243 -    }
   1.244 -
   1.245 -    private static class ClazzFactory implements PropertyFactory {
   1.246 -        private static final long serialVersionUID = 1L;
   1.247 -
   1.248 -        public Property createProperty(final String name,
   1.249 -                final ParameterList parameters, final String value)
   1.250 -                throws IOException, URISyntaxException, ParseException {
   1.251 -            return new Clazz(parameters, value);
   1.252 -        }
   1.253 -
   1.254 -        public Property createProperty(final String name) {
   1.255 -            return new Clazz();
   1.256 -        }
   1.257 -    }
   1.258 -
   1.259 -    private static class CommentFactory implements PropertyFactory {
   1.260 -        private static final long serialVersionUID = 1L;
   1.261 -
   1.262 -        public Property createProperty(final String name,
   1.263 -                final ParameterList parameters, final String value)
   1.264 -                throws IOException, URISyntaxException, ParseException {
   1.265 -            return new Comment(parameters, value);
   1.266 -        }
   1.267 -
   1.268 -        public Property createProperty(final String name) {
   1.269 -            return new Comment();
   1.270 -        }
   1.271 -    }
   1.272 -
   1.273 -    private static class CompletedFactory implements PropertyFactory {
   1.274 -        private static final long serialVersionUID = 1L;
   1.275 -
   1.276 -        public Property createProperty(final String name,
   1.277 -                final ParameterList parameters, final String value)
   1.278 -                throws IOException, URISyntaxException, ParseException {
   1.279 -            return new Completed(parameters, value);
   1.280 -        }
   1.281 -
   1.282 -        public Property createProperty(final String name) {
   1.283 -            return new Completed();
   1.284 -        }
   1.285 -    }
   1.286 -
   1.287 -    private static class ContactFactory implements PropertyFactory {
   1.288 -        private static final long serialVersionUID = 1L;
   1.289 -
   1.290 -        public Property createProperty(final String name,
   1.291 -                final ParameterList parameters, final String value)
   1.292 -                throws IOException, URISyntaxException, ParseException {
   1.293 -            return new Contact(parameters, value);
   1.294 -        }
   1.295 -
   1.296 -        public Property createProperty(final String name) {
   1.297 -            return new Contact();
   1.298 -        }
   1.299 -    }
   1.300 -
   1.301 -    private static class CountryFactory implements PropertyFactory {
   1.302 -        private static final long serialVersionUID = 1L;
   1.303 -
   1.304 -        public Property createProperty(final String name,
   1.305 -                final ParameterList parameters, final String value)
   1.306 -                throws IOException, URISyntaxException, ParseException {
   1.307 -            return new Country(parameters, value);
   1.308 -        }
   1.309 -
   1.310 -        public Property createProperty(final String name) {
   1.311 -            return new Country();
   1.312 -        }
   1.313 -    }
   1.314 -
   1.315 -    private static class CreatedFactory implements PropertyFactory {
   1.316 -        private static final long serialVersionUID = 1L;
   1.317 -
   1.318 -        public Property createProperty(final String name,
   1.319 -                final ParameterList parameters, final String value)
   1.320 -                throws IOException, URISyntaxException, ParseException {
   1.321 -            return new Created(parameters, value);
   1.322 -        }
   1.323 -
   1.324 -        public Property createProperty(final String name) {
   1.325 -            return new Created();
   1.326 -        }
   1.327 -    }
   1.328 -
   1.329 -    private static class DescriptionFactory implements PropertyFactory {
   1.330 -        private static final long serialVersionUID = 1L;
   1.331 -
   1.332 -        public Property createProperty(final String name,
   1.333 -                final ParameterList parameters, final String value)
   1.334 -                throws IOException, URISyntaxException, ParseException {
   1.335 -            return new Description(parameters, value);
   1.336 -        }
   1.337 -
   1.338 -        public Property createProperty(final String name) {
   1.339 -            return new Description();
   1.340 -        }
   1.341 -    }
   1.342 -
   1.343 -    private static class DtEndFactory implements PropertyFactory {
   1.344 -        private static final long serialVersionUID = 1L;
   1.345 -
   1.346 -        public Property createProperty(final String name,
   1.347 -                final ParameterList parameters, final String value)
   1.348 -                throws IOException, URISyntaxException, ParseException {
   1.349 -            return new DtEnd(parameters, value);
   1.350 -        }
   1.351 -
   1.352 -        public Property createProperty(final String name) {
   1.353 -            return new DtEnd();
   1.354 -        }
   1.355 -    }
   1.356 -
   1.357 -    private static class DtStampFactory implements PropertyFactory {
   1.358 -        private static final long serialVersionUID = 1L;
   1.359 -
   1.360 -        public Property createProperty(final String name,
   1.361 -                final ParameterList parameters, final String value)
   1.362 -                throws IOException, URISyntaxException, ParseException {
   1.363 -            return new DtStamp(parameters, value);
   1.364 -        }
   1.365 -
   1.366 -        public Property createProperty(final String name) {
   1.367 -            return new DtStamp();
   1.368 -        }
   1.369 -    }
   1.370 -
   1.371 -    private static class DtStartFactory implements PropertyFactory {
   1.372 -        private static final long serialVersionUID = 1L;
   1.373 -
   1.374 -        public Property createProperty(final String name,
   1.375 -                final ParameterList parameters, final String value)
   1.376 -                throws IOException, URISyntaxException, ParseException {
   1.377 -            return new DtStart(parameters, value);
   1.378 -        }
   1.379 -
   1.380 -        public Property createProperty(final String name) {
   1.381 -            return new DtStart();
   1.382 -        }
   1.383 -    }
   1.384 -
   1.385 -    private static class DueFactory implements PropertyFactory {
   1.386 -        private static final long serialVersionUID = 1L;
   1.387 -
   1.388 -        public Property createProperty(final String name,
   1.389 -                final ParameterList parameters, final String value)
   1.390 -                throws IOException, URISyntaxException, ParseException {
   1.391 -            return new Due(parameters, value);
   1.392 -        }
   1.393 -
   1.394 -        public Property createProperty(final String name) {
   1.395 -            return new Due();
   1.396 -        }
   1.397 -    }
   1.398 -
   1.399 -    private static class DurationFactory implements PropertyFactory {
   1.400 -        private static final long serialVersionUID = 1L;
   1.401 -
   1.402 -        public Property createProperty(final String name,
   1.403 -                final ParameterList parameters, final String value)
   1.404 -                throws IOException, URISyntaxException, ParseException {
   1.405 -            return new Duration(parameters, value);
   1.406 -        }
   1.407 -
   1.408 -        public Property createProperty(final String name) {
   1.409 -            return new Duration();
   1.410 -        }
   1.411 -    }
   1.412 -
   1.413 -    private static class ExDateFactory implements PropertyFactory {
   1.414 -        private static final long serialVersionUID = 1L;
   1.415 -
   1.416 -        public Property createProperty(final String name,
   1.417 -               final ParameterList parameters, final String value)
   1.418 -                throws IOException, URISyntaxException, ParseException {
   1.419 -            return new ExDate(parameters, value);
   1.420 -        }
   1.421 -
   1.422 -        public Property createProperty(final String name) {
   1.423 -            return new ExDate();
   1.424 -        }
   1.425 -    }
   1.426 -
   1.427 -    private static class ExRuleFactory implements PropertyFactory {
   1.428 -        private static final long serialVersionUID = 1L;
   1.429 -
   1.430 -        public Property createProperty(final String name,
   1.431 -                final ParameterList parameters, final String value)
   1.432 -                throws IOException, URISyntaxException, ParseException {
   1.433 -            return new ExRule(parameters, value);
   1.434 -        }
   1.435 -
   1.436 -        public Property createProperty(final String name) {
   1.437 -            return new ExRule();
   1.438 -        }
   1.439 -    }
   1.440 -
   1.441 -    private static class ExtendedAddressFactory implements PropertyFactory {
   1.442 -        private static final long serialVersionUID = 1L;
   1.443 -
   1.444 -        public Property createProperty(final String name,
   1.445 -                final ParameterList parameters, final String value)
   1.446 -                throws IOException, URISyntaxException, ParseException {
   1.447 -            return new ExtendedAddress(parameters, value);
   1.448 -        }
   1.449 -
   1.450 -        public Property createProperty(final String name) {
   1.451 -            return new ExtendedAddress();
   1.452 -        }
   1.453 -    }
   1.454 -
   1.455 -    private static class FreeBusyFactory implements PropertyFactory {
   1.456 -        private static final long serialVersionUID = 1L;
   1.457 -
   1.458 -        public Property createProperty(final String name,
   1.459 -                final ParameterList parameters, final String value)
   1.460 -                throws IOException, URISyntaxException, ParseException {
   1.461 -            return new FreeBusy(parameters, value);
   1.462 -        }
   1.463 -
   1.464 -        public Property createProperty(final String name) {
   1.465 -            return new FreeBusy();
   1.466 -        }
   1.467 -    }
   1.468 -
   1.469 -    private static class GeoFactory implements PropertyFactory {
   1.470 -        private static final long serialVersionUID = 1L;
   1.471 -
   1.472 -        public Property createProperty(final String name,
   1.473 -                final ParameterList parameters, final String value)
   1.474 -                throws IOException, URISyntaxException, ParseException {
   1.475 -            return new Geo(parameters, value);
   1.476 -        }
   1.477 -
   1.478 -        public Property createProperty(final String name) {
   1.479 -            return new Geo();
   1.480 -        }
   1.481 -    }
   1.482 -
   1.483 -    private static class LastModifiedFactory implements PropertyFactory {
   1.484 -        private static final long serialVersionUID = 1L;
   1.485 -
   1.486 -        public Property createProperty(final String name,
   1.487 -                final ParameterList parameters, final String value)
   1.488 -                throws IOException, URISyntaxException, ParseException {
   1.489 -            return new LastModified(parameters, value);
   1.490 -        }
   1.491 -
   1.492 -        public Property createProperty(final String name) {
   1.493 -            return new LastModified();
   1.494 -        }
   1.495 -    }
   1.496 -
   1.497 -    private static class LocalityFactory implements PropertyFactory {
   1.498 -        private static final long serialVersionUID = 1L;
   1.499 -
   1.500 -        public Property createProperty(final String name,
   1.501 -                final ParameterList parameters, final String value)
   1.502 -                throws IOException, URISyntaxException, ParseException {
   1.503 -            return new Locality(parameters, value);
   1.504 -        }
   1.505 -
   1.506 -        public Property createProperty(final String name) {
   1.507 -            return new Locality();
   1.508 -        }
   1.509 -    }
   1.510 -
   1.511 -    private static class LocationFactory implements PropertyFactory {
   1.512 -        private static final long serialVersionUID = 1L;
   1.513 -
   1.514 -        public Property createProperty(final String name,
   1.515 -                final ParameterList parameters, final String value)
   1.516 -                throws IOException, URISyntaxException, ParseException {
   1.517 -            return new Location(parameters, value);
   1.518 -        }
   1.519 -
   1.520 -        public Property createProperty(final String name) {
   1.521 -            return new Location();
   1.522 -        }
   1.523 -    }
   1.524 -
   1.525 -    private static class LocationTypeFactory implements PropertyFactory {
   1.526 -        private static final long serialVersionUID = 1L;
   1.527 -
   1.528 -        public Property createProperty(final String name,
   1.529 -                final ParameterList parameters, final String value)
   1.530 -                throws IOException, URISyntaxException, ParseException {
   1.531 -            return new LocationType(parameters, value);
   1.532 -        }
   1.533 -
   1.534 -        public Property createProperty(final String name) {
   1.535 -            return new LocationType();
   1.536 -        }
   1.537 -    }
   1.538 -
   1.539 -    private static class MethodFactory implements PropertyFactory {
   1.540 -        private static final long serialVersionUID = 1L;
   1.541 -
   1.542 -        public Property createProperty(final String name,
   1.543 -                final ParameterList parameters, final String value)
   1.544 -                throws IOException, URISyntaxException, ParseException {
   1.545 -            return new Method(parameters, value);
   1.546 -        }
   1.547 -
   1.548 -        public Property createProperty(final String name) {
   1.549 -            return new Method();
   1.550 -        }
   1.551 -    }
   1.552 -
   1.553 -    private static class NameFactory implements PropertyFactory {
   1.554 -        private static final long serialVersionUID = 1L;
   1.555 -
   1.556 -        public Property createProperty(final String name,
   1.557 -                final ParameterList parameters, final String value)
   1.558 -                throws IOException, URISyntaxException, ParseException {
   1.559 -            return new Name(parameters, value);
   1.560 -        }
   1.561 -
   1.562 -        public Property createProperty(final String name) {
   1.563 -            return new Name();
   1.564 -        }
   1.565 -    }
   1.566 -
   1.567 -    private static class OrganizerFactory implements PropertyFactory {
   1.568 -        private static final long serialVersionUID = 1L;
   1.569 -
   1.570 -        public Property createProperty(final String name,
   1.571 -                final ParameterList parameters, final String value)
   1.572 -                throws IOException, URISyntaxException, ParseException {
   1.573 -            return new Organizer(parameters, value);
   1.574 -        }
   1.575 -
   1.576 -        public Property createProperty(final String name) {
   1.577 -            return new Organizer();
   1.578 -        }
   1.579 -    }
   1.580 -
   1.581 -    private static class PercentCompleteFactory implements PropertyFactory {
   1.582 -        private static final long serialVersionUID = 1L;
   1.583 -
   1.584 -        public Property createProperty(final String name,
   1.585 -                final ParameterList parameters, final String value)
   1.586 -                throws IOException, URISyntaxException, ParseException {
   1.587 -            return new PercentComplete(parameters, value);
   1.588 -        }
   1.589 -
   1.590 -        public Property createProperty(final String name) {
   1.591 -            return new PercentComplete();
   1.592 -        }
   1.593 -    }
   1.594 -
   1.595 -    private static class PostalcodeFactory implements PropertyFactory {
   1.596 -        private static final long serialVersionUID = 1L;
   1.597 -
   1.598 -        public Property createProperty(final String name,
   1.599 -                final ParameterList parameters, final String value)
   1.600 -                throws IOException, URISyntaxException, ParseException {
   1.601 -            return new Postalcode(parameters, value);
   1.602 -        }
   1.603 -
   1.604 -        public Property createProperty(final String name) {
   1.605 -            return new Postalcode();
   1.606 -        }
   1.607 -    }
   1.608 -
   1.609 -    private static class PriorityFactory implements PropertyFactory {
   1.610 -        private static final long serialVersionUID = 1L;
   1.611 -
   1.612 -        public Property createProperty(final String name,
   1.613 -                final ParameterList parameters, final String value)
   1.614 -                throws IOException, URISyntaxException, ParseException {
   1.615 -            return new Priority(parameters, value);
   1.616 -        }
   1.617 -
   1.618 -        public Property createProperty(final String name) {
   1.619 -            return new Priority();
   1.620 -        }
   1.621 -    }
   1.622 -
   1.623 -    private static class ProdIdFactory implements PropertyFactory {
   1.624 -        private static final long serialVersionUID = 1L;
   1.625 -
   1.626 -        public Property createProperty(final String name,
   1.627 -                final ParameterList parameters, final String value)
   1.628 -                throws IOException, URISyntaxException, ParseException {
   1.629 -            return new ProdId(parameters, value);
   1.630 -        }
   1.631 -
   1.632 -        public Property createProperty(final String name) {
   1.633 -            return new ProdId();
   1.634 -        }
   1.635 -    }
   1.636 -
   1.637 -    private static class RDateFactory implements PropertyFactory {
   1.638 -        private static final long serialVersionUID = 1L;
   1.639 -
   1.640 -        public Property createProperty(final String name,
   1.641 -                final ParameterList parameters, final String value)
   1.642 -                throws IOException, URISyntaxException, ParseException {
   1.643 -            return new RDate(parameters, value);
   1.644 -        }
   1.645 -
   1.646 -        public Property createProperty(final String name) {
   1.647 -            return new RDate();
   1.648 -        }
   1.649 -    }
   1.650 -
   1.651 -    private static class RecurrenceIdFactory implements PropertyFactory {
   1.652 -        private static final long serialVersionUID = 1L;
   1.653 -
   1.654 -        public Property createProperty(final String name,
   1.655 -                final ParameterList parameters, final String value)
   1.656 -                throws IOException, URISyntaxException, ParseException {
   1.657 -            return new RecurrenceId(parameters, value);
   1.658 -        }
   1.659 -
   1.660 -        public Property createProperty(final String name) {
   1.661 -            return new RecurrenceId();
   1.662 -        }
   1.663 -    }
   1.664 -
   1.665 -    private static class RegionFactory implements PropertyFactory {
   1.666 -        private static final long serialVersionUID = 1L;
   1.667 -
   1.668 -        public Property createProperty(final String name,
   1.669 -                final ParameterList parameters, final String value)
   1.670 -                throws IOException, URISyntaxException, ParseException {
   1.671 -            return new Region(parameters, value);
   1.672 -        }
   1.673 -
   1.674 -        public Property createProperty(final String name) {
   1.675 -            return new Region();
   1.676 -        }
   1.677 -    }
   1.678 -
   1.679 -    private static class RelatedToFactory implements PropertyFactory {
   1.680 -        private static final long serialVersionUID = 1L;
   1.681 -
   1.682 -        public Property createProperty(final String name,
   1.683 -                final ParameterList parameters, final String value)
   1.684 -                throws IOException, URISyntaxException, ParseException {
   1.685 -            return new RelatedTo(parameters, value);
   1.686 -        }
   1.687 -
   1.688 -        public Property createProperty(final String name) {
   1.689 -            return new RelatedTo();
   1.690 -        }
   1.691 -    }
   1.692 -
   1.693 -    private static class RepeatFactory implements PropertyFactory {
   1.694 -        private static final long serialVersionUID = 1L;
   1.695 -
   1.696 -        public Property createProperty(final String name,
   1.697 -                final ParameterList parameters, final String value)
   1.698 -                throws IOException, URISyntaxException, ParseException {
   1.699 -            return new Repeat(parameters, value);
   1.700 -        }
   1.701 -
   1.702 -        public Property createProperty(final String name) {
   1.703 -            return new Repeat();
   1.704 -        }
   1.705 -    }
   1.706 -
   1.707 -    private static class RequestStatusFactory implements PropertyFactory {
   1.708 -        private static final long serialVersionUID = 1L;
   1.709 -
   1.710 -        public Property createProperty(final String name,
   1.711 -                final ParameterList parameters, final String value)
   1.712 -                throws IOException, URISyntaxException, ParseException {
   1.713 -            return new RequestStatus(parameters, value);
   1.714 -        }
   1.715 -
   1.716 -        public Property createProperty(final String name) {
   1.717 -            return new RequestStatus();
   1.718 -        }
   1.719 -    }
   1.720 -
   1.721 -    private static class ResourcesFactory implements PropertyFactory {
   1.722 -        private static final long serialVersionUID = 1L;
   1.723 -
   1.724 -        public Property createProperty(final String name,
   1.725 -                final ParameterList parameters, final String value)
   1.726 -                throws IOException, URISyntaxException, ParseException {
   1.727 -            return new Resources(parameters, value);
   1.728 -        }
   1.729 -
   1.730 -        public Property createProperty(final String name) {
   1.731 -            return new Resources();
   1.732 -        }
   1.733 -    }
   1.734 -
   1.735 -    private static class RRuleFactory implements PropertyFactory {
   1.736 -        private static final long serialVersionUID = 1L;
   1.737 -
   1.738 -        public Property createProperty(final String name,
   1.739 -                final ParameterList parameters, final String value)
   1.740 -                throws IOException, URISyntaxException, ParseException {
   1.741 -            return new RRule(parameters, value);
   1.742 -        }
   1.743 -
   1.744 -        public Property createProperty(final String name) {
   1.745 -            return new RRule();
   1.746 -        }
   1.747 -    }
   1.748 -
   1.749 -    private static class SequenceFactory implements PropertyFactory {
   1.750 -        private static final long serialVersionUID = 1L;
   1.751 -
   1.752 -        public Property createProperty(final String name,
   1.753 -                final ParameterList parameters, final String value)
   1.754 -                throws IOException, URISyntaxException, ParseException {
   1.755 -            return new Sequence(parameters, value);
   1.756 -        }
   1.757 -
   1.758 -        public Property createProperty(final String name) {
   1.759 -            return new Sequence();
   1.760 -        }
   1.761 -    }
   1.762 -
   1.763 -    private static class StatusFactory implements PropertyFactory {
   1.764 -        private static final long serialVersionUID = 1L;
   1.765 -
   1.766 -        public Property createProperty(final String name,
   1.767 -                final ParameterList parameters, final String value)
   1.768 -                throws IOException, URISyntaxException, ParseException {
   1.769 -            return new Status(parameters, value);
   1.770 -        }
   1.771 -
   1.772 -        public Property createProperty(final String name) {
   1.773 -            return new Status();
   1.774 -        }
   1.775 -    }
   1.776 -
   1.777 -    private static class StreetAddressFactory implements PropertyFactory {
   1.778 -        private static final long serialVersionUID = 1L;
   1.779 -
   1.780 -        public Property createProperty(final String name,
   1.781 -                final ParameterList parameters, final String value)
   1.782 -                throws IOException, URISyntaxException, ParseException {
   1.783 -            return new StreetAddress(parameters, value);
   1.784 -        }
   1.785 -
   1.786 -        public Property createProperty(final String name) {
   1.787 -            return new StreetAddress();
   1.788 -        }
   1.789 -    }
   1.790 -
   1.791 -    private static class SummaryFactory implements PropertyFactory {
   1.792 -        private static final long serialVersionUID = 1L;
   1.793 -
   1.794 -        public Property createProperty(final String name,
   1.795 -                final ParameterList parameters, final String value)
   1.796 -                throws IOException, URISyntaxException, ParseException {
   1.797 -            return new Summary(parameters, value);
   1.798 -        }
   1.799 -
   1.800 -        public Property createProperty(final String name) {
   1.801 -            return new Summary();
   1.802 -        }
   1.803 -    }
   1.804 -
   1.805 -    private static class TelFactory implements PropertyFactory {
   1.806 -        private static final long serialVersionUID = 1L;
   1.807 -
   1.808 -        public Property createProperty(final String name,
   1.809 -                final ParameterList parameters, final String value)
   1.810 -                throws IOException, URISyntaxException, ParseException {
   1.811 -            return new Tel(parameters, value);
   1.812 -        }
   1.813 -
   1.814 -        public Property createProperty(final String name) {
   1.815 -            return new Tel();
   1.816 -        }
   1.817 -    }
   1.818 -
   1.819 -    private static class TranspFactory implements PropertyFactory {
   1.820 -        private static final long serialVersionUID = 1L;
   1.821 -
   1.822 -        public Property createProperty(final String name,
   1.823 -                final ParameterList parameters, final String value)
   1.824 -                throws IOException, URISyntaxException, ParseException {
   1.825 -            return new Transp(parameters, value);
   1.826 -        }
   1.827 -
   1.828 -        public Property createProperty(final String name) {
   1.829 -            return new Transp();
   1.830 -        }
   1.831 -    }
   1.832 -
   1.833 -    private static class TriggerFactory implements PropertyFactory {
   1.834 -        private static final long serialVersionUID = 1L;
   1.835 -
   1.836 -        public Property createProperty(final String name,
   1.837 -                final ParameterList parameters, final String value)
   1.838 -                throws IOException, URISyntaxException, ParseException {
   1.839 -            return new Trigger(parameters, value);
   1.840 -        }
   1.841 -
   1.842 -        public Property createProperty(final String name) {
   1.843 -            return new Trigger();
   1.844 -        }
   1.845 -    }
   1.846 -
   1.847 -    private static class TzIdFactory implements PropertyFactory {
   1.848 -        private static final long serialVersionUID = 1L;
   1.849 -
   1.850 -        public Property createProperty(final String name,
   1.851 -                final ParameterList parameters, final String value)
   1.852 -                throws IOException, URISyntaxException, ParseException {
   1.853 -            return new TzId(parameters, value);
   1.854 -        }
   1.855 -
   1.856 -        public Property createProperty(final String name) {
   1.857 -            return new TzId();
   1.858 -        }
   1.859 -    }
   1.860 -
   1.861 -    private static class TzNameFactory implements PropertyFactory {
   1.862 -        private static final long serialVersionUID = 1L;
   1.863 -
   1.864 -        public Property createProperty(final String name,
   1.865 -                final ParameterList parameters, final String value)
   1.866 -                throws IOException, URISyntaxException, ParseException {
   1.867 -            return new TzName(parameters, value);
   1.868 -        }
   1.869 -
   1.870 -        public Property createProperty(final String name) {
   1.871 -            return new TzName();
   1.872 -        }
   1.873 -    }
   1.874 -
   1.875 -    private static class TzOffsetFromFactory implements PropertyFactory {
   1.876 -        private static final long serialVersionUID = 1L;
   1.877 -
   1.878 -        public Property createProperty(final String name,
   1.879 -                final ParameterList parameters, final String value)
   1.880 -                throws IOException, URISyntaxException, ParseException {
   1.881 -            return new TzOffsetFrom(parameters, value);
   1.882 -        }
   1.883 -
   1.884 -        public Property createProperty(final String name) {
   1.885 -            return new TzOffsetFrom();
   1.886 -        }
   1.887 -    }
   1.888 -
   1.889 -    private static class TzOffsetToFactory implements PropertyFactory {
   1.890 -        private static final long serialVersionUID = 1L;
   1.891 -
   1.892 -        public Property createProperty(final String name,
   1.893 -                final ParameterList parameters, final String value)
   1.894 -                throws IOException, URISyntaxException, ParseException {
   1.895 -            return new TzOffsetTo(parameters, value);
   1.896 -        }
   1.897 -
   1.898 -        public Property createProperty(final String name) {
   1.899 -            return new TzOffsetTo();
   1.900 -        }
   1.901 -    }
   1.902 -
   1.903 -    private static class TzUrlFactory implements PropertyFactory {
   1.904 -        private static final long serialVersionUID = 1L;
   1.905 -
   1.906 -        public Property createProperty(final String name,
   1.907 -                final ParameterList parameters, final String value)
   1.908 -                throws IOException, URISyntaxException, ParseException {
   1.909 -            return new TzUrl(parameters, value);
   1.910 -        }
   1.911 -
   1.912 -        public Property createProperty(final String name) {
   1.913 -            return new TzUrl();
   1.914 -        }
   1.915 -    }
   1.916 -
   1.917 -    private static class UidFactory implements PropertyFactory {
   1.918 -        private static final long serialVersionUID = 1L;
   1.919 -
   1.920 -        public Property createProperty(final String name,
   1.921 -                final ParameterList parameters, final String value)
   1.922 -                throws IOException, URISyntaxException, ParseException {
   1.923 -            return new Uid(parameters, value);
   1.924 -        }
   1.925 -
   1.926 -        public Property createProperty(final String name) {
   1.927 -            return new Uid();
   1.928 -        }
   1.929 -    }
   1.930 -
   1.931 -    private static class UrlFactory implements PropertyFactory {
   1.932 -        private static final long serialVersionUID = 1L;
   1.933 -
   1.934 -        public Property createProperty(final String name,
   1.935 -                final ParameterList parameters, final String value)
   1.936 -                throws IOException, URISyntaxException, ParseException {
   1.937 -            return new Url(parameters, value);
   1.938 -        }
   1.939 -
   1.940 -        public Property createProperty(final String name) {
   1.941 -            return new Url();
   1.942 -        }
   1.943 -    }
   1.944 -
   1.945 -    private static class VersionFactory implements PropertyFactory {
   1.946 -        private static final long serialVersionUID = 1L;
   1.947 -
   1.948 -        public Property createProperty(final String name,
   1.949 -                final ParameterList parameters, final String value)
   1.950 -                throws IOException, URISyntaxException, ParseException {
   1.951 -            return new Version(parameters, value);
   1.952 -        }
   1.953 -
   1.954 -        public Property createProperty(final String name) {
   1.955 -            return new Version();
   1.956 -        }
   1.957 -    }
   1.958 -
   1.959 -    /**
   1.960 -     * @return Returns the instance.
   1.961 -     */
   1.962 -    public static PropertyFactoryImpl getInstance() {
   1.963 -        return instance;
   1.964 -    }
   1.965 -
   1.966 -    /**
   1.967 -     * {@inheritDoc}
   1.968 -     */
   1.969 -    public Property createProperty(final String name) {
   1.970 -        final PropertyFactory factory = (PropertyFactory) getFactory(name);
   1.971 -        if (factory != null) {
   1.972 -            return factory.createProperty(name);
   1.973 -        }
   1.974 -        else if (isExperimentalName(name)) {
   1.975 -            return new XProperty(name);
   1.976 -        }
   1.977 -        else if (allowIllegalNames()) {
   1.978 -            return new XProperty(name);
   1.979 -        }
   1.980 -        else {
   1.981 -            throw new IllegalArgumentException("Illegal property [" + name
   1.982 -                    + "]");
   1.983 -        }
   1.984 -    }
   1.985 -
   1.986 -    /**
   1.987 -     * {@inheritDoc}
   1.988 -     */
   1.989 -    public Property createProperty(final String name,
   1.990 -            final ParameterList parameters, final String value)
   1.991 -            throws IOException, URISyntaxException, ParseException {
   1.992 -
   1.993 -        final PropertyFactory factory = (PropertyFactory) getFactory(name);
   1.994 -        if (factory != null) {
   1.995 -            return factory.createProperty(name, parameters, value);
   1.996 -        }
   1.997 -        else if (isExperimentalName(name)) {
   1.998 -            return new XProperty(name, parameters, value);
   1.999 -        }
  1.1000 -        else if (allowIllegalNames()) {
  1.1001 -            return new XProperty(name, parameters, value);
  1.1002 -        }
  1.1003 -        else {
  1.1004 -            throw new IllegalArgumentException("Illegal property [" + name
  1.1005 -                    + "]");
  1.1006 -        }
  1.1007 -    }
  1.1008 -
  1.1009 -    /**
  1.1010 -     * @param name
  1.1011 -     * @return
  1.1012 -     */
  1.1013 -    private boolean isExperimentalName(final String name) {
  1.1014 -        return name.startsWith(Property.EXPERIMENTAL_PREFIX)
  1.1015 -                && name.length() > Property.EXPERIMENTAL_PREFIX.length();
  1.1016 -    }
  1.1017 -}

mercurial