Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Jul 11, 2010
1 parent 4764478 commit cf25447
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.groupwise;

import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterList;
Expand All @@ -42,7 +42,7 @@
* @author fortuna
*
*/
public class GwAutodateKey extends Property {
public class AutodateKey extends Property {

private static final long serialVersionUID = -4722251591472186896L;

Expand All @@ -55,15 +55,15 @@ public class GwAutodateKey extends Property {
/**
* @param factory
*/
public GwAutodateKey(PropertyFactory factory) {
public AutodateKey(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public GwAutodateKey(ParameterList aList, PropertyFactory factory, String value) {
public AutodateKey(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -95,12 +95,14 @@ public String getValue() {

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 1L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
GwAutodateKey property = new GwAutodateKey(parameters, this, value);
AutodateKey property = new AutodateKey(parameters, this, value);
return property;
}
}
Expand Down
18 changes: 10 additions & 8 deletions ...cal4j/extensions/property/GwItemType.java → ...ical4j/extensions/groupwise/ItemType.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.groupwise;

import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
Expand All @@ -40,30 +40,30 @@
* @author fortuna
*
*/
public class GwItemType extends Property {
public class ItemType extends Property {

private static final long serialVersionUID = 359692381730081304L;

public static final String PROPERTY_NAME = "X-GWITEM-TYPE";

public static final PropertyFactory FACTORY = new Factory();

public static final GwItemType APPOINTMENT = new GwItemType(new ParameterList(true), FACTORY, "APPOINTMENT");
public static final ItemType APPOINTMENT = new ItemType(new ParameterList(true), FACTORY, "APPOINTMENT");

private String value;

/**
* @param factory
*/
public GwItemType(PropertyFactory factory) {
public ItemType(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public GwItemType(ParameterList aList, PropertyFactory factory, String value) {
public ItemType(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -95,17 +95,19 @@ public String getValue() {

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 1L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
GwItemType property = null;
ItemType property = null;
if (APPOINTMENT.getValue().equals(value)) {
property = APPOINTMENT;
}
else {
property = new GwItemType(parameters, this, value);
property = new ItemType(parameters, this, value);
}
return property;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.groupwise;

import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterList;
Expand All @@ -42,7 +42,7 @@
* @author fortuna
*
*/
public class GwMessageId extends Property {
public class MessageId extends Property {

private static final long serialVersionUID = -7910360817210293089L;

Expand All @@ -55,15 +55,15 @@ public class GwMessageId extends Property {
/**
* @param factory
*/
public GwMessageId(PropertyFactory factory) {
public MessageId(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public GwMessageId(ParameterList aList, PropertyFactory factory, String value) {
public MessageId(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -95,12 +95,14 @@ public String getValue() {

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 1L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
GwMessageId property = new GwMessageId(parameters, this, value);
MessageId property = new MessageId(parameters, this, value);
return property;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.groupwise;

import net.fortuna.ical4j.model.Parameter;
import net.fortuna.ical4j.model.ParameterList;
Expand All @@ -42,7 +42,7 @@
* @author fortuna
*
*/
public class GwRecordId extends Property {
public class RecordId extends Property {

private static final long serialVersionUID = -3377034395408250616L;

Expand All @@ -55,15 +55,15 @@ public class GwRecordId extends Property {
/**
* @param factory
*/
public GwRecordId(PropertyFactory factory) {
public RecordId(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public GwRecordId(ParameterList aList, PropertyFactory factory, String value) {
public RecordId(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -95,12 +95,14 @@ public String getValue() {

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 1L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
GwRecordId property = new GwRecordId(parameters, this, value);
RecordId property = new RecordId(parameters, this, value);
return property;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.groupwise;

import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
Expand All @@ -40,30 +40,30 @@
* @author fortuna
*
*/
public class GwShowAs extends Property {
public class ShowAs extends Property {

private static final long serialVersionUID = 1777126874405580074L;

public static final String PROPERTY_NAME = "X-GWSHOW-AS";

public static final PropertyFactory FACTORY = new Factory();

public static final GwShowAs BUSY = new GwShowAs(new ParameterList(true), FACTORY, "BUSY");
public static final ShowAs BUSY = new ShowAs(new ParameterList(true), FACTORY, "BUSY");

private String value;

/**
* @param factory
*/
public GwShowAs(PropertyFactory factory) {
public ShowAs(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public GwShowAs(ParameterList aList, PropertyFactory factory, String value) {
public ShowAs(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -95,17 +95,19 @@ public String getValue() {

private static class Factory implements PropertyFactory {

private static final long serialVersionUID = 1L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
GwShowAs property = null;
ShowAs property = null;
if (BUSY.getValue().equals(value)) {
property = BUSY;
}
else {
property = new GwShowAs(parameters, this, value);
property = new ShowAs(parameters, this, value);
}
return property;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* 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;
package net.fortuna.ical4j.extensions.lotus;

import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
Expand All @@ -40,30 +40,30 @@
* @author fortuna
*
*/
public class LotusCharset extends Property {
public class Charset extends Property {

private static final long serialVersionUID = -3514682572599864426L;

public static final String PROPERTY_NAME = "X-LOTUS-CHARSET";

public static final PropertyFactory FACTORY = new Factory();

public static final LotusCharset UTF8 = new LotusCharset(new ParameterList(true), FACTORY, "UTF-8");
public static final Charset UTF8 = new Charset(new ParameterList(true), FACTORY, "UTF-8");

private String value;

/**
* @param factory
*/
public LotusCharset(PropertyFactory factory) {
public Charset(PropertyFactory factory) {
super(PROPERTY_NAME, factory);
}

/**
* @param aList
* @param factory
*/
public LotusCharset(ParameterList aList, PropertyFactory factory, String value) {
public Charset(ParameterList aList, PropertyFactory factory, String value) {
super(PROPERTY_NAME, aList, factory);
setValue(value);
}
Expand Down Expand Up @@ -98,16 +98,16 @@ private static class Factory implements PropertyFactory {
private static final long serialVersionUID = 596282786680252116L;

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

public Property createProperty(String name, ParameterList parameters, String value) {
LotusCharset property = null;
Charset property = null;
if (UTF8.getValue().equals(value)) {
property = UTF8;
}
else {
property = new LotusCharset(parameters, this, value);
property = new Charset(parameters, this, value);
}
return property;
}
Expand Down
Loading

0 comments on commit cf25447

Please sign in to comment.