Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5de05fc
commit 8e29197
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
src/main/java/net/fortuna/ical4j/extensions/property/CalStart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/test/java/net/fortuna/ical4j/extensions/property/CalStartTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |