http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/CommonEntry.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/CommonEntry.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/CommonEntry.java index be512a1..7cfef15 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/CommonEntry.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/CommonEntry.java @@ -13,6 +13,7 @@ package org.apache.juneau.dto.atom; import static org.apache.juneau.xml.annotation.XmlFormat.*; +import static org.apache.juneau.dto.atom.Utils.*; import java.util.*; @@ -23,17 +24,16 @@ import org.apache.juneau.xml.annotation.*; /** * Parent class of {@link Entry}, {@link Feed}, and {@link Source} * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @SuppressWarnings("hiding") public class CommonEntry extends Common { - private List<Person> authors; - private List<Category> categories; - private List<Person> contributors; + private Person[] authors; + private Category[] categories; + private Person[] contributors; private Id id; - private List<Link> links; + private Link[] links; private Text rights; private Text title; private Calendar updated; @@ -46,9 +46,17 @@ public class CommonEntry extends Common { * @param updated The updated timestamp of this object. */ public CommonEntry(Id id, Text title, Calendar updated) { - this.id = id; - this.title = title; - this.updated = updated; + id(id).title(title).updated(updated); + } + + /** + * Normal constructor. + * @param id The ID of this object. + * @param title The title of this object. + * @param updated The updated timestamp of this object. + */ + public CommonEntry(String id, String title, String updated) { + id(id).title(title).updated(updated); } /** Bean constructor. */ @@ -65,7 +73,7 @@ public class CommonEntry extends Common { * @return The list of authors for this object. */ @Xml(format=COLLAPSED, childName="author") - public List<Person> getAuthors() { + public Person[] getAuthors() { return authors; } @@ -75,31 +83,19 @@ public class CommonEntry extends Common { * @param authors The list of authors for this object. * @return This object (for method chaining). */ - public CommonEntry setAuthors(List<Person> authors) { + @BeanProperty(name="authors") + public CommonEntry authors(Person...authors) { this.authors = authors; return this; } /** - * Adds one or more authors to the list of authors of this object. - * - * @param authors The author to add to the list. - * @return This object (for method chaining). - */ - public CommonEntry addAuthors(Person...authors) { - if (this.authors == null) - this.authors = new LinkedList<Person>(); - this.authors.addAll(Arrays.asList(authors)); - return this; - } - - /** * Returns the list of categories of this object. * * @return The list of categories of this object. */ @Xml(format=COLLAPSED, childName="category") - public List<Category> getCatetories() { + public Category[] getCatetories() { return categories; } @@ -109,31 +105,19 @@ public class CommonEntry extends Common { * @param categories The list of categories of this object. * @return This object (for method chaining). */ - public CommonEntry setCategories(List<Category> categories) { + @BeanProperty(name="categories") + public CommonEntry categories(Category...categories) { this.categories = categories; return this; } /** - * Adds one or more categories to the list of categories of this object. - * - * @param categories The categories to add to the list. - * @return This object (for method chaining). - */ - public CommonEntry addCategories(Category...categories) { - if (this.categories == null) - this.categories = new LinkedList<Category>(); - this.categories.addAll(Arrays.asList(categories)); - return this; - } - - /** * Returns the list of contributors of this object. * * @return The list of contributors of this object. */ @Xml(format=COLLAPSED, childName="contributor") - public List<Person> getContributors() { + public Person[] getContributors() { return contributors; } @@ -143,25 +127,13 @@ public class CommonEntry extends Common { * @param contributors The list of contributors of this object. * @return This object (for method chaining). */ - public CommonEntry setContributors(List<Person> contributors) { + @BeanProperty(name="contributors") + public CommonEntry contributors(Person...contributors) { this.contributors = contributors; return this; } /** - * Adds one or more contributors to the list of contributors of this object. - * - * @param contributors The contributor to add to the list. - * @return This object (for method chaining). - */ - public CommonEntry addContributors(Person...contributors) { - if (this.contributors == null) - this.contributors = new LinkedList<Person>(); - this.contributors.addAll(Arrays.asList(contributors)); - return this; - } - - /** * Returns the ID of this object. * * @return The ID of this object. @@ -176,18 +148,30 @@ public class CommonEntry extends Common { * @param id The ID of this object. * @return This object (for method chaining). */ - public CommonEntry setId(Id id) { + @BeanProperty(name="id") + public CommonEntry id(Id id) { this.id = id; return this; } /** + * Sets the ID of this object. + * + * @param id The ID of this object. + * @return This object (for method chaining). + */ + public CommonEntry id(String id) { + this.id = new Id(id); + return this; + } + + /** * Returns the list of links of this object. * * @return The list of links of this object. */ @Xml(format=COLLAPSED) - public List<Link> getLinks() { + public Link[] getLinks() { return links; } @@ -197,25 +181,13 @@ public class CommonEntry extends Common { * @param links The list of links of this object. * @return This object (for method chaining). */ - public CommonEntry setLinks(List<Link> links) { + @BeanProperty(name="links") + public CommonEntry links(Link...links) { this.links = links; return this; } /** - * Adds one or more links to the list of links of this object. - * - * @param links The links to add to the list. - * @return This object (for method chaining). - */ - public CommonEntry addLinks(Link...links) { - if (this.links == null) - this.links = new LinkedList<Link>(); - this.links.addAll(Arrays.asList(links)); - return this; - } - - /** * Returns the rights statement of this object. * * @return The rights statement of this object. @@ -230,12 +202,24 @@ public class CommonEntry extends Common { * @param rights The rights statement of this object. * @return This object (for method chaining). */ - public CommonEntry setRights(Text rights) { + @BeanProperty(name="rights") + public CommonEntry rights(Text rights) { this.rights = rights; return this; } /** + * Sets the rights statement of this object. + * + * @param rights The rights statement of this object. + * @return This object (for method chaining). + */ + public CommonEntry rights(String rights) { + this.rights = new Text().text(rights); + return this; + } + + /** * Returns the title of this object. * * @return The title of this object. @@ -250,12 +234,24 @@ public class CommonEntry extends Common { * @param title The title of this object. * @return This object (for method chaining). */ - public CommonEntry setTitle(Text title) { + @BeanProperty(name="title") + public CommonEntry title(Text title) { this.title = title; return this; } /** + * Sets the title of this object. + * + * @param title The title of this object. + * @return This object (for method chaining). + */ + public CommonEntry title(String title) { + this.title = new Text().text(title); + return this; + } + + /** * Returns the update timestamp of this object. * * @return The update timestamp of this object. @@ -271,8 +267,21 @@ public class CommonEntry extends Common { * @param updated The update timestamp of this object. * @return This object (for method chaining). */ - public CommonEntry setUpdated(Calendar updated) { + @BeanProperty(name="updated") + public CommonEntry updated(Calendar updated) { this.updated = updated; return this; } + + /** + * Sets the update timestamp of this object. + * + * @param updated The update timestamp of this object in ISO8601 format. + * @return This object (for method chaining). + */ + @BeanProperty(name="updated") + public CommonEntry updated(String updated) { + this.updated = parseDateTime(updated); + return this; + } }
http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java index 346125b..5adf5dd 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Content.java @@ -14,8 +14,9 @@ package org.apache.juneau.dto.atom; import static org.apache.juneau.xml.annotation.XmlFormat.*; -import java.net.*; +import java.net.URI; +import org.apache.juneau.annotation.*; import org.apache.juneau.xml.annotation.*; /** @@ -59,9 +60,9 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ +@SuppressWarnings("hiding") public class Content extends Text { private URI src; @@ -71,25 +72,18 @@ public class Content extends Text { * Normal content. * * @param type The content type of this content. - * @param content The content of this content. */ - public Content(String type, String content) { - super(type, content); + public Content(String type) { + super(type); } /** * Normal content. - * - * @param content The content of this content. */ - public Content(String content) { - super(content); + public Content() { + super(); } - /** Bean constructor. */ - public Content() {} - - //-------------------------------------------------------------------------------- // Bean properties //-------------------------------------------------------------------------------- @@ -110,7 +104,8 @@ public class Content extends Text { * @param src The source URI. * @return This object (for method chaining). */ - public Content setSrc(URI src) { + @BeanProperty(name="src") + public Content src(URI src) { this.src = src; return this; } @@ -121,26 +116,32 @@ public class Content extends Text { //-------------------------------------------------------------------------------- @Override /* Text */ - public Content setText(String text) { - super.setText(text); + public Content text(String text) { + super.text(text); return this; } @Override /* Text */ - public Content setType(String type) { - super.setType(type); + public Content type(String type) { + super.type(type); + return this; + } + + @Override /* Common */ + public Content base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Content setBase(URI base) { - super.setBase(base); + public Content base(String base) { + super.base(base); return this; } @Override /* Common */ - public Content setLang(String lang) { - super.setLang(lang); + public Content lang(String lang) { + super.lang(lang); return this; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java index 443ea04..72f978f 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Entry.java @@ -17,6 +17,7 @@ import java.util.*; import org.apache.juneau.annotation.*; import org.apache.juneau.transforms.*; +import static org.apache.juneau.dto.atom.Utils.*; /** * Represents an <code>atomEntry</code> construct in the RFC4287 specification. @@ -42,10 +43,10 @@ import org.apache.juneau.transforms.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="entry") +@SuppressWarnings("hiding") public class Entry extends CommonEntry { private Content content; @@ -64,6 +65,17 @@ public class Entry extends CommonEntry { super(id, title, updated); } + /** + * Normal constructor. + * + * @param id The ID of this entry. + * @param title The title of this entry. + * @param updated The updated timestamp of this entry. + */ + public Entry(String id, String title, String updated) { + super(id, title, updated); + } + /** Bean constructor. */ public Entry() {} @@ -87,7 +99,8 @@ public class Entry extends CommonEntry { * @param content The content of this entry. * @return This object (for method chaining). */ - public Entry setContent(Content content) { + @BeanProperty(name="content") + public Entry content(Content content) { this.content = content; return this; } @@ -108,12 +121,25 @@ public class Entry extends CommonEntry { * @param published The publish timestamp of this entry. * @return This object (for method chaining). */ - public Entry setPublished(Calendar published) { + @BeanProperty(name="published") + public Entry published(Calendar published) { this.published = published; return this; } /** + * Sets the publish timestamp of this entry. + * + * @param published The publish timestamp of this entry in ISO8601 format. + * @return This object (for method chaining). + */ + @BeanProperty(name="published") + public Entry published(String published) { + this.published = parseDateTime(published); + return this; + } + + /** * Returns the source of this entry. * * @return The source of this entry. @@ -128,7 +154,8 @@ public class Entry extends CommonEntry { * @param source The source of this entry. * @return This object (for method chaining). */ - public Entry setSource(Source source) { + @BeanProperty(name="source") + public Entry source(Source source) { this.source = source; return this; } @@ -148,97 +175,103 @@ public class Entry extends CommonEntry { * @param summary The summary of this entry. * @return This object (for method chaining). */ - public Entry setSummary(Text summary) { + @BeanProperty(name="summary") + public Entry summary(Text summary) { this.summary = summary; return this; } + /** + * Sets the summary of this entry. + * + * @param summary The summary of this entry. + * @return This object (for method chaining). + */ + @BeanProperty(name="summary") + public Entry summary(String summary) { + this.summary = new Text(summary); + return this; + } //-------------------------------------------------------------------------------- // Overridden setters (to simplify method chaining) //-------------------------------------------------------------------------------- @Override /* CommonEntry */ - public Entry setAuthors(List<Person> authors) { - super.setAuthors(authors); - return this; - } - - @Override /* CommonEntry */ - public Entry addAuthors(Person...authors) { - super.addAuthors(authors); + public Entry authors(Person...authors) { + super.authors(authors); return this; } @Override /* CommonEntry */ - public Entry setCategories(List<Category> categories) { - super.setCategories(categories); + public Entry categories(Category...categories) { + super.categories(categories); return this; } @Override /* CommonEntry */ - public Entry addCategories(Category...categories) { - super.addCategories(categories); + public Entry contributors(Person...contributors) { + super.contributors(contributors); return this; } @Override /* CommonEntry */ - public Entry setContributors(List<Person> contributors) { - super.setContributors(contributors); + public Entry id(Id id) { + super.id(id); return this; } @Override /* CommonEntry */ - public Entry addContributors(Person...contributors) { - super.addContributors(contributors); + public Entry links(Link...links) { + super.links(links); return this; } @Override /* CommonEntry */ - public Entry setId(Id id) { - super.setId(id); + public Entry rights(Text rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Entry setLinks(List<Link> links) { - super.setLinks(links); + public Entry rights(String rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Entry addLinks(Link...links) { - super.addLinks(links); + public Entry title(Text title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Entry setRights(Text rights) { - super.setRights(rights); + public Entry title(String title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Entry setTitle(Text title) { - super.setTitle(title); + public Entry updated(Calendar updated) { + super.updated(updated); return this; } @Override /* CommonEntry */ - public Entry setUpdated(Calendar updated) { - super.setUpdated(updated); + public Entry updated(String updated) { + super.updated(updated); return this; } @Override /* Common */ - public Entry setBase(URI base) { - super.setBase(base); + public Entry base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Entry setLang(String lang) { - super.setLang(lang); + public Entry lang(String lang) { + super.lang(lang); return this; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java index e105851..3fc80cf 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Feed.java @@ -47,8 +47,7 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="feed") @SuppressWarnings("hiding") @@ -58,7 +57,7 @@ public class Feed extends CommonEntry { private Icon icon; // atomIcon? private Logo logo; // atomLogo? private Text subtitle; // atomSubtitle? - private List<Entry> entries; // atomEntry* + private Entry[] entries; // atomEntry* /** * Normal constructor. @@ -71,6 +70,17 @@ public class Feed extends CommonEntry { super(id, title, updated); } + /** + * Normal constructor. + * + * @param id The feed identifier. + * @param title The feed title. + * @param updated The feed updated timestamp. + */ + public Feed(String id, String title, String updated) { + super(id, title, updated); + } + /** Bean constructor. */ public Feed() {} @@ -94,7 +104,8 @@ public class Feed extends CommonEntry { * @param generator The generator information on this feed. * @return This object (for method chaining). */ - public Feed setGenerator(Generator generator) { + @BeanProperty(name="generator") + public Feed generator(Generator generator) { this.generator = generator; return this; } @@ -114,7 +125,8 @@ public class Feed extends CommonEntry { * @param icon The feed icon. * @return This object (for method chaining). */ - public Feed setIcon(Icon icon) { + @BeanProperty(name="icon") + public Feed icon(Icon icon) { this.icon = icon; return this; } @@ -134,7 +146,8 @@ public class Feed extends CommonEntry { * @param logo The feed logo. * @return This object (for method chaining). */ - public Feed setLogo(Logo logo) { + @BeanProperty(name="logo") + public Feed logo(Logo logo) { this.logo = logo; return this; } @@ -156,18 +169,29 @@ public class Feed extends CommonEntry { * @return This object (for method chaining). */ @BeanProperty(name="subtitle") - public Feed setSubTitle(Text subtitle) { + public Feed subtitle(Text subtitle) { this.subtitle = subtitle; return this; } /** + * Sets the feed subtitle. + * + * @param subtitle The feed subtitle. + * @return This object (for method chaining). + */ + public Feed subtitle(String subtitle) { + this.subtitle = new Text(subtitle); + return this; + } + + /** * Returns the entries in the feed. * * @return The entries in the feed. */ @Xml(format=COLLAPSED) - public List<Entry> getEntries() { + public Entry[] getEntries() { return entries; } @@ -177,110 +201,92 @@ public class Feed extends CommonEntry { * @param entries The entries in the feed. * @return This object (for method chaining). */ - public Feed setEntries(List<Entry> entries) { + @BeanProperty(name="entries") + public Feed entries(Entry...entries) { this.entries = entries; return this; } - /** - * Adds an entry to the list of entries in the feed. - * - * @param entries The entries to add to the list of entries in the feed.s - * @return This object (for method chaining). - */ - public Feed addEntries(Entry...entries) { - if (this.entries == null) - this.entries = new LinkedList<Entry>(); - this.entries.addAll(Arrays.asList(entries)); - return this; - } - //-------------------------------------------------------------------------------- // Overridden setters (to simplify method chaining) //-------------------------------------------------------------------------------- @Override /* CommonEntry */ - public Feed setAuthors(List<Person> authors) { - super.setAuthors(authors); - return this; - } - - @Override /* CommonEntry */ - public Feed addAuthors(Person...authors) { - super.addAuthors(authors); + public Feed authors(Person...authors) { + super.authors(authors); return this; } @Override /* CommonEntry */ - public Feed setCategories(List<Category> categories) { - super.setCategories(categories); + public Feed categories(Category...categories) { + super.categories(categories); return this; } @Override /* CommonEntry */ - public Feed addCategories(Category...categories) { - super.addCategories(categories); + public Feed contributors(Person...contributors) { + super.contributors(contributors); return this; } @Override /* CommonEntry */ - public Feed setContributors(List<Person> contributors) { - super.setContributors(contributors); + public Feed id(Id id) { + super.id(id); return this; } @Override /* CommonEntry */ - public Feed addContributors(Person...contributors) { - super.addContributors(contributors); + public Feed links(Link...links) { + super.links(links); return this; } @Override /* CommonEntry */ - public Feed setId(Id id) { - super.setId(id); + public Feed rights(Text rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Feed setLinks(List<Link> links) { - super.setLinks(links); + public Feed rights(String rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Feed addLinks(Link...links) { - super.addLinks(links); + public Feed title(Text title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Feed setRights(Text rights) { - super.setRights(rights); + public Feed title(String title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Feed setTitle(Text title) { - super.setTitle(title); + public Feed updated(Calendar updated) { + super.updated(updated); return this; } @Override /* CommonEntry */ - public Feed setUpdated(Calendar updated) { - super.setUpdated(updated); + public Feed updated(String updated) { + super.updated(updated); return this; } @Override /* Common */ - public Feed setBase(URI base) { - super.setBase(base); + public Feed base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Feed setLang(String lang) { - super.setLang(lang); + public Feed lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java index 4a55cb1..e8c38bb 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Generator.java @@ -18,6 +18,7 @@ import java.net.URI; import org.apache.juneau.annotation.*; import org.apache.juneau.xml.annotation.*; +import static org.apache.juneau.dto.atom.Utils.*; /** * Represents an <code>atomGenerator</code> construct in the RFC4287 specification. @@ -32,10 +33,10 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="generator") +@SuppressWarnings("hiding") public class Generator extends Common { private URI uri; @@ -76,12 +77,25 @@ public class Generator extends Common { * @param uri The URI of this generator statement. * @return This object (for method chaining). */ - public Generator setUri(URI uri) { + @BeanProperty(name="uri") + public Generator uri(URI uri) { this.uri = uri; return this; } /** + * Sets the URI of this generator statement. + * + * @param uri The URI of this generator statement. + * @return This object (for method chaining). + */ + @BeanProperty(name="uri") + public Generator uri(String uri) { + this.uri = toURI(uri); + return this; + } + + /** * Returns the version of this generator statement. * * @return The version of this generator statement. @@ -97,7 +111,8 @@ public class Generator extends Common { * @param version The version of this generator statement. * @return This object (for method chaining). */ - public Generator setVersion(String version) { + @BeanProperty(name="version") + public Generator version(String version) { this.version = version; return this; } @@ -107,7 +122,7 @@ public class Generator extends Common { * * @return The content of this generator statement. */ - @Xml(format=CONTENT) + @Xml(format=TEXT) public String getText() { return text; } @@ -118,7 +133,8 @@ public class Generator extends Common { * @param text The content of this generator statement. * @return This object (for method chaining). */ - public Generator setText(String text) { + @BeanProperty(name="text") + public Generator text(String text) { this.text = text; return this; } @@ -129,14 +145,14 @@ public class Generator extends Common { //-------------------------------------------------------------------------------- @Override /* Common */ - public Generator setBase(URI base) { - super.setBase(base); + public Generator base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Generator setLang(String lang) { - super.setLang(lang); + public Generator lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java index 43cf5e5..9f767ef 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Icon.java @@ -18,6 +18,7 @@ import java.net.URI; import org.apache.juneau.annotation.*; import org.apache.juneau.xml.annotation.*; +import static org.apache.juneau.dto.atom.Utils.*; /** * Represents an <code>atomIcon</code> construct in the RFC4287 specification. @@ -30,10 +31,10 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="icon") +@SuppressWarnings("hiding") public class Icon extends Common { private URI uri; @@ -45,7 +46,16 @@ public class Icon extends Common { * @param uri The URI of the icon. */ public Icon(URI uri) { - this.uri = uri; + uri(uri); + } + + /** + * Normal constructor. + * + * @param uri The URI of the icon. + */ + public Icon(String uri) { + uri(uri); } /** Bean constructor. */ @@ -61,7 +71,7 @@ public class Icon extends Common { * * @return The URI of this icon. */ - @Xml(format=CONTENT) + @Xml(format=ELEMENTS) public URI getUri() { return uri; } @@ -72,25 +82,37 @@ public class Icon extends Common { * @param uri The URI of this icon. * @return This object (for method chaining). */ - public Icon setUri(URI uri) { + @BeanProperty(name="uri") + public Icon uri(URI uri) { this.uri = uri; return this; } + /** + * Sets the URI of this icon. + * + * @param uri The URI of this icon. + * @return This object (for method chaining). + */ + @BeanProperty(name="uri") + public Icon uri(String uri) { + this.uri = toURI(uri); + return this; + } //-------------------------------------------------------------------------------- // Overridden setters (to simplify method chaining) //-------------------------------------------------------------------------------- @Override /* Common */ - public Icon setBase(URI base) { - super.setBase(base); + public Icon base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Icon setLang(String lang) { - super.setLang(lang); + public Icon lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java index 7b1865e..0ca1c4e 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Id.java @@ -30,10 +30,10 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="id") +@SuppressWarnings("hiding") public class Id extends Common { private String text; @@ -44,7 +44,7 @@ public class Id extends Common { * @param text The id element contents. */ public Id(String text) { - this.text = text; + text(text); } /** Bean constructor. */ @@ -60,7 +60,7 @@ public class Id extends Common { * * @return The content of this identifier. */ - @Xml(format=CONTENT) + @Xml(format=TEXT) public String getText() { return text; } @@ -71,7 +71,8 @@ public class Id extends Common { * @param text The content of this identifier. * @return This object (for method chaining). */ - public Id setText(String text) { + @BeanProperty(name="text") + public Id text(String text) { this.text = text; return this; } @@ -82,14 +83,14 @@ public class Id extends Common { //-------------------------------------------------------------------------------- @Override /* Common */ - public Id setBase(URI base) { - super.setBase(base); + public Id base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Id setLang(String lang) { - super.setLang(lang); + public Id lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java index b1cee2e..9bf6cd6 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Link.java @@ -37,10 +37,10 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="link") +@SuppressWarnings("hiding") public class Link extends Common { private String href; @@ -59,9 +59,7 @@ public class Link extends Common { * @param href The URI of the link. */ public Link(String rel, String type, String href) { - this.rel = rel; - this.type = type; - this.href = href; + rel(rel).type(type).href(href); } /** Bean constructor. */ @@ -88,7 +86,8 @@ public class Link extends Common { * @param href The href of the target of this link. * @return This object (for method chaining). */ - public Link setHref(String href) { + @BeanProperty(name="href") + public Link href(String href) { this.href = href; return this; } @@ -109,7 +108,8 @@ public class Link extends Common { * @param rel The rell of this link. * @return This object (for method chaining). */ - public Link setRel(String rel) { + @BeanProperty(name="rel") + public Link rel(String rel) { this.rel = rel; return this; } @@ -138,7 +138,8 @@ public class Link extends Common { * @param type The content type of the target of this link. * @return This object (for method chaining). */ - public Link setType(String type) { + @BeanProperty(name="type") + public Link type(String type) { this.type = type; return this; } @@ -159,7 +160,8 @@ public class Link extends Common { * @param hreflang The language of the target of this link. * @return This object (for method chaining). */ - public Link setHreflang(String hreflang) { + @BeanProperty(name="hreflang") + public Link hreflang(String hreflang) { this.hreflang = hreflang; return this; } @@ -180,7 +182,8 @@ public class Link extends Common { * @param title The title of the target of this link. * @return This object (for method chaining). */ - public Link setTitle(String title) { + @BeanProperty(name="title") + public Link title(String title) { this.title = title; return this; } @@ -201,7 +204,8 @@ public class Link extends Common { * @param length The length of the contents of the target of this link. * @return This object (for method chaining). */ - public Link setLength(Integer length) { + @BeanProperty(name="length") + public Link length(Integer length) { this.length = length; return this; } @@ -212,14 +216,14 @@ public class Link extends Common { //-------------------------------------------------------------------------------- @Override /* Common */ - public Link setBase(URI base) { - super.setBase(base); + public Link base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Link setLang(String lang) { - super.setLang(lang); + public Link lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java index 30c3c90..743b6e6 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Logo.java @@ -18,6 +18,7 @@ import java.net.URI; import org.apache.juneau.annotation.*; import org.apache.juneau.xml.annotation.*; +import static org.apache.juneau.dto.atom.Utils.*; /** * Represents an <code>atomLogo</code> construct in the RFC4287 specification. @@ -30,10 +31,10 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ @Bean(typeName="logo") +@SuppressWarnings("hiding") public class Logo extends Common { private URI uri; @@ -45,7 +46,16 @@ public class Logo extends Common { * @param uri The URI of the logo. */ public Logo(URI uri) { - this.uri = uri; + uri(uri); + } + + /** + * Normal constructor. + * + * @param uri The URI of the logo. + */ + public Logo(String uri) { + uri(uri); } /** Bean constructor. */ @@ -61,7 +71,7 @@ public class Logo extends Common { * * @return The URI of the logo. */ - @Xml(format=CONTENT) + @Xml(format=ELEMENTS) public URI getUri() { return uri; } @@ -72,25 +82,38 @@ public class Logo extends Common { * @param uri The URI of the logo. * @return This object (for method chaining). */ - public Logo setUri(URI uri) { + @BeanProperty(name="uri") + public Logo uri(URI uri) { this.uri = uri; return this; } + /** + * Sets the URI of the logo. + * + * @param uri The URI of the logo. + * @return This object (for method chaining). + */ + @BeanProperty(name="uri") + public Logo uri(String uri) { + this.uri = toURI(uri); + return this; + } + //-------------------------------------------------------------------------------- // Overridden setters (to simplify method chaining) //-------------------------------------------------------------------------------- @Override /* Common */ - public Logo setBase(URI base) { - super.setBase(base); + public Logo base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Logo setLang(String lang) { - super.setLang(lang); + public Logo lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Person.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Person.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Person.java index b83b442..26561a2 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Person.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Person.java @@ -12,7 +12,10 @@ // *************************************************************************************************************************** package org.apache.juneau.dto.atom; -import java.net.*; +import java.net.URI; + +import org.apache.juneau.annotation.*; +import static org.apache.juneau.dto.atom.Utils.*; /** * Represents an <code>atomPersonConstruct</code> construct in the RFC4287 specification. @@ -27,9 +30,9 @@ import java.net.*; * & extensionElement*) * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ +@SuppressWarnings("hiding") public class Person extends Common { private String name; @@ -43,7 +46,7 @@ public class Person extends Common { * @param name The name of the person. */ public Person(String name) { - this.name = name; + name(name); } /** Bean constructor. */ @@ -69,7 +72,8 @@ public class Person extends Common { * @param name The name of the person. * @return This object (for method chaining). */ - public Person setName(String name) { + @BeanProperty(name="name") + public Person name(String name) { this.name = name; return this; } @@ -89,12 +93,25 @@ public class Person extends Common { * @param uri The URI of the person. * @return This object (for method chaining). */ - public Person setUri(URI uri) { + @BeanProperty(name="uri") + public Person uri(URI uri) { this.uri = uri; return this; } /** + * Sets the URI of the person. + * + * @param uri The URI of the person. + * @return This object (for method chaining). + */ + @BeanProperty(name="uri") + public Person uri(String uri) { + this.uri = toURI(uri); + return this; + } + + /** * Returns the email address of the person. * * @return The email address of the person. @@ -109,7 +126,8 @@ public class Person extends Common { * @param email The email address of the person. * @return This object (for method chaining). */ - public Person setEmail(String email) { + @BeanProperty(name="email") + public Person email(String email) { this.email = email; return this; } @@ -120,14 +138,14 @@ public class Person extends Common { //-------------------------------------------------------------------------------- @Override /* Common */ - public Person setBase(URI base) { - super.setBase(base); + public Person base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Person setLang(String lang) { - super.setLang(lang); + public Person lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java index e048113..07f9142 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Source.java @@ -12,9 +12,11 @@ // *************************************************************************************************************************** package org.apache.juneau.dto.atom; -import java.net.*; +import java.net.URI; import java.util.*; +import org.apache.juneau.annotation.*; + /** * Represents an <code>atomSource</code> construct in the RFC4287 specification. * <p> @@ -39,9 +41,9 @@ import java.util.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ +@SuppressWarnings("hiding") public class Source extends CommonEntry { private Generator generator; @@ -69,7 +71,8 @@ public class Source extends CommonEntry { * @param generator The generator info of this source. * @return This object (for method chaining). */ - public Source setGenerator(Generator generator) { + @BeanProperty(name="generator") + public Source generator(Generator generator) { this.generator = generator; return this; } @@ -89,7 +92,8 @@ public class Source extends CommonEntry { * @param icon The icon of this source. * @return This object (for method chaining). */ - public Source setIcon(Icon icon) { + @BeanProperty(name="icon") + public Source icon(Icon icon) { this.icon = icon; return this; } @@ -109,7 +113,8 @@ public class Source extends CommonEntry { * @param logo The logo of this source. * @return This object (for method chaining). */ - public Source setLogo(Logo logo) { + @BeanProperty(name="logo") + public Source logo(Logo logo) { this.logo = logo; return this; } @@ -129,97 +134,103 @@ public class Source extends CommonEntry { * @param subtitle The subtitle of this source. * @return This object (for method chaining). */ - public Source setSubtitle(Text subtitle) { + @BeanProperty(name="subtitle") + public Source subtitle(Text subtitle) { this.subtitle = subtitle; return this; } + /** + * Sets the subtitle of this source. + * + * @param subtitle The subtitle of this source. + * @return This object (for method chaining). + */ + @BeanProperty(name="subtitle") + public Source subtitle(String subtitle) { + this.subtitle = new Text(subtitle); + return this; + } //-------------------------------------------------------------------------------- // Overridden setters (to simplify method chaining) //-------------------------------------------------------------------------------- @Override /* CommonEntry */ - public Source setAuthors(List<Person> authors) { - super.setAuthors(authors); - return this; - } - - @Override /* CommonEntry */ - public Source addAuthors(Person...authors) { - super.addAuthors(authors); + public Source authors(Person...authors) { + super.authors(authors); return this; } @Override /* CommonEntry */ - public Source setCategories(List<Category> categories) { - super.setCategories(categories); + public Source categories(Category...categories) { + super.categories(categories); return this; } @Override /* CommonEntry */ - public Source addCategories(Category...categories) { - super.addCategories(categories); + public Source contributors(Person...contributors) { + super.contributors(contributors); return this; } @Override /* CommonEntry */ - public Source setContributors(List<Person> contributors) { - super.setContributors(contributors); + public Source id(Id id) { + super.id(id); return this; } @Override /* CommonEntry */ - public Source addContributors(Person...contributors) { - super.addContributors(contributors); + public Source links(Link...links) { + super.links(links); return this; } @Override /* CommonEntry */ - public Source setId(Id id) { - super.setId(id); + public Source rights(Text rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Source setLinks(List<Link> links) { - super.setLinks(links); + public Source rights(String rights) { + super.rights(rights); return this; } @Override /* CommonEntry */ - public Source addLinks(Link...links) { - super.addLinks(links); + public Source title(Text title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Source setRights(Text rights) { - super.setRights(rights); + public Source title(String title) { + super.title(title); return this; } @Override /* CommonEntry */ - public Source setTitle(Text title) { - super.setTitle(title); + public Source updated(Calendar updated) { + super.updated(updated); return this; } @Override /* CommonEntry */ - public Source setUpdated(Calendar updated) { - super.setUpdated(updated); + public Source updated(String updated) { + super.updated(updated); return this; } @Override /* Common */ - public Source setBase(URI base) { - super.setBase(base); + public Source base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Source setLang(String lang) { - super.setLang(lang); + public Source lang(String lang) { + super.lang(lang); return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Text.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Text.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Text.java index fc0b506..fbf4917 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Text.java +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Text.java @@ -12,14 +12,11 @@ // *************************************************************************************************************************** package org.apache.juneau.dto.atom; -import static org.apache.juneau.xml.XmlUtils.*; import static org.apache.juneau.xml.annotation.XmlFormat.*; -import java.net.*; +import java.net.URI; -import javax.xml.stream.*; - -import org.apache.juneau.xml.*; +import org.apache.juneau.annotation.*; import org.apache.juneau.xml.annotation.*; /** @@ -46,33 +43,21 @@ import org.apache.juneau.xml.annotation.*; * } * </p> * <p> - * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. - * </p> + * Refer to {@link org.apache.juneau.dto.atom} for further information about ATOM support. */ +@SuppressWarnings("hiding") public class Text extends Common { private String type; - String text; - + private String text; /** * Normal content. * * @param type The content type of this content. - * @param text The text of this content. */ - public Text(String type, String text) { - this.type = type; - this.text = text; - } - - /** - * Normal content. - * - * @param text The text of this content. - */ - public Text(String text) { - this.text = text; + public Text(String type) { + type(type); } /** Bean constructor. */ @@ -107,7 +92,8 @@ public class Text extends Common { * @param type The content type of this content. * @return This object (for method chaining). */ - public Text setType(String type) { + @BeanProperty(name="type") + public Text type(String type) { this.type = type; return this; } @@ -117,7 +103,7 @@ public class Text extends Common { * * @return The content of this content. */ - @Xml(format=CONTENT, contentHandler=TextContentHandler.class) + @Xml(format=XMLTEXT) public String getText() { return text; } @@ -128,7 +114,8 @@ public class Text extends Common { * @param text The content of this content. * @return This object (for method chaining). */ - public Text setText(String text) { + @BeanProperty(name="text") + public Text text(String text) { this.text = text; return this; } @@ -139,43 +126,20 @@ public class Text extends Common { //-------------------------------------------------------------------------------- @Override /* Common */ - public Text setBase(URI base) { - super.setBase(base); + public Text base(URI base) { + super.base(base); return this; } @Override /* Common */ - public Text setLang(String lang) { - super.setLang(lang); + public Text base(String base) { + super.base(base); return this; } - /** - * Specialized content handler for correctly handling XML element content based - * on the <code>type</code> attribute of the element. - * <p> - * If the <code>type</code> attribute is <js>"xhtml"</js> the content is treated - * as XML. Otherwise, it's treated as plain text. - */ - public static class TextContentHandler implements XmlContentHandler<Text> { - - @Override /* XmlContentHandler */ - public void parse(XMLStreamReader r, Text text) throws Exception { - String type = text.type; - if (type != null && type.equals("xhtml")) - text.text = decode(readXmlContents(r).trim()); - else - text.text = decode(r.getElementText().trim()); - } - - @Override /* XmlContentHandler */ - public void serialize(XmlWriter w, Text text) throws Exception { - String type = text.type; - String content = text.text; - if (type != null && type.equals("xhtml")) - w.encodeTextInvalidChars(content); - else - w.encodeText(content); - } + @Override /* Common */ + public Text lang(String lang) { + super.lang(lang); + return this; } } http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/Utils.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/Utils.java b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Utils.java new file mode 100644 index 0000000..2c781b9 --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/Utils.java @@ -0,0 +1,49 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.atom; + +import java.net.*; +import java.util.*; + +import javax.xml.bind.*; + +/** + * Static utility methods for ATOM marshalling code. + */ +class Utils { + + /** + * Converts a string to a URI without a {@link URISyntaxException} + * + * @param uri The URI string to convert. + * @return A new URI object. + */ + static final URI toURI(String uri) { + try { + return new URI(uri); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } + + /** + * Converts an ISO8601 date-time string to a {@link Calendar}. + * + * @param lexicalXSDDateTime The ISO8601 date-time string. + * @return A new {@link Calendar} object. + */ + static final Calendar parseDateTime(String lexicalXSDDateTime) { + return DatatypeConverter.parseDateTime(lexicalXSDDateTime); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html b/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html index d35aa51..65bd484 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html +++ b/juneau-core/src/main/java/org/apache/juneau/dto/atom/package.html @@ -88,43 +88,50 @@ <div class='topic'> <p> The Juneau ATOM feed DTOs are simply beans with fluent-style setters.<br> - The following code shows a feed being created programmatically: + The following code shows a feed being created programmatically using </p> <p class='bcode'> - Feed feed = <jk>new</jk> Feed() - .setTitle(<jk>new</jk> Text(<js>"text"</js>, <js>"Juneau ATOM specification"</js>)) - .setSubTitle(<jk>new</jk> Text(<js>"html"</js>, <js>"Describes <em>stuff</em> about Juneau"</js>)) - .setUpdated(<jsm>parseDateTime</jsm>(<js>"2016-01-02T03:04:05Z"</js>)) - .setId(<jk>new</jk> Id(<js>"tag:juneau.apache.org"</js>)) - .addLinks( - <jk>new</jk> Link(<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://juneau.apache.org/"</js>).setHreflang(<js>"en"</js>), - <jk>new</jk> Link(<js>"self"</js>, <js>"application/atom+xml"</js>, <js>"http://juneau.apache.org/feed.atom"</js>) + + <jk>import static</jk> org.apache.juneau.dto.atom.AtomBuilder.*; + <jk>import</jk> org.apache.juneau.dto.html.HtmlBuilder; + + Feed feed = + feed(<js>"tag:juneau.apache.org"</js>, <js>"Juneau ATOM specification"</js>, <js>"2016-01-02T03:04:05Z"</js>) + .subtitle(text(<js>"html"</js>).children(<js>"Describes <em>stuff</em> about Juneau"</js>)) + .links( + link(<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://www.sample.com/"</js>).hreflang(<js>"en"</js>), + link(<js>"self"</js>, <js>"application/atom+xml"</js>, <js>"http://www.sample.com/feed.atom"</js>) ) - .setRights(<jk>new</jk> Text(<js>"Copyright (c) 2016, Apache Foundation"</js>)) - .setGenerator(<jk>new</jk> Generator(<js>"Juneau"</js>).setUri(<jk>new</jk> URI(<js>"http://juneau.apache.org/"</js>)).setVersion(<js>"1.0"</js>)) - .addEntries( - <jk>new</jk> Entry() - .setTitle(<jk>new</jk> Text(<js>"Juneau ATOM specification snapshot"</js>)) - .addLinks( - <jk>new</jk> Link(<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://juneau.apache.org/juneau.atom"</js>), - <jk>new</jk> Link(<js>"enclosure"</js>, <js>"audio/mpeg"</js>, <js>""http://juneau.apache.org/audio/juneau_podcast.mp3"</js>).setLength(12345) - ) - .setId(<jk>new</jk> Id(<js>"tag:juneau.apache.org"</js>)) - .setUpdated(<jsm>parseDateTime</jsm>(<js>"2016-01-02T03:04:05Z"</js>)) - .setPublished(<jsm>parseDateTime</jsm>(<js>"2016-01-02T03:04:05Z"</js>)) - .addAuthors(<jk>new</jk> Person(<js>"James Bognar"</js>).setUri(<jk>new</jk> URI(<js>"http://juneau.apache.org/"</js>)).setEmail(<js>"[email protected]"</js>)) - .addContributors( - <jk>new</jk> Person(<js>"Barry M. Caceres"</js>) - ) - .setContent( - <jk>new</jk> Content() - .setLang(<js>"en"</js>) - .setBase(<jk>new</jk> URI(<js>"http://www.apache.org/"</js>)) - .setType(<js>"xhtml"</js>) - .setText(<js>"<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>*lt;i>[Update: Juneau supports ATOM.]</i></p></div>"</js>) - ) + .rights(<js>"Copyright (c) 2016, Apache Foundation"</js>) + .generator( + generator(<js>"Juneau"</js>).uri(<js>"http://juneau.apache.org/"</js>).version(<js>"1.0"</js>) ) - ; + .entries( + entry(<js>"tag:juneau.sample.com,2013:1.2345"</js>, <js>"Juneau ATOM specification snapshot"</js>, <js>"2016-01-02T03:04:05Z"</js>) + .links( + link<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://www.sample.com/2012/05/08/juneau.atom"</js>), + link(<js>"enclosure"</js>, <js>"audio/mpeg"</js>, <js>"http://www.sample.com/audio/juneau_podcast.mp3"</js>).length(1337) + ) + .published(<js>"2016-01-02T03:04:05Z"</js>) + .authors( + person(<js>"James Bognar"</js>).uri(<js>"http://www.sample.com/"</js>).email(<js>"[email protected]"</js>) + ) + .contributors( + person(<js>"Barry M. Caceres"</js>) + ) + .content( + content(<js>"xhtml"</js>) + .lang(<js>"en"</js>) + .base(<js>"http://www.apache.org/"</js>) + .children( + HtmlBuilder.div().child( + HtmlBuilder.p( + HtmlBuilder.i(<js>"[Update: Juneau supports ATOM.]"</js>) + ) + ) + ) + ) + ); </p> <p> To serialize this to ATOM, use the {@link org.apache.juneau.xml.XmlSerializer} class: @@ -133,7 +140,7 @@ <h6 class='figure'>Example with no namespaces</h6> <p class='bcode'> <jc>// Create a serializer with readable output, no namespaces yet.</jc> - XmlSerializer s = <jk>new</jk> XmlSerializer.SqReadable().setProperty(XmlSerializerContext.<jsf>XML_enableNamespaces</jsf>, <jk>false</jk>); + XmlSerializer s = <jk>new</jk> XmlSerializer.SqReadable(); <jc>// Serialize to ATOM/XML</jc> String atomXml = s.serialize(feed); @@ -164,7 +171,7 @@ <xt><author></xt> <xt><name></xt>James Bognar<xt></name></xt> <xt><uri></xt>http://juneau.apache.org/<xt></uri></xt> - <xt><email></xt>[email protected]<xt></email></xt> + <xt><email></xt>[email protected]<xt></email></xt> <xt></author></xt> <xt><contributor></xt> <xt><name></xt>Barry M. Caceres<xt></name></xt> @@ -228,7 +235,7 @@ <xt><atom:author></xt> <xt><atom:name></xt>James Bognar<xt></atom:name></xt> <xt><atom:uri></xt>http://juneau.apache.org/<xt></atom:uri></xt> - <xt><atom:email></xt>[email protected]<xt></atom:email></xt> + <xt><atom:email></xt>[email protected]<xt></atom:email></xt> <xt></atom:author></xt> <xt><atom:contributor></xt> <xt><atom:name></xt>Barry M. Caceres<xt></atom:name></xt> @@ -291,7 +298,7 @@ <xt><author></xt> <xt><name></xt>James Bognar<xt></name></xt> <xt><uri></xt>http://juneau.apache.org/<xt></uri></xt> - <xt><email></xt>[email protected]<xt></email></xt> + <xt><email></xt>[email protected]<xt></email></xt> <xt></author></xt> <xt><contributor></xt> <xt><name></xt>Barry M. Caceres<xt></name></xt> @@ -373,7 +380,7 @@ { name: <js>'James Bognar'</js>, uri: <js>'http://juneau.apache.org/'</js>, - email: <js>'[email protected]'</js> + email: <js>'[email protected]'</js> } ], contributors: [ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java new file mode 100644 index 0000000..021e7fe --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/A.java @@ -0,0 +1,118 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/text-level-semantics.html#the-a-element'><a></a> element. + */ +@Bean(typeName="a") +@SuppressWarnings("hiding") +public class A extends HtmlElementMixed { + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-download'>download</a> attribute. + * Whether to download the resource instead of navigating to it, and its file name if so. + * @param download - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A download(String download) { + attrs.put("download", download); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-href'>href</a> attribute. + * Address of the hyperlink. + * @param href - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A href(String href) { + attrs.put("href", href); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang'>hreflang</a> attribute. + * Language of the linked resource. + * @param hreflang - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A hreflang(String hreflang) { + attrs.put("hreflang", hreflang); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-rel'>rel</a> attribute. + * Relationship between the document containing the hyperlink and the destination resource. + * @param rel - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A rel(String rel) { + attrs.put("rel", rel); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-target'>target</a> attribute. + * Default browsing context for hyperlink navigation and form submission. + * @param target - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A target(String target) { + attrs.put("target", target); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-type'>type</a> attribute. + * Hint for the type of the referenced resource. + * @param type - The new value for this attribute. + * @return This object (for method chaining). + */ + public final A type(String type) { + attrs.put("type", type); + return this; + } + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final A _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final A id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElementMixed */ + public A children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public A child(Object child) { + this.children.add(child); + return this; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/Abbr.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Abbr.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Abbr.java new file mode 100644 index 0000000..287feba --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Abbr.java @@ -0,0 +1,58 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/text-level-semantics.html#the-abbr-element'><abbr></a> element. + * <p> + */ +@Bean(typeName="abbr") +@SuppressWarnings("hiding") +public class Abbr extends HtmlElementMixed { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Abbr _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Abbr id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Abbr title(String title) { + super.title(title); + return this; + } + + @Override /* HtmlElementMixed */ + public Abbr children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Abbr child(Object child) { + this.children.add(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/Address.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Address.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Address.java new file mode 100644 index 0000000..cb320f4 --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Address.java @@ -0,0 +1,52 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/sections.html#the-address-element'><address></a> element. + * <p> + */ +@Bean(typeName="address") +@SuppressWarnings("hiding") +public class Address extends HtmlElementMixed { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Address _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Address id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElementMixed */ + public Address children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Address child(Object child) { + this.children.add(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java new file mode 100644 index 0000000..4fd994b --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Area.java @@ -0,0 +1,138 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/embedded-content-0.html#the-area-element'><area></a> element. + * <p> + */ +@Bean(typeName="area") +public class Area extends HtmlElement { + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-alt'>alt</a> attribute. + * Replacement text for use when images are not available. + * @param alt - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area alt(String alt) { + attrs.put("alt", alt); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-coords'>coords</a> attribute. + * Coordinates for the shape to be created in an image map. + * @param coords - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area coords(String coords) { + attrs.put("coords", coords); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-download'>download</a> attribute. + * Whether to download the resource instead of navigating to it, and its file name if so. + * @param download - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area download(String download) { + attrs.put("download", download); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-href'>href</a> attribute. + * Address of the hyperlink. + * @param href - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area href(String href) { + attrs.put("href", href); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-hreflang'>hreflang</a> attribute. + * Language of the linked resource. + * @param hreflang - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area hreflang(String hreflang) { + attrs.put("hreflang", hreflang); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-rel'>rel</a> attribute. + * Relationship between the document containing the hyperlink and the destination resource. + * @param rel - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area rel(String rel) { + attrs.put("rel", rel); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/embedded-content-0.html#attr-area-shape'>shape</a> attribute. + * The kind of shape to be created in an image map. + * @param shape - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area shape(String shape) { + attrs.put("shape", shape); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-target'>target</a> attribute. + * Browsing context for hyperlink navigation. + * @param target - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area target(String target) { + attrs.put("target", target); + return this; + } + + /** + * <a class='doclink' href='https://www.w3.org/TR/html5/links.html#attr-hyperlink-type'>type</a> attribute. + * Hint for the type of the referenced resource. + * @param type - The new value for this attribute. + * @return This object (for method chaining). + */ + public final Area type(String type) { + attrs.put("type", type); + return this; + } + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Area _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Area id(String id) { + super.id(id); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java new file mode 100644 index 0000000..9089197 --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Article.java @@ -0,0 +1,96 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/sections.html#the-article-element'><article></a> element. + * <p> + */ +@Bean(typeName="article") +@SuppressWarnings("hiding") +public class Article extends HtmlElementMixed { + + /** + * Adds a header node to this element. + * + * @param children The children inside the header node. + * @return This object (for method chaining). + */ + public Article header(Object...children) { + super.child(HtmlBuilder.header(children)); + return this; + } + + /** + * Adds a footer node to this element. + * + * @param children The children inside the footer node. + * @return This object (for method chaining). + */ + public Article footer(Object...children) { + super.child(HtmlBuilder.footer(children)); + return this; + } + + /** + * Adds a link node to this element. + * + * @param link The link node to add to this article. + * @return This object (for method chaining). + */ + public Article link(Link link) { + super.child(link); + return this; + } + + /** + * Adds a section node to this element. + * + * @param section The section node to add to this article. + * @return This object (for method chaining). + */ + public Article section(Section section) { + super.child(section); + return this; + } + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Article _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Article id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElementMixed */ + public Article children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Article child(Object child) { + this.children.add(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/4fb01038/juneau-core/src/main/java/org/apache/juneau/dto/html5/Aside.java ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/Aside.java b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Aside.java new file mode 100644 index 0000000..9203593 --- /dev/null +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/Aside.java @@ -0,0 +1,52 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.dto.html5; + +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a href='https://www.w3.org/TR/html5/sections.html#the-aside-element'><aside></a> element. + * <p> + */ +@Bean(typeName="aside") +@SuppressWarnings("hiding") +public class Aside extends HtmlElementMixed { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Aside _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Aside id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElementMixed */ + public Aside children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Aside child(Object child) { + this.children.add(child); + return this; + } +}
