Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored calendar validation to support validation extensions
- Loading branch information
1 parent
e5bae46
commit 689896b
Showing
6 changed files
with
283 additions
and
206 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
src/main/java/net/fortuna/ical4j/validate/AbstractCalendarValidatorFactory.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,18 @@ | ||
package net.fortuna.ical4j.validate; | ||
|
||
import java.util.ServiceLoader; | ||
|
||
/** | ||
* Created by fortuna on 13/09/15. | ||
*/ | ||
public abstract class AbstractCalendarValidatorFactory { | ||
|
||
private static CalendarValidatorFactory instance; | ||
static { | ||
instance = ServiceLoader.load(CalendarValidatorFactory.class).iterator().next(); | ||
} | ||
|
||
public static CalendarValidatorFactory getInstance() { | ||
return instance; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/net/fortuna/ical4j/validate/CalendarValidatorFactory.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,15 @@ | ||
package net.fortuna.ical4j.validate; | ||
|
||
import net.fortuna.ical4j.model.Calendar; | ||
|
||
/** | ||
* Created by fortuna on 13/09/15. | ||
*/ | ||
public interface CalendarValidatorFactory { | ||
|
||
/** | ||
* Provides a validator implementation specific to the factory. | ||
* @return a new validator instance | ||
*/ | ||
Validator<Calendar> newInstance(); | ||
} |
Oops, something went wrong.