-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
17 changed files
with
298 additions
and
72 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
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
30 changes: 30 additions & 0 deletions
30
src/main/java/de/vorb/platon/services/feeds/atom/AtomDateTime.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,30 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | ||
import java.time.Instant; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomDateTime { | ||
|
||
@XmlValue | ||
@XmlJavaTypeAdapter(InstantAdapter.class) | ||
private Instant dateTime; | ||
|
||
public static AtomDateTime of(Instant dateTime) { | ||
return new AtomDateTime(dateTime); | ||
} | ||
|
||
} |
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/de/vorb/platon/services/feeds/atom/AtomGenerator.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,32 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomGenerator { | ||
|
||
@XmlAttribute(name = "uri") | ||
private String uri; | ||
|
||
@XmlAttribute(name = "version") | ||
private String version; | ||
|
||
@XmlValue | ||
private String value; | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/de/vorb/platon/services/feeds/atom/AtomIcon.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,25 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomIcon { | ||
|
||
@XmlValue | ||
private String uri; | ||
|
||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/de/vorb/platon/services/feeds/atom/AtomLogo.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,25 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomLogo { | ||
|
||
@XmlValue | ||
private String uri; | ||
|
||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/de/vorb/platon/services/feeds/atom/AtomRights.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,25 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomRights { | ||
|
||
@XmlValue | ||
private String text; | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/de/vorb/platon/services/feeds/atom/AtomText.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,41 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlAttribute; | ||
import javax.xml.bind.annotation.XmlType; | ||
import javax.xml.bind.annotation.XmlValue; | ||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | ||
|
||
@XmlType | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class AtomText { | ||
|
||
@XmlAttribute(name = "type") | ||
@XmlJavaTypeAdapter(TextType.Adapter.class) | ||
private TextType type; | ||
|
||
@XmlValue | ||
private String text; | ||
|
||
public static AtomText of(TextType type, String text) { | ||
return new AtomText(type, text); | ||
} | ||
|
||
public static AtomText plainText(String text) { | ||
return AtomText.of(TextType.TEXT, text); | ||
} | ||
|
||
public static AtomText html(String html) { | ||
return AtomText.of(TextType.HTML, html); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/de/vorb/platon/services/feeds/atom/TextType.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,25 @@ | ||
package de.vorb.platon.services.feeds.atom; | ||
|
||
import javax.xml.bind.annotation.adapters.XmlAdapter; | ||
|
||
public enum TextType { | ||
|
||
TEXT, | ||
HTML, | ||
XHTML; | ||
|
||
public static class Adapter extends XmlAdapter<String, TextType> { | ||
|
||
@Override | ||
public TextType unmarshal(String v) throws Exception { | ||
return TextType.valueOf(v.toUpperCase()); | ||
} | ||
|
||
@Override | ||
public String marshal(TextType v) throws Exception { | ||
return v.toString().toLowerCase(); | ||
} | ||
|
||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/de/vorb/platon/services/feeds/atom/package-info.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
Oops, something went wrong.