Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1D843200CF9 for ; Sat, 2 Sep 2017 16:10:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1BAED166EBD; Sat, 2 Sep 2017 14:10:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E658E166E91 for ; Sat, 2 Sep 2017 16:10:52 +0200 (CEST) Received: (qmail 28000 invoked by uid 500); 2 Sep 2017 14:10:52 -0000 Mailing-List: contact commits-help@juneau.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.incubator.apache.org Delivered-To: mailing list commits@juneau.incubator.apache.org Received: (qmail 27977 invoked by uid 99); 2 Sep 2017 14:10:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Sep 2017 14:10:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 000851A075F for ; Sat, 2 Sep 2017 14:10:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.722 X-Spam-Level: X-Spam-Status: No, score=-3.722 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id DWb2WglykORQ for ; Sat, 2 Sep 2017 14:10:28 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id F12D761037 for ; Sat, 2 Sep 2017 14:10:25 +0000 (UTC) Received: (qmail 27367 invoked by uid 99); 2 Sep 2017 14:10:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Sep 2017 14:10:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2D4D2F566E; Sat, 2 Sep 2017 14:10:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamesbognar@apache.org To: commits@juneau.incubator.apache.org Date: Sat, 02 Sep 2017 14:10:39 -0000 Message-Id: <7318b5d103ef48ab9903471a9d6dc603@git.apache.org> In-Reply-To: <2baa6c805a0647b3a1512a5ef9d11254@git.apache.org> References: <2baa6c805a0647b3a1512a5ef9d11254@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [17/51] [partial] incubator-juneau git commit: Add project hierarchies, part 1 archived-at: Sat, 02 Sep 2017 14:10:55 -0000 http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/DataSet.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/DataSet.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/DataSet.java new file mode 100644 index 0000000..6be8583 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/DataSet.java @@ -0,0 +1,208 @@ +// *************************************************************************************************************************** +// * 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.cognos; + +import java.util.*; + +import org.apache.juneau.*; +import org.apache.juneau.annotation.*; +import org.apache.juneau.xml.annotation.*; + +/** + * Represents a Cognos dataset. + * + *

+ * When serialized to XML, creates the following construct (example pulled from AddressBookResource): + *

+ * <?xml version='1.0' encoding='UTF-8'?> + * <c:dataset xmlns:c='http://developer.cognos.com/schemas/xmldata/1/'> + * <c:metadata> + * <c:item name='name' type='xs:String' + * length='255'/> + * <c:item name='age' type='xs:int'/> + * <c:item name='numAddresses' type='xs:int'/> + * </c:metadata> + * <c:data> + * <c:row> + * <c:value>Barack Obama</c:value> + * <c:value>52</c:value> + * <c:value>2</c:value> + * </c:row> + * <c:row> + * <c:value>George Walker Bush</c:value> + * <c:value>67</c:value> + * <c:value>2</c:value> + * </c:row> + * </c:data> + * </c:dataset> + *

+ * + *

+ * Only 2-dimensional POJOs (arrays or collections of maps or beans) can be serialized to Cognos. + * + *

Example:
+ * + * The construct shown above is a serialized AddressBook object which is a subclass of + * LinkedList<Person>. + * The code for generating the XML is as follows... + *

+ *

+ * Column[] items = { + * new Column("name", "xs:String", 255), + * new Column("age", "xs:int"), + * new Column("numAddresses", "xs:int") + * .addPojoSwap( + * new PojoSwap<Person,Integer>() { + * @Override + * public Integer swap(Person p) { + * return p.addresses.size(); + * } + * } + * ) + * }; + * + * DataSet ds = new DataSet(items, addressBook, BeanContext.DEFAULT); + * + * String xml = XmlSerializer.DEFAULT_SQ.serialize(ds); + *

+ */ +@SuppressWarnings("unchecked") +@Bean(typeName="dataset", properties="metadata,data") +public class DataSet { + + private Column[] metaData; + private List data; + + /** Bean constructor. */ + public DataSet() {} + + /** + * Constructor. + * + * @param columns The meta-data that represents the columns in the dataset. + * @param o + * The POJO being serialized to Cognos. + * Must be an array/collection of beans/maps. + * @param session The bean session used to convert POJOs to strings. + * @throws Exception An error occurred trying to serialize the POJO. + */ + public DataSet(Column[] columns, Object o, BeanSession session) throws Exception { + metaData = columns; + data = new LinkedList(); + if (o != null) { + if (o.getClass().isArray()) + o = Arrays.asList((Object[])o); + if (o instanceof Collection) { + Collection c = (Collection)o; + for (Object o2 : c) { + Row r = new Row(); + Map m = null; + if (o2 instanceof Map) + m = (Map)o2; + else + m = session.toBeanMap(o2); + for (Column col : columns) { + Object v; + if (col.pojoSwap != null) + v = col.pojoSwap.swap(session, o2); + else + v = m.get(col.getName()); + r.add(v == null ? null : v.toString()); + } + data.add(r); + } + } + } + } + + /** + * Represents a row of data. + * + *

+ * When serialized to XML, creates the following construct (example pulled from AddressBookResource): + *

+ * <row> + * <value>Barack Obama</value> + * <value>52</value> + * <value>2</value> + * </row> + *

+ */ + @Bean(typeName="row") + public static class Row { + private List values = new LinkedList(); + + private void add(String value) { + values.add(value); + } + + /** + * Returns the values in this row. + * + * @return The values in this row. + */ + @Xml(format=XmlFormat.COLLAPSED, childName="value") + public List getValues() { + return values; + } + } + + + //-------------------------------------------------------------------------------- + // Bean properties + //-------------------------------------------------------------------------------- + + /** + * Bean property getter: metadata. + * + * @return The value of the metadata property on this bean, or null if it is not set. + */ + @BeanProperty("metadata") + public Column[] getMetaData() { + return metaData; + } + + /** + * Bean property setter: metadata. + * + * @param metaData The new value for the metadata property on this bean. + * @return This object (for method chaining). + */ + @BeanProperty("metadata") + public DataSet setMetaData(Column[] metaData) { + this.metaData = metaData; + return this; + } + + /** + * Bean property getter: data. + * + * @return The value of the data property on this bean, or null if it is not set. + */ + @BeanProperty("data") + public List getData() { + return data; + } + + /** + * Bean property setter: data. + * + * @param data The new value for the data property on this bean. + * @return This object (for method chaining). + */ + @BeanProperty("data") + public DataSet setData(List data) { + this.data = data; + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/HTML.png ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/HTML.png b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/HTML.png new file mode 100644 index 0000000..fd63c23 Binary files /dev/null and b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/HTML.png differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/JSON.png ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/JSON.png b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/JSON.png new file mode 100644 index 0000000..44785ad Binary files /dev/null and b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/JSON.png differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/RDFXML.png ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/RDFXML.png b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/RDFXML.png new file mode 100644 index 0000000..081e949 Binary files /dev/null and b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/doc-files/RDFXML.png differ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package-info.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package-info.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package-info.java new file mode 100644 index 0000000..484563d --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package-info.java @@ -0,0 +1,17 @@ +// *************************************************************************************************************************** +// * 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. * +// *************************************************************************************************************************** +// XML namespaces used in this package +@XmlSchema(prefix="cognos", namespace="http://developer.cognos.com/schemas/xmldata/1/") +package org.apache.juneau.dto.cognos; +import org.apache.juneau.xml.annotation.*; + http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package.html ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package.html b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package.html new file mode 100644 index 0000000..b19a781 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/cognos/package.html @@ -0,0 +1,183 @@ + + + + + + + + + +

Cognos Data Transfer Objects

+ +
Table of Contents
+
    +
  1. Cognos serialization support

    +
  2. Cognos parsing support

    +
+ + + +

1 - Cognos serialization support

+
+

+ The {@link org.apache.juneau.dto.cognos.DataSet} class is a DTO used to convert POJO models directly to Cognos-XML. +

+

+ Because of the nature of the Cognos XML syntax, only 2-dimensional POJO data structures can be serialized to Cognos-XML. +

+

+ For example... +

+
    +
  • Collection<Bean> +
  • Collection<Map> +
  • {@code MyBean[]} +
  • {@code HashMap[]} +
+ +
Example:
+

+ The following example shows how to generate Cognos-XML from a POJO. + The example uses the AddressBook sample POJO. + It should be noted that since the {@code AddressBook} class is a subclass of {@code LinkedList}, it fulfills + the requirement of being a tabular data structure. +

+

+ // Create our POJO with some entries. + AddressBook addressBook = new AddressBook(); + addressBook.add( + new Person("Barack Obama", "Aug 4, 1961", + new Address("1600 Pennsylvania Ave", "Washington", "DC", 20500, true), + new Address("5046 S Greenwood Ave", "Chicago", "IL", 60615, false) + ) + ); + addressBook.add( + new Person("George Walker Bush", "Jul 6, 1946", + new Address("43 Prairie Chapel Rd", "Crawford", "TX", 76638, true), + new Address("1600 Pennsylvania Ave", "Washington", "DC", 20500, false) + ) + ); + + // Define the Cognos metadata + Column[] items = { + new Column("name", "xs:String", 255), + new Column("age", "xs:int"), + new Column("numAddresses", "xs:int") + .addPojoSwap( + new PojoSwap<Person,Integer>() { + @Override + public Integer swap(BeanSession session, Person p) { + return p.addresses.size(); + } + } + ) + }; + + // Create the Cognos DataSet object + DataSet ds = new DataSet(items, addressBook, BeanContext.DEFAULT); + + // Serialize it to XML + String xml = XmlSerializer.DEFAULT_SQ.serialize(ds); +

+

+ When run, this code produces the following XML... +

+

+ <?xml version='1.0' encoding='UTF-8'?> + <c:dataset xmlns:c='http://developer.cognos.com/schemas/xmldata/1/'> + <c:metadata> + <c:item name='name' type='xs:String' length='255'/> + <c:item name='age' type='xs:int'/> + <c:item name='numAddresses' type='xs:int'/> + </c:metadata> + <c:data> + <c:row> + <c:value>Barack Obama</c:value> + <c:value>52</c:value> + <c:value>2</c:value> + </c:row> + <c:row> + <c:value>George Walker Bush</c:value> + <c:value>67</c:value> + <c:value>2</c:value> + </c:row> + </c:data> + </c:dataset> +

+ +
Other data formats
+

+ The following shows examples of what this data structure looks like when serialized to other formats: +

+ +
HTML
+ + +
JSON
+ + +
RDF/XML
+ +
+ + + +

2 - Cognos parsing support

+
+

+ The {@link org.apache.juneau.dto.cognos.DataSet} class can be reconstructed from Cognos/XML using one of the standard XML parsers. +

+ +
Example:
+

+ // Parse XML back into original DataSet + DataSet ds = XmlParser.DEFAULT.parse(xml, DataSet.class); +

+
+ + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/A.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/A.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/A.java new file mode 100644 index 0000000..5138fcc --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/A.java @@ -0,0 +1,169 @@ +// *************************************************************************************************************************** +// * 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 java.net.*; +import java.net.URI; + +import org.apache.juneau.*; +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <a> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="a") +public class A extends HtmlElementMixed { + + /** + * download 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. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final A download(Object download) { + attr("download", download); + return this; + } + + /** + * href attribute. + * + *

+ * Address of the hyperlink. + * + *

+ * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. + * Strings must be valid URIs. + * + *

+ * URIs defined by {@link UriResolver} can be used for values. + * + * @param href + * The new value for this attribute. + * Typically a {@link URL} or {@link String}. + * @return This object (for method chaining). + */ + public final A href(Object href) { + attrUri("href", href); + return this; + } + + /** + * hreflang 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) { + attr("hreflang", hreflang); + return this; + } + + /** + * rel 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) { + attr("rel", rel); + return this; + } + + /** + * target 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) { + attr("target", target); + return this; + } + + /** + * type 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) { + attr("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 /* HtmlElement */ + public final A style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public A children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public A child(Object child) { + super.child(child); + return this; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Abbr.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Abbr.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Abbr.java new file mode 100644 index 0000000..0e2c075 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Abbr.java @@ -0,0 +1,75 @@ +// *************************************************************************************************************************** +// * 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 <abbr> + * element. + * + *

Additional Information
+ * + */ +@Bean(typeName="abbr") +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 style(String style) { + super.style(style); + 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) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Address.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Address.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Address.java new file mode 100644 index 0000000..cd60484 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Address.java @@ -0,0 +1,69 @@ +// *************************************************************************************************************************** +// * 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 <address> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="address") +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 /* HtmlElement */ + public final Address style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Address children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Address child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Area.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Area.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Area.java new file mode 100644 index 0000000..97a4463 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Area.java @@ -0,0 +1,200 @@ +// *************************************************************************************************************************** +// * 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 java.net.*; +import java.net.URI; + +import org.apache.juneau.*; +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <area> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="area") +public class Area extends HtmlElementVoid { + + /** + * alt 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) { + attr("alt", alt); + return this; + } + + /** + * coords + * 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) { + attr("coords", coords); + return this; + } + + /** + * download 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. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final Area download(Object download) { + attr("download", download); + return this; + } + + /** + * href attribute. + * + *

+ * Address of the hyperlink. + * + *

+ * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. + * Strings must be valid URIs. + * + *

+ * URIs defined by {@link UriResolver} can be used for values. + * + * @param href + * The new value for this attribute. + * Typically a {@link URL} or {@link String}. + * @return This object (for method chaining). + */ + public final Area href(Object href) { + attrUri("href", href); + return this; + } + + /** + * hreflang 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) { + attr("hreflang", hreflang); + return this; + } + + /** + * rel 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) { + attr("rel", rel); + return this; + } + + /** + * shape 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) { + attr("shape", shape); + return this; + } + + /** + * target 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) { + attr("target", target); + return this; + } + + /** + * type 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) { + attr("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; + } + + @Override /* HtmlElement */ + public final Area style(String style) { + super.style(style); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Article.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Article.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Article.java new file mode 100644 index 0000000..519e4b0 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Article.java @@ -0,0 +1,114 @@ +// *************************************************************************************************************************** +// * 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 <article> + * element. + * + *

Additional Information
+ * + */ +@Bean(typeName="article") +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 /* HtmlElement */ + public final Article style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Article children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Article child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Aside.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Aside.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Aside.java new file mode 100644 index 0000000..ca5cf08 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Aside.java @@ -0,0 +1,69 @@ +// *************************************************************************************************************************** +// * 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 <aside> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="aside") +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 /* HtmlElement */ + public final Aside style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Aside children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Aside child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Audio.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Audio.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Audio.java new file mode 100644 index 0000000..1acd391 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Audio.java @@ -0,0 +1,209 @@ +// *************************************************************************************************************************** +// * 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 java.net.*; +import java.net.URI; + +import org.apache.juneau.*; +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <audio> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="audio") +public class Audio extends HtmlElementContainer { + + /** + * autoplay + * attribute. + * + *

+ * Hint that the media resource can be started automatically when the page is loaded. + * + * @param autoplay + * The new value for this attribute. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final Audio autoplay(Object autoplay) { + attr("autoplay", autoplay); + return this; + } + + /** + * controls + * attribute. + * + *

+ * Show user agent controls. + * + * @param controls + * The new value for this attribute. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final Audio controls(Object controls) { + attr("controls", controls); + return this; + } + + /** + * crossorigin + * attribute. + * + *

+ * How the element handles cross-origin requests. + * + * @param crossorigin The new value for this attribute. + * @return This object (for method chaining). + */ + public final Audio crossorigin(String crossorigin) { + attr("crossorigin", crossorigin); + return this; + } + + /** + * loop attribute. + * + *

+ * Whether to loop the media resource. + * + * @param loop + * The new value for this attribute. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final Audio loop(Object loop) { + attr("loop", loop); + return this; + } + + /** + * mediagroup + * attribute. + * + *

+ * Groups media elements together with an implicit MediaController. + * + * @param mediagroup The new value for this attribute. + * @return This object (for method chaining). + */ + public final Audio mediagroup(String mediagroup) { + attr("mediagroup", mediagroup); + return this; + } + + /** + * muted + * attribute. + * + *

+ * Whether to mute the media resource by default. + * + * @param muted + * The new value for this attribute. + * Typically a {@link Boolean} or {@link String}. + * @return This object (for method chaining). + */ + public final Audio muted(Object muted) { + attr("muted", muted); + return this; + } + + /** + * preload + * attribute. + * + *

+ * Hints how much buffering the media resource will likely need. + * + * @param preload The new value for this attribute. + * @return This object (for method chaining). + */ + public final Audio preload(Object preload) { + attr("preload", preload); + return this; + } + + /** + * src attribute. + * + *

+ * Address of the resource. + * + *

+ * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. + * Strings must be valid URIs. + * + *

+ * URIs defined by {@link UriResolver} can be used for values. + * + * @param src + * The new value for this attribute. + * Typically a {@link URL} or {@link String}. + * @return This object (for method chaining). + */ + public final Audio src(Object src) { + attrUri("src", src); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Audio _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Audio id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Audio style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementContainer */ + public final Audio children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementContainer */ + public final Audio child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/B.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/B.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/B.java new file mode 100644 index 0000000..d4beaba --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/B.java @@ -0,0 +1,69 @@ +// *************************************************************************************************************************** +// * 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 <b> + * element. + * + *

Additional Information
+ * + */ +@Bean(typeName="b") +public class B extends HtmlElementMixed { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final B _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final B id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final B style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public B children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public B child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Base.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Base.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Base.java new file mode 100644 index 0000000..253be94 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Base.java @@ -0,0 +1,100 @@ +// *************************************************************************************************************************** +// * 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 java.net.*; +import java.net.URI; + +import org.apache.juneau.*; +import org.apache.juneau.annotation.*; + +/** + * DTO for an HTML <base> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="base") +public class Base extends HtmlElementVoid { + + /** + * href attribute. + * + *

+ * Document base URL. + * + *

+ * The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}. + * Strings must be valid URIs. + * + *

+ * URIs defined by {@link UriResolver} can be used for values. + * + * @param href + * The new value for this attribute. + * Typically a {@link URL} or {@link String}. + * @return This object (for method chaining). + */ + public final Base href(Object href) { + attrUri("href", href); + return this; + } + + /** + * target + * 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 Base target(String target) { + attr("target", target); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Base _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Base id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Base style(String style) { + super.style(style); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdi.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdi.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdi.java new file mode 100644 index 0000000..bba51e5 --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdi.java @@ -0,0 +1,63 @@ +// *************************************************************************************************************************** +// * 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 <bdi> + * element. + * + *

Additional Information
+ * + */ +@Bean(typeName="bdi") +public class Bdi extends HtmlElementText { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Bdi _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Bdi id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Bdi style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementText */ + public Bdi text(Object text) { + super.text(text); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdo.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdo.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdo.java new file mode 100644 index 0000000..b8c6acf --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Bdo.java @@ -0,0 +1,75 @@ +// *************************************************************************************************************************** +// * 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 <bdo> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="bdo") +public class Bdo extends HtmlElementMixed { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Bdo _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public Bdo dir(String dir) { + super.dir(dir); + return this; + } + + @Override /* HtmlElement */ + public final Bdo id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Bdo style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Bdo children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Bdo child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Blockquote.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Blockquote.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Blockquote.java new file mode 100644 index 0000000..bcaa2db --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Blockquote.java @@ -0,0 +1,85 @@ +// *************************************************************************************************************************** +// * 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 <blockquote> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="blockquote") +public class Blockquote extends HtmlElementMixed { + + /** + * cite + * attribute. + * + *

+ * Link to the source of the quotation. + * + * @param cite The new value for this attribute. + * @return This object (for method chaining). + */ + public final Blockquote cite(String cite) { + attr("cite", cite); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Blockquote _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Blockquote id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Blockquote style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Blockquote children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Blockquote child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Body.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Body.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Body.java new file mode 100644 index 0000000..8bd8b3f --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Body.java @@ -0,0 +1,142 @@ +// *************************************************************************************************************************** +// * 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 <body> + * element. + * + *

Additional Information
+ * + */ +@Bean(typeName="body") +public class Body extends HtmlElementMixed { + + /** + * onafterprint + * attribute. + * + * @param onafterprint The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body onafterprint(String onafterprint) { + attr("onafterprint", onafterprint); + return this; + } + + /** + * onbeforeunload + * attribute. + * + * @param onbeforeunload The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body onbeforeunload(String onbeforeunload) { + attr("onbeforeunload", onbeforeunload); + return this; + } + + /** + * onmessage + * attribute. + * + * @param onmessage The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body onmessage(String onmessage) { + attr("onmessage", onmessage); + return this; + } + + /** + * ononline + * attribute. + * + * @param ononline The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body ononline(String ononline) { + attr("ononline", ononline); + return this; + } + + /** + * onpageshow + * attribute. + * + * @param onpageshow The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body onpageshow(String onpageshow) { + attr("onpageshow", onpageshow); + return this; + } + + /** + * onstorage + * attribute. + * + * @param onstorage The new value for this attribute. + * @return This object (for method chaining). + */ + public final Body onstorage(String onstorage) { + attr("onstorage", onstorage); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Body _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Body id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Body style(String style) { + super.style(style); + return this; + } + + @Override /* HtmlElementMixed */ + public Body children(Object...children) { + super.children(children); + return this; + } + + @Override /* HtmlElementMixed */ + public Body child(Object child) { + super.child(child); + return this; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/75b0d8ee/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Br.java ---------------------------------------------------------------------- diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Br.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Br.java new file mode 100644 index 0000000..e7eba5e --- /dev/null +++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/html5/Br.java @@ -0,0 +1,57 @@ +// *************************************************************************************************************************** +// * 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 <br> + * element. + * + *
Additional Information
+ * + */ +@Bean(typeName="br") +public class Br extends HtmlElementVoid { + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* HtmlElement */ + public final Br _class(String _class) { + super._class(_class); + return this; + } + + @Override /* HtmlElement */ + public final Br id(String id) { + super.id(id); + return this; + } + + @Override /* HtmlElement */ + public final Br style(String style) { + super.style(style); + return this; + } +}