From commits-return-5215-archive-asf-public=cust-asf.ponee.io@juneau.apache.org Sun Mar 18 17:11:28 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B90A1180645 for ; Sun, 18 Mar 2018 17:11:27 +0100 (CET) Received: (qmail 23253 invoked by uid 500); 18 Mar 2018 16:11:26 -0000 Mailing-List: contact commits-help@juneau.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@juneau.apache.org Delivered-To: mailing list commits@juneau.apache.org Received: (qmail 23244 invoked by uid 99); 18 Mar 2018 16:11:26 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Mar 2018 16:11:26 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 30B5280781; Sun, 18 Mar 2018 16:11:26 +0000 (UTC) Date: Sun, 18 Mar 2018 16:11:26 +0000 To: "commits@juneau.apache.org" Subject: [juneau] branch master updated: Support serialized POJOs inside HTML5 beans. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152138948615.5799.11872235872519656260@gitbox.apache.org> From: jamesbognar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: juneau X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 49383e75238c19ea560e9a336dcac808499c7dfb X-Git-Newrev: 1f73312d964331a2350036650eee7ed6faa7ac2c X-Git-Rev: 1f73312d964331a2350036650eee7ed6faa7ac2c X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git The following commit(s) were added to refs/heads/master by this push: new 1f73312 Support serialized POJOs inside HTML5 beans. 1f73312 is described below commit 1f73312d964331a2350036650eee7ed6faa7ac2c Author: JamesBognar AuthorDate: Sun Mar 18 12:11:00 2018 -0400 Support serialized POJOs inside HTML5 beans. --- .../java/org/apache/juneau/html/HtmlSerializerSession.java | 10 +++++----- .../src/main/java/org/apache/juneau/html/HtmlWriter.java | 13 ------------- .../src/main/java/org/apache/juneau/xml/XmlWriter.java | 12 ++++++++++++ 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java index e574a0c..fea125a 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlSerializerSession.java @@ -205,7 +205,7 @@ public class HtmlSerializerSession extends XmlSerializerSession { * @return The same writer passed in. * @throws IOException If a problem occurred trying to send output to the writer. */ - private HtmlWriter doSerialize(Object o, HtmlWriter w) throws Exception { + private XmlWriter doSerialize(Object o, XmlWriter w) throws Exception { serializeAnything(w, o, getExpectedRootType(o), null, getInitialDepth()-1, null, true); return w; } @@ -226,7 +226,7 @@ public class HtmlSerializerSession extends XmlSerializerSession { * @throws Exception If a problem occurred trying to convert the output. */ @SuppressWarnings({ "rawtypes", "unchecked" }) - protected ContentResult serializeAnything(HtmlWriter out, Object o, + protected ContentResult serializeAnything(XmlWriter out, Object o, ClassMeta eType, String name, int xIndent, BeanPropertyMeta pMeta, boolean isRoot) throws Exception { ClassMeta aType = null; // The actual type @@ -384,7 +384,7 @@ public class HtmlSerializerSession extends XmlSerializerSession { } @SuppressWarnings({ "rawtypes" }) - private void serializeMap(HtmlWriter out, Map m, ClassMeta sType, + private void serializeMap(XmlWriter out, Map m, ClassMeta sType, ClassMeta eKeyType, ClassMeta eValueType, String typeName, BeanPropertyMeta ppMeta) throws Exception { ClassMeta keyType = eKeyType == null ? string() : eKeyType; @@ -444,7 +444,7 @@ public class HtmlSerializerSession extends XmlSerializerSession { out.ie(i).eTag("table").nl(i); } - private void serializeBeanMap(HtmlWriter out, BeanMap m, ClassMeta eType, + private void serializeBeanMap(XmlWriter out, BeanMap m, ClassMeta eType, BeanPropertyMeta ppMeta) throws Exception { int i = indent; @@ -516,7 +516,7 @@ public class HtmlSerializerSession extends XmlSerializerSession { } @SuppressWarnings({ "rawtypes", "unchecked" }) - private void serializeCollection(HtmlWriter out, Object in, ClassMeta sType, + private void serializeCollection(XmlWriter out, Object in, ClassMeta sType, ClassMeta eType, String name, BeanPropertyMeta ppMeta) throws Exception { ClassMeta seType = sType.getElementType(); diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlWriter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlWriter.java index b5386ef..8372924 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlWriter.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/html/HtmlWriter.java @@ -39,19 +39,6 @@ public class HtmlWriter extends XmlWriter { super(out, useWhitespace, maxIndent, trimStrings, quoteChar, uriResolver, false, null); } - /** - * Append an attribute with a URI value. - * - * @param name The attribute name. - * @param value The attribute value. Can be any object whose toString() method returns a URI. - * @return This object (for method chaining); - * @throws IOException If a problem occurred. - */ - public HtmlWriter attrUri(String name, Object value) throws IOException { - super.attrUri((String)null, name, value); - return this; - } - //-------------------------------------------------------------------------------- // Overridden methods diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlWriter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlWriter.java index 4726aa6..190de12 100644 --- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlWriter.java +++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/xml/XmlWriter.java @@ -524,6 +524,18 @@ public class XmlWriter extends SerializerWriter { } /** + * Append an attribute with a URI value. + * + * @param name The attribute name. + * @param value The attribute value. Can be any object whose toString() method returns a URI. + * @return This object (for method chaining); + * @throws IOException If a problem occurred. + */ + public XmlWriter attrUri(String name, Object value) throws IOException { + return attrUri((String)null, name, value); + } + + /** * Shortcut for calling text(o, false); * * @param o The object being serialized. -- To stop receiving notification emails like this one, please contact jamesbognar@apache.org.