Skip to content

Commit

Permalink
Added Outlook CalStart property
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Nov 18, 2009
1 parent 5de05fc commit 8e29197
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/main/java/net/fortuna/ical4j/extensions/property/CalStart.java
@@ -0,0 +1,60 @@
package net.fortuna.ical4j.extensions.property;

import java.text.ParseException;

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.model.property.UtcProperty;

/**
* @author fortuna
*
*/
public class CalStart extends UtcProperty {

private static final String NAME = "X-CALSTART";

public static final PropertyFactory FACTORY = new Factory();

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

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

/**
* {@inheritDoc}
*/
@Override
public void validate() throws ValidationException {
// TODO Auto-generated method stub

}

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 596282786680252116L;

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

public Property createProperty(String name, ParameterList parameters, String value) throws ParseException {
CalStart property = new CalStart(parameters, this, value);
return property;
}
}
}
@@ -0,0 +1,45 @@
/**
* This file is part of Base Modules.
*
* Copyright (c) 2009, Ben Fortuna [fortuna@micronode.com]
*
* Base Modules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Base Modules is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Base Modules. If not, see <http://www.gnu.org/licenses/>.
*/

package net.fortuna.ical4j.extensions.property;

import java.io.IOException;
import java.net.URISyntaxException;
import java.text.ParseException;

import net.fortuna.ical4j.model.ParameterList;

import org.junit.Test;

import junit.framework.Assert;


/**
* @author fortuna
*
*/
public class CalStartTest {

@Test
public void testFactoryCreate() throws IOException, URISyntaxException, ParseException {
CalStart property = (CalStart) CalStart.FACTORY.createProperty(null, new ParameterList(),
"20081030T193000Z");
Assert.assertNotNull(property);
}
}

0 comments on commit 8e29197

Please sign in to comment.