Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added iCal-specific properties
  • Loading branch information
benfortuna committed Nov 23, 2009
1 parent e584a20 commit 7ea9077
Show file tree
Hide file tree
Showing 5 changed files with 541 additions and 0 deletions.
105 changes: 105 additions & 0 deletions src/main/java/net/fortuna/ical4j/extensions/property/WrAlarmId.java
@@ -0,0 +1,105 @@
/**
* Copyright (c) 2009, Ben Fortuna
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* o Neither the name of Ben Fortuna nor the names of any other contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.fortuna.ical4j.extensions.property;

import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.PropertyFactory;
import net.fortuna.ical4j.model.ValidationException;

/**
* @author fortuna
*
*/
public class WrAlarmId extends Property {

private static final long serialVersionUID = 2182103734645261668L;

private static final String NAME = "X-WR-ALARMID";

public static final PropertyFactory FACTORY = new Factory();

private String value;

/**
* @param factory
*/
public WrAlarmId(PropertyFactory factory) {
super(NAME, factory);
}

/**
* @param aList
* @param factory
*/
public WrAlarmId(ParameterList aList, PropertyFactory factory, String value) {
super(NAME, aList, factory);
setValue(value);
}

/**
* {@inheritDoc}
*/
@Override
public void setValue(String aValue) {
this.value = aValue;
}

/**
* {@inheritDoc}
*/
@Override
public void validate() throws ValidationException {
}

/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return value;
}

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 2099427445505899578L;

public Property createProperty(String name) {
return new WrAlarmId(this);
}

public Property createProperty(String name, ParameterList parameters, String value) {
WrAlarmId property = new WrAlarmId(parameters, this, value);
return property;
}
}
}
109 changes: 109 additions & 0 deletions src/main/java/net/fortuna/ical4j/extensions/property/WrCalDesc.java
@@ -0,0 +1,109 @@
/**
* Copyright (c) 2009, Ben Fortuna
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* o Neither the name of Ben Fortuna nor the names of any other contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.fortuna.ical4j.extensions.property;

import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.PropertyFactory;
import net.fortuna.ical4j.model.ValidationException;
import net.fortuna.ical4j.util.ParameterValidator;

/**
* @author fortuna
*
*/
public class WrCalDesc extends Property {

private static final long serialVersionUID = 4925485073475375164L;

private static final String NAME = "X-WR-CALDESC";

public static final PropertyFactory FACTORY = new Factory();

private String value;

/**
* @param factory
*/
public WrCalDesc(PropertyFactory factory) {
super(NAME, factory);
}

/**
* @param aList
* @param factory
*/
public WrCalDesc(ParameterList aList, PropertyFactory factory, String value) {
super(NAME, aList, factory);
setValue(value);
}

/**
* {@inheritDoc}
*/
@Override
public void setValue(String aValue) {
this.value = aValue;
}

/**
* {@inheritDoc}
*/
@Override
public void validate() throws ValidationException {
ParameterValidator.getInstance().assertOneOrLess(Parameter.VALUE,
getParameters());
}

/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return value;
}

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = -7990613145503686965L;

public Property createProperty(String name) {
return new WrCalDesc(this);
}

public Property createProperty(String name, ParameterList parameters, String value) {
WrCalDesc property = new WrCalDesc(parameters, this, value);
return property;
}
}
}
109 changes: 109 additions & 0 deletions src/main/java/net/fortuna/ical4j/extensions/property/WrCalName.java
@@ -0,0 +1,109 @@
/**
* Copyright (c) 2009, Ben Fortuna
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* o Neither the name of Ben Fortuna nor the names of any other contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.fortuna.ical4j.extensions.property;

import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.PropertyFactory;
import net.fortuna.ical4j.model.ValidationException;
import net.fortuna.ical4j.util.ParameterValidator;

/**
* @author fortuna
*
*/
public class WrCalName extends Property {

private static final long serialVersionUID = 3529181417508181637L;

private static final String NAME = "X-WR-CALNAME";

public static final PropertyFactory FACTORY = new Factory();

private String value;

/**
* @param factory
*/
public WrCalName(PropertyFactory factory) {
super(NAME, factory);
}

/**
* @param aList
* @param factory
*/
public WrCalName(ParameterList aList, PropertyFactory factory, String value) {
super(NAME, aList, factory);
setValue(value);
}

/**
* {@inheritDoc}
*/
@Override
public void setValue(String aValue) {
this.value = aValue;
}

/**
* {@inheritDoc}
*/
@Override
public void validate() throws ValidationException {
ParameterValidator.getInstance().assertOneOrLess(Parameter.VALUE,
getParameters());
}

/**
* {@inheritDoc}
*/
@Override
public String getValue() {
return value;
}

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = -202687610325706085L;

public Property createProperty(String name) {
return new WrCalName(this);
}

public Property createProperty(String name, ParameterList parameters, String value) {
WrCalName property = new WrCalName(parameters, this, value);
return property;
}
}
}

0 comments on commit 7ea9077

Please sign in to comment.