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 <[email protected]>
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
<code>toString()</code> 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
<code>toString()</code> 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 <code>text(o, <jk>false</jk>);</code>
*
* @param o The object being serialized.
--
To stop receiving notification emails like this one, please contact
[email protected].