juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [05/42] incubator-juneau-website git commit: Update javadocs.
Date Thu, 13 Apr 2017 20:44:51 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/80ff9b74/content/site/apidocs/src-html/org/apache/juneau/uon/UonWriter.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/uon/UonWriter.html b/content/site/apidocs/src-html/org/apache/juneau/uon/UonWriter.html
index e8ea012..4c30f4e 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/uon/UonWriter.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/uon/UonWriter.html
@@ -48,245 +48,229 @@
 <span class="sourceLineNo">040</span>   // Characters that need to be preceeded with an escape character.<a name="line.40"></a>
 <span class="sourceLineNo">041</span>   private static final AsciiSet escapedChars = new AsciiSet("~'");<a name="line.41"></a>
 <span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>   private static final AsciiSet needsQuoteChars = new AsciiSet("),=\n\t\r\b\f ");<a name="line.43"></a>
+<span class="sourceLineNo">043</span>   private static final AsciiSet noChars = new AsciiSet("");<a name="line.43"></a>
 <span class="sourceLineNo">044</span><a name="line.44"></a>
-<span class="sourceLineNo">045</span>   private static final AsciiSet maybeNeedsQuotesFirstChar = new AsciiSet("),=\n\t\r\b\f tfn+-.#0123456789");<a name="line.45"></a>
+<span class="sourceLineNo">045</span>   private static char[] hexArray = "0123456789ABCDEF".toCharArray();<a name="line.45"></a>
 <span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>   private static char[] hexArray = "0123456789ABCDEF".toCharArray();<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>   /**<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    * Constructor.<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    *<a name="line.51"></a>
-<span class="sourceLineNo">052</span>    * @param session The session that created this writer.<a name="line.52"></a>
-<span class="sourceLineNo">053</span>    * @param out The writer being wrapped.<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    * @param useWhitespace If &lt;jk&gt;true&lt;/jk&gt;, tabs will be used in output.<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    * @param encodeChars If &lt;jk&gt;true&lt;/jk&gt;, special characters should be encoded.<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    * @param trimStrings If &lt;jk&gt;true&lt;/jk&gt;, strings should be trimmed before they're serialized.<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    * @param relativeUriBase The base (e.g. &lt;js&gt;https://localhost:9443/contextPath"&lt;/js&gt;) for relative URIs (e.g. &lt;js&gt;"my/path"&lt;/js&gt;).<a name="line.57"></a>
-<span class="sourceLineNo">058</span>    * @param absolutePathUriBase The base (e.g. &lt;js&gt;https://localhost:9443"&lt;/js&gt;) for relative URIs with absolute paths (e.g. &lt;js&gt;"/contextPath/my/path"&lt;/js&gt;).<a name="line.58"></a>
-<span class="sourceLineNo">059</span>    */<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   protected UonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, boolean encodeChars, boolean trimStrings, String relativeUriBase, String absolutePathUriBase) {<a name="line.60"></a>
-<span class="sourceLineNo">061</span>      super(out, useWhitespace, trimStrings, '\'', relativeUriBase, absolutePathUriBase);<a name="line.61"></a>
-<span class="sourceLineNo">062</span>      this.session = session;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>      this.encodeChars = encodeChars;<a name="line.63"></a>
-<span class="sourceLineNo">064</span>   }<a name="line.64"></a>
-<span class="sourceLineNo">065</span><a name="line.65"></a>
-<span class="sourceLineNo">066</span>   /**<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    * Serializes the specified simple object as a UON string value.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    *<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    * @param o The object being serialized.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    * @param isTopAttrName If this is a top-level attribute name we're serializing.<a name="line.70"></a>
-<span class="sourceLineNo">071</span>    * @return This object (for method chaining).<a name="line.71"></a>
-<span class="sourceLineNo">072</span>    * @throws IOException Should never happen.<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    */<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   public final UonWriter appendObject(Object o, boolean isTopAttrName) throws IOException {<a name="line.74"></a>
-<span class="sourceLineNo">075</span><a name="line.75"></a>
-<span class="sourceLineNo">076</span>      if (o instanceof Boolean)<a name="line.76"></a>
-<span class="sourceLineNo">077</span>         return appendBoolean(o);<a name="line.77"></a>
-<span class="sourceLineNo">078</span>      if (o instanceof Number)<a name="line.78"></a>
-<span class="sourceLineNo">079</span>         return appendNumber(o);<a name="line.79"></a>
-<span class="sourceLineNo">080</span>      if (o == null)<a name="line.80"></a>
-<span class="sourceLineNo">081</span>         return append("null");<a name="line.81"></a>
-<span class="sourceLineNo">082</span><a name="line.82"></a>
-<span class="sourceLineNo">083</span>      String s = session.toString(o);<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      char c0 = s.isEmpty() ? 0 : s.charAt(0);<a name="line.84"></a>
+<span class="sourceLineNo">047</span>   /**<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    * Constructor.<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    *<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    * @param session The session that created this writer.<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    * @param out The writer being wrapped.<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    * @param useWhitespace If &lt;jk&gt;true&lt;/jk&gt;, tabs will be used in output.<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    * @param encodeChars If &lt;jk&gt;true&lt;/jk&gt;, special characters should be encoded.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    * @param trimStrings If &lt;jk&gt;true&lt;/jk&gt;, strings should be trimmed before they're serialized.<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    * @param relativeUriBase The base (e.g. &lt;js&gt;https://localhost:9443/contextPath"&lt;/js&gt;) for relative URIs (e.g. &lt;js&gt;"my/path"&lt;/js&gt;).<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    * @param absolutePathUriBase The base (e.g. &lt;js&gt;https://localhost:9443"&lt;/js&gt;) for relative URIs with absolute paths (e.g. &lt;js&gt;"/contextPath/my/path"&lt;/js&gt;).<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    */<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   protected UonWriter(UonSerializerSession session, Writer out, boolean useWhitespace, boolean encodeChars, boolean trimStrings, String relativeUriBase, String absolutePathUriBase) {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>      super(out, useWhitespace, trimStrings, '\'', relativeUriBase, absolutePathUriBase);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>      this.session = session;<a name="line.60"></a>
+<span class="sourceLineNo">061</span>      this.encodeChars = encodeChars;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>   /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    * Serializes the specified simple object as a UON string value.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    *<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    * @param o The object being serialized.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    * @param isTopAttrName If this is a top-level attribute name we're serializing.<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    * @param plainTextParams This is a top-level name or parameter we're serializing and the parameter format is PLAINTEXT.<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    * @return This object (for method chaining).<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    * @throws IOException Should never happen.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    */<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   public final UonWriter appendObject(Object o, boolean isTopAttrName, boolean plainTextParams) throws IOException {<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>      if (o instanceof Boolean)<a name="line.75"></a>
+<span class="sourceLineNo">076</span>         return appendBoolean(o);<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      if (o instanceof Number)<a name="line.77"></a>
+<span class="sourceLineNo">078</span>         return appendNumber(o);<a name="line.78"></a>
+<span class="sourceLineNo">079</span>      if (o == null)<a name="line.79"></a>
+<span class="sourceLineNo">080</span>         return append("null");<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>      String s = session.toString(o);<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span>      boolean needsQuotes = (! plainTextParams) &amp;&amp; UonUtils.needsQuotes(s);<a name="line.84"></a>
 <span class="sourceLineNo">085</span><a name="line.85"></a>
-<span class="sourceLineNo">086</span>      boolean needsQuotes =<a name="line.86"></a>
-<span class="sourceLineNo">087</span>         s.isEmpty()<a name="line.87"></a>
-<span class="sourceLineNo">088</span>         || c0 == '@'<a name="line.88"></a>
-<span class="sourceLineNo">089</span>         || c0 == '('<a name="line.89"></a>
-<span class="sourceLineNo">090</span>         || needsQuoteChars.contains(s)<a name="line.90"></a>
-<span class="sourceLineNo">091</span>         || (<a name="line.91"></a>
-<span class="sourceLineNo">092</span>            maybeNeedsQuotesFirstChar.contains(c0)<a name="line.92"></a>
-<span class="sourceLineNo">093</span>            &amp;&amp; (<a name="line.93"></a>
-<span class="sourceLineNo">094</span>               "true".equals(s)<a name="line.94"></a>
-<span class="sourceLineNo">095</span>               || "false".equals(s)<a name="line.95"></a>
-<span class="sourceLineNo">096</span>               || "null".equals(s)<a name="line.96"></a>
-<span class="sourceLineNo">097</span>               || StringUtils.isNumeric(s)<a name="line.97"></a>
-<span class="sourceLineNo">098</span>            )<a name="line.98"></a>
-<span class="sourceLineNo">099</span>         )<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      ;<a name="line.100"></a>
-<span class="sourceLineNo">101</span><a name="line.101"></a>
-<span class="sourceLineNo">102</span>      AsciiSet unenc = (isTopAttrName ? unencodedCharsAttrName : unencodedChars);<a name="line.102"></a>
-<span class="sourceLineNo">103</span>      AsciiSet esc = escapedChars;<a name="line.103"></a>
-<span class="sourceLineNo">104</span><a name="line.104"></a>
-<span class="sourceLineNo">105</span>      if (needsQuotes)<a name="line.105"></a>
-<span class="sourceLineNo">106</span>         append('\'');<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      for (int i = 0; i &lt; s.length(); i++) {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>         char c = s.charAt(i);<a name="line.108"></a>
-<span class="sourceLineNo">109</span>         if (esc.contains(c))<a name="line.109"></a>
-<span class="sourceLineNo">110</span>            append('~');<a name="line.110"></a>
-<span class="sourceLineNo">111</span>         if ((!encodeChars) || unenc.contains(c))<a name="line.111"></a>
-<span class="sourceLineNo">112</span>            append(c);<a name="line.112"></a>
-<span class="sourceLineNo">113</span>         else {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>            if (c == ' ')<a name="line.114"></a>
-<span class="sourceLineNo">115</span>               append('+');<a name="line.115"></a>
-<span class="sourceLineNo">116</span>            else {<a name="line.116"></a>
-<span class="sourceLineNo">117</span>               int p = s.codePointAt(i);<a name="line.117"></a>
-<span class="sourceLineNo">118</span>               if (p &lt; 0x0080)<a name="line.118"></a>
-<span class="sourceLineNo">119</span>                  appendHex(p);<a name="line.119"></a>
-<span class="sourceLineNo">120</span>               else if (p &lt; 0x0800) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>                  int p1=p&gt;&gt;&gt;6;<a name="line.121"></a>
-<span class="sourceLineNo">122</span>                  appendHex(p1+192).appendHex((p&amp;63)+128);<a name="line.122"></a>
-<span class="sourceLineNo">123</span>               } else if (p &lt; 0x10000) {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>                  int p1=p&gt;&gt;&gt;6, p2=p1&gt;&gt;&gt;6;<a name="line.124"></a>
-<span class="sourceLineNo">125</span>                  appendHex(p2+224).appendHex((p1&amp;63)+128).appendHex((p&amp;63)+128);<a name="line.125"></a>
-<span class="sourceLineNo">126</span>               } else {<a name="line.126"></a>
-<span class="sourceLineNo">127</span>                  i++;  // Two-byte codepoint...skip past surrogate pair lower byte.<a name="line.127"></a>
-<span class="sourceLineNo">128</span>                  int p1=p&gt;&gt;&gt;6, p2=p1&gt;&gt;&gt;6, p3=p2&gt;&gt;&gt;6;<a name="line.128"></a>
-<span class="sourceLineNo">129</span>                  appendHex(p3+240).appendHex((p2&amp;63)+128).appendHex((p1&amp;63)+128).appendHex((p&amp;63)+128);<a name="line.129"></a>
-<span class="sourceLineNo">130</span>               }<a name="line.130"></a>
-<span class="sourceLineNo">131</span>            }<a name="line.131"></a>
-<span class="sourceLineNo">132</span>         }<a name="line.132"></a>
-<span class="sourceLineNo">133</span>      }<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      if (needsQuotes)<a name="line.134"></a>
-<span class="sourceLineNo">135</span>         append('\'');<a name="line.135"></a>
-<span class="sourceLineNo">136</span><a name="line.136"></a>
-<span class="sourceLineNo">137</span>      return this;<a name="line.137"></a>
-<span class="sourceLineNo">138</span>   }<a name="line.138"></a>
-<span class="sourceLineNo">139</span><a name="line.139"></a>
-<span class="sourceLineNo">140</span>   /**<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    * Appends a boolean value to the output.<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    *<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    * @param o The boolean value to append to the output.<a name="line.143"></a>
-<span class="sourceLineNo">144</span>    * @return This object (for method chaining).<a name="line.144"></a>
-<span class="sourceLineNo">145</span>    * @throws IOException<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    */<a name="line.146"></a>
-<span class="sourceLineNo">147</span>   protected UonWriter appendBoolean(Object o) throws IOException {<a name="line.147"></a>
-<span class="sourceLineNo">148</span>      append(o.toString());<a name="line.148"></a>
-<span class="sourceLineNo">149</span>      return this;<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   }<a name="line.150"></a>
-<span class="sourceLineNo">151</span><a name="line.151"></a>
-<span class="sourceLineNo">152</span>   /**<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    * Appends a numeric value to the output.<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    *<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    * @param o The numeric value to append to the output.<a name="line.155"></a>
-<span class="sourceLineNo">156</span>    * @return This object (for method chaining).<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    * @throws IOException<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    */<a name="line.158"></a>
-<span class="sourceLineNo">159</span>   protected UonWriter appendNumber(Object o) throws IOException {<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      append(o.toString());<a name="line.160"></a>
-<span class="sourceLineNo">161</span>      return this;<a name="line.161"></a>
-<span class="sourceLineNo">162</span>   }<a name="line.162"></a>
-<span class="sourceLineNo">163</span><a name="line.163"></a>
-<span class="sourceLineNo">164</span>   /**<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    * Prints out a two-byte %xx sequence for the given byte value.<a name="line.165"></a>
-<span class="sourceLineNo">166</span>    */<a name="line.166"></a>
-<span class="sourceLineNo">167</span>   private UonWriter appendHex(int b) throws IOException {<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      if (b &gt; 255)<a name="line.168"></a>
-<span class="sourceLineNo">169</span>         throw new IOException("Invalid value passed to appendHex.  Must be in the range 0-255.  Value=" + b);<a name="line.169"></a>
-<span class="sourceLineNo">170</span>      append('%').append(hexArray[b&gt;&gt;&gt;4]).append(hexArray[b&amp;0x0F]);<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      return this;<a name="line.171"></a>
-<span class="sourceLineNo">172</span>   }<a name="line.172"></a>
-<span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>   /**<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    * Appends a URI to the output.<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    *<a name="line.176"></a>
-<span class="sourceLineNo">177</span>    * @param uri The URI to append to the output.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>    * @return This object (for method chaining).<a name="line.178"></a>
-<span class="sourceLineNo">179</span>    * @throws IOException<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    */<a name="line.180"></a>
-<span class="sourceLineNo">181</span>   @Override<a name="line.181"></a>
-<span class="sourceLineNo">182</span>   public SerializerWriter appendUri(Object uri) throws IOException {<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      String s = uri.toString();<a name="line.183"></a>
-<span class="sourceLineNo">184</span>      if (s.indexOf("://") == -1) {<a name="line.184"></a>
-<span class="sourceLineNo">185</span>         if (StringUtils.startsWith(s, '/')) {<a name="line.185"></a>
-<span class="sourceLineNo">186</span>            if (absolutePathUriBase != null)<a name="line.186"></a>
-<span class="sourceLineNo">187</span>               append(absolutePathUriBase);<a name="line.187"></a>
-<span class="sourceLineNo">188</span>         } else {<a name="line.188"></a>
-<span class="sourceLineNo">189</span>            if (relativeUriBase != null) {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>               append(relativeUriBase);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>               if (! relativeUriBase.equals("/"))<a name="line.191"></a>
-<span class="sourceLineNo">192</span>                  append("/");<a name="line.192"></a>
-<span class="sourceLineNo">193</span>            }<a name="line.193"></a>
-<span class="sourceLineNo">194</span>         }<a name="line.194"></a>
-<span class="sourceLineNo">195</span>      }<a name="line.195"></a>
-<span class="sourceLineNo">196</span>      return appendObject(s, false);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>   }<a name="line.197"></a>
-<span class="sourceLineNo">198</span><a name="line.198"></a>
+<span class="sourceLineNo">086</span>      AsciiSet unenc = (isTopAttrName ? unencodedCharsAttrName : unencodedChars);<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      AsciiSet esc = plainTextParams ? noChars : escapedChars;<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>      if (needsQuotes)<a name="line.89"></a>
+<span class="sourceLineNo">090</span>         append('\'');<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      for (int i = 0; i &lt; s.length(); i++) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>         char c = s.charAt(i);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>         if (esc.contains(c))<a name="line.93"></a>
+<span class="sourceLineNo">094</span>            append('~');<a name="line.94"></a>
+<span class="sourceLineNo">095</span>         if ((!encodeChars) || unenc.contains(c))<a name="line.95"></a>
+<span class="sourceLineNo">096</span>            append(c);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>         else {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>            if (c == ' ')<a name="line.98"></a>
+<span class="sourceLineNo">099</span>               append('+');<a name="line.99"></a>
+<span class="sourceLineNo">100</span>            else {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>               int p = s.codePointAt(i);<a name="line.101"></a>
+<span class="sourceLineNo">102</span>               if (p &lt; 0x0080)<a name="line.102"></a>
+<span class="sourceLineNo">103</span>                  appendHex(p);<a name="line.103"></a>
+<span class="sourceLineNo">104</span>               else if (p &lt; 0x0800) {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                  int p1=p&gt;&gt;&gt;6;<a name="line.105"></a>
+<span class="sourceLineNo">106</span>                  appendHex(p1+192).appendHex((p&amp;63)+128);<a name="line.106"></a>
+<span class="sourceLineNo">107</span>               } else if (p &lt; 0x10000) {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>                  int p1=p&gt;&gt;&gt;6, p2=p1&gt;&gt;&gt;6;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>                  appendHex(p2+224).appendHex((p1&amp;63)+128).appendHex((p&amp;63)+128);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>               } else {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>                  i++;  // Two-byte codepoint...skip past surrogate pair lower byte.<a name="line.111"></a>
+<span class="sourceLineNo">112</span>                  int p1=p&gt;&gt;&gt;6, p2=p1&gt;&gt;&gt;6, p3=p2&gt;&gt;&gt;6;<a name="line.112"></a>
+<span class="sourceLineNo">113</span>                  appendHex(p3+240).appendHex((p2&amp;63)+128).appendHex((p1&amp;63)+128).appendHex((p&amp;63)+128);<a name="line.113"></a>
+<span class="sourceLineNo">114</span>               }<a name="line.114"></a>
+<span class="sourceLineNo">115</span>            }<a name="line.115"></a>
+<span class="sourceLineNo">116</span>         }<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      }<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      if (needsQuotes)<a name="line.118"></a>
+<span class="sourceLineNo">119</span>         append('\'');<a name="line.119"></a>
+<span class="sourceLineNo">120</span><a name="line.120"></a>
+<span class="sourceLineNo">121</span>      return this;<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   }<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>   /**<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    * Appends a boolean value to the output.<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    *<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    * @param o The boolean value to append to the output.<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    * @return This object (for method chaining).<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    * @throws IOException<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   protected UonWriter appendBoolean(Object o) throws IOException {<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      append(o.toString());<a name="line.132"></a>
+<span class="sourceLineNo">133</span>      return this;<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   }<a name="line.134"></a>
+<span class="sourceLineNo">135</span><a name="line.135"></a>
+<span class="sourceLineNo">136</span>   /**<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    * Appends a numeric value to the output.<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    *<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    * @param o The numeric value to append to the output.<a name="line.139"></a>
+<span class="sourceLineNo">140</span>    * @return This object (for method chaining).<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    * @throws IOException<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    */<a name="line.142"></a>
+<span class="sourceLineNo">143</span>   protected UonWriter appendNumber(Object o) throws IOException {<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      append(o.toString());<a name="line.144"></a>
+<span class="sourceLineNo">145</span>      return this;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>   }<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>   /**<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    * Prints out a two-byte %xx sequence for the given byte value.<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    */<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   private UonWriter appendHex(int b) throws IOException {<a name="line.151"></a>
+<span class="sourceLineNo">152</span>      if (b &gt; 255)<a name="line.152"></a>
+<span class="sourceLineNo">153</span>         throw new IOException("Invalid value passed to appendHex.  Must be in the range 0-255.  Value=" + b);<a name="line.153"></a>
+<span class="sourceLineNo">154</span>      append('%').append(hexArray[b&gt;&gt;&gt;4]).append(hexArray[b&amp;0x0F]);<a name="line.154"></a>
+<span class="sourceLineNo">155</span>      return this;<a name="line.155"></a>
+<span class="sourceLineNo">156</span>   }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>   /**<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    * Appends a URI to the output.<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    *<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    * @param uri The URI to append to the output.<a name="line.161"></a>
+<span class="sourceLineNo">162</span>    * @return This object (for method chaining).<a name="line.162"></a>
+<span class="sourceLineNo">163</span>    * @throws IOException<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    */<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   @Override<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   public SerializerWriter appendUri(Object uri) throws IOException {<a name="line.166"></a>
+<span class="sourceLineNo">167</span>      String s = uri.toString();<a name="line.167"></a>
+<span class="sourceLineNo">168</span>      if (s.indexOf("://") == -1) {<a name="line.168"></a>
+<span class="sourceLineNo">169</span>         if (StringUtils.startsWith(s, '/')) {<a name="line.169"></a>
+<span class="sourceLineNo">170</span>            if (absolutePathUriBase != null)<a name="line.170"></a>
+<span class="sourceLineNo">171</span>               append(absolutePathUriBase);<a name="line.171"></a>
+<span class="sourceLineNo">172</span>         } else {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>            if (relativeUriBase != null) {<a name="line.173"></a>
+<span class="sourceLineNo">174</span>               append(relativeUriBase);<a name="line.174"></a>
+<span class="sourceLineNo">175</span>               if (! relativeUriBase.equals("/"))<a name="line.175"></a>
+<span class="sourceLineNo">176</span>                  append("/");<a name="line.176"></a>
+<span class="sourceLineNo">177</span>            }<a name="line.177"></a>
+<span class="sourceLineNo">178</span>         }<a name="line.178"></a>
+<span class="sourceLineNo">179</span>      }<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      return appendObject(s, false, false);<a name="line.180"></a>
+<span class="sourceLineNo">181</span>   }<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span><a name="line.183"></a>
+<span class="sourceLineNo">184</span>   //--------------------------------------------------------------------------------<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   // Overridden methods<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   //--------------------------------------------------------------------------------<a name="line.186"></a>
+<span class="sourceLineNo">187</span><a name="line.187"></a>
+<span class="sourceLineNo">188</span>   @Override /* SerializerWriter */<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   public UonWriter cr(int depth) throws IOException {<a name="line.189"></a>
+<span class="sourceLineNo">190</span>      super.cr(depth);<a name="line.190"></a>
+<span class="sourceLineNo">191</span>      return this;<a name="line.191"></a>
+<span class="sourceLineNo">192</span>   }<a name="line.192"></a>
+<span class="sourceLineNo">193</span><a name="line.193"></a>
+<span class="sourceLineNo">194</span>   @Override /* SerializerWriter */<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   public UonWriter appendln(int indent, String text) throws IOException {<a name="line.195"></a>
+<span class="sourceLineNo">196</span>      super.appendln(indent, text);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>      return this;<a name="line.197"></a>
+<span class="sourceLineNo">198</span>   }<a name="line.198"></a>
 <span class="sourceLineNo">199</span><a name="line.199"></a>
-<span class="sourceLineNo">200</span>   //--------------------------------------------------------------------------------<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   // Overridden methods<a name="line.201"></a>
-<span class="sourceLineNo">202</span>   //--------------------------------------------------------------------------------<a name="line.202"></a>
-<span class="sourceLineNo">203</span><a name="line.203"></a>
-<span class="sourceLineNo">204</span>   @Override /* SerializerWriter */<a name="line.204"></a>
-<span class="sourceLineNo">205</span>   public UonWriter cr(int depth) throws IOException {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>      super.cr(depth);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>      return this;<a name="line.207"></a>
-<span class="sourceLineNo">208</span>   }<a name="line.208"></a>
-<span class="sourceLineNo">209</span><a name="line.209"></a>
-<span class="sourceLineNo">210</span>   @Override /* SerializerWriter */<a name="line.210"></a>
-<span class="sourceLineNo">211</span>   public UonWriter appendln(int indent, String text) throws IOException {<a name="line.211"></a>
-<span class="sourceLineNo">212</span>      super.appendln(indent, text);<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      return this;<a name="line.213"></a>
-<span class="sourceLineNo">214</span>   }<a name="line.214"></a>
-<span class="sourceLineNo">215</span><a name="line.215"></a>
-<span class="sourceLineNo">216</span>   @Override /* SerializerWriter */<a name="line.216"></a>
-<span class="sourceLineNo">217</span>   public UonWriter appendln(String text) throws IOException {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>      super.appendln(text);<a name="line.218"></a>
-<span class="sourceLineNo">219</span>      return this;<a name="line.219"></a>
-<span class="sourceLineNo">220</span>   }<a name="line.220"></a>
-<span class="sourceLineNo">221</span><a name="line.221"></a>
-<span class="sourceLineNo">222</span>   @Override /* SerializerWriter */<a name="line.222"></a>
-<span class="sourceLineNo">223</span>   public UonWriter append(int indent, String text) throws IOException {<a name="line.223"></a>
-<span class="sourceLineNo">224</span>      super.append(indent, text);<a name="line.224"></a>
-<span class="sourceLineNo">225</span>      return this;<a name="line.225"></a>
-<span class="sourceLineNo">226</span>   }<a name="line.226"></a>
-<span class="sourceLineNo">227</span><a name="line.227"></a>
-<span class="sourceLineNo">228</span>   @Override /* SerializerWriter */<a name="line.228"></a>
-<span class="sourceLineNo">229</span>   public UonWriter append(int indent, char c) throws IOException {<a name="line.229"></a>
-<span class="sourceLineNo">230</span>      super.append(indent, c);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>      return this;<a name="line.231"></a>
-<span class="sourceLineNo">232</span>   }<a name="line.232"></a>
-<span class="sourceLineNo">233</span><a name="line.233"></a>
-<span class="sourceLineNo">234</span>   @Override /* SerializerWriter */<a name="line.234"></a>
-<span class="sourceLineNo">235</span>   public UonWriter q() throws IOException {<a name="line.235"></a>
-<span class="sourceLineNo">236</span>      super.q();<a name="line.236"></a>
-<span class="sourceLineNo">237</span>      return this;<a name="line.237"></a>
-<span class="sourceLineNo">238</span>   }<a name="line.238"></a>
-<span class="sourceLineNo">239</span><a name="line.239"></a>
-<span class="sourceLineNo">240</span>   @Override /* SerializerWriter */<a name="line.240"></a>
-<span class="sourceLineNo">241</span>   public UonWriter i(int indent) throws IOException {<a name="line.241"></a>
-<span class="sourceLineNo">242</span>      super.i(indent);<a name="line.242"></a>
-<span class="sourceLineNo">243</span>      return this;<a name="line.243"></a>
-<span class="sourceLineNo">244</span>   }<a name="line.244"></a>
-<span class="sourceLineNo">245</span><a name="line.245"></a>
-<span class="sourceLineNo">246</span>   @Override /* SerializerWriter */<a name="line.246"></a>
-<span class="sourceLineNo">247</span>   public UonWriter nl() throws IOException {<a name="line.247"></a>
-<span class="sourceLineNo">248</span>      super.nl();<a name="line.248"></a>
-<span class="sourceLineNo">249</span>      return this;<a name="line.249"></a>
-<span class="sourceLineNo">250</span>   }<a name="line.250"></a>
-<span class="sourceLineNo">251</span><a name="line.251"></a>
-<span class="sourceLineNo">252</span>   @Override /* SerializerWriter */<a name="line.252"></a>
-<span class="sourceLineNo">253</span>   public UonWriter append(Object text) throws IOException {<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      super.append(text);<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      return this;<a name="line.255"></a>
-<span class="sourceLineNo">256</span>   }<a name="line.256"></a>
-<span class="sourceLineNo">257</span><a name="line.257"></a>
-<span class="sourceLineNo">258</span>   @Override /* SerializerWriter */<a name="line.258"></a>
-<span class="sourceLineNo">259</span>   public UonWriter append(String text) throws IOException {<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      super.append(text);<a name="line.260"></a>
-<span class="sourceLineNo">261</span>      return this;<a name="line.261"></a>
-<span class="sourceLineNo">262</span>   }<a name="line.262"></a>
-<span class="sourceLineNo">263</span><a name="line.263"></a>
-<span class="sourceLineNo">264</span>   @Override /* SerializerWriter */<a name="line.264"></a>
-<span class="sourceLineNo">265</span>   public UonWriter appendIf(boolean b, String text) throws IOException {<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      super.appendIf(b, text);<a name="line.266"></a>
-<span class="sourceLineNo">267</span>      return this;<a name="line.267"></a>
-<span class="sourceLineNo">268</span>   }<a name="line.268"></a>
-<span class="sourceLineNo">269</span><a name="line.269"></a>
-<span class="sourceLineNo">270</span>   @Override /* SerializerWriter */<a name="line.270"></a>
-<span class="sourceLineNo">271</span>   public UonWriter appendIf(boolean b, char c) throws IOException {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>      super.appendIf(b, c);<a name="line.272"></a>
-<span class="sourceLineNo">273</span>      return this;<a name="line.273"></a>
-<span class="sourceLineNo">274</span>   }<a name="line.274"></a>
-<span class="sourceLineNo">275</span><a name="line.275"></a>
-<span class="sourceLineNo">276</span>   @Override /* SerializerWriter */<a name="line.276"></a>
-<span class="sourceLineNo">277</span>   public UonWriter append(char c) throws IOException {<a name="line.277"></a>
-<span class="sourceLineNo">278</span>      super.append(c);<a name="line.278"></a>
-<span class="sourceLineNo">279</span>      return this;<a name="line.279"></a>
-<span class="sourceLineNo">280</span>   }<a name="line.280"></a>
-<span class="sourceLineNo">281</span>}<a name="line.281"></a>
+<span class="sourceLineNo">200</span>   @Override /* SerializerWriter */<a name="line.200"></a>
+<span class="sourceLineNo">201</span>   public UonWriter appendln(String text) throws IOException {<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      super.appendln(text);<a name="line.202"></a>
+<span class="sourceLineNo">203</span>      return this;<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   }<a name="line.204"></a>
+<span class="sourceLineNo">205</span><a name="line.205"></a>
+<span class="sourceLineNo">206</span>   @Override /* SerializerWriter */<a name="line.206"></a>
+<span class="sourceLineNo">207</span>   public UonWriter append(int indent, String text) throws IOException {<a name="line.207"></a>
+<span class="sourceLineNo">208</span>      super.append(indent, text);<a name="line.208"></a>
+<span class="sourceLineNo">209</span>      return this;<a name="line.209"></a>
+<span class="sourceLineNo">210</span>   }<a name="line.210"></a>
+<span class="sourceLineNo">211</span><a name="line.211"></a>
+<span class="sourceLineNo">212</span>   @Override /* SerializerWriter */<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   public UonWriter append(int indent, char c) throws IOException {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      super.append(indent, c);<a name="line.214"></a>
+<span class="sourceLineNo">215</span>      return this;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   }<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>   @Override /* SerializerWriter */<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   public UonWriter q() throws IOException {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>      super.q();<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      return this;<a name="line.221"></a>
+<span class="sourceLineNo">222</span>   }<a name="line.222"></a>
+<span class="sourceLineNo">223</span><a name="line.223"></a>
+<span class="sourceLineNo">224</span>   @Override /* SerializerWriter */<a name="line.224"></a>
+<span class="sourceLineNo">225</span>   public UonWriter i(int indent) throws IOException {<a name="line.225"></a>
+<span class="sourceLineNo">226</span>      super.i(indent);<a name="line.226"></a>
+<span class="sourceLineNo">227</span>      return this;<a name="line.227"></a>
+<span class="sourceLineNo">228</span>   }<a name="line.228"></a>
+<span class="sourceLineNo">229</span><a name="line.229"></a>
+<span class="sourceLineNo">230</span>   @Override /* SerializerWriter */<a name="line.230"></a>
+<span class="sourceLineNo">231</span>   public UonWriter nl() throws IOException {<a name="line.231"></a>
+<span class="sourceLineNo">232</span>      super.nl();<a name="line.232"></a>
+<span class="sourceLineNo">233</span>      return this;<a name="line.233"></a>
+<span class="sourceLineNo">234</span>   }<a name="line.234"></a>
+<span class="sourceLineNo">235</span><a name="line.235"></a>
+<span class="sourceLineNo">236</span>   @Override /* SerializerWriter */<a name="line.236"></a>
+<span class="sourceLineNo">237</span>   public UonWriter append(Object text) throws IOException {<a name="line.237"></a>
+<span class="sourceLineNo">238</span>      super.append(text);<a name="line.238"></a>
+<span class="sourceLineNo">239</span>      return this;<a name="line.239"></a>
+<span class="sourceLineNo">240</span>   }<a name="line.240"></a>
+<span class="sourceLineNo">241</span><a name="line.241"></a>
+<span class="sourceLineNo">242</span>   @Override /* SerializerWriter */<a name="line.242"></a>
+<span class="sourceLineNo">243</span>   public UonWriter append(String text) throws IOException {<a name="line.243"></a>
+<span class="sourceLineNo">244</span>      super.append(text);<a name="line.244"></a>
+<span class="sourceLineNo">245</span>      return this;<a name="line.245"></a>
+<span class="sourceLineNo">246</span>   }<a name="line.246"></a>
+<span class="sourceLineNo">247</span><a name="line.247"></a>
+<span class="sourceLineNo">248</span>   @Override /* SerializerWriter */<a name="line.248"></a>
+<span class="sourceLineNo">249</span>   public UonWriter appendIf(boolean b, String text) throws IOException {<a name="line.249"></a>
+<span class="sourceLineNo">250</span>      super.appendIf(b, text);<a name="line.250"></a>
+<span class="sourceLineNo">251</span>      return this;<a name="line.251"></a>
+<span class="sourceLineNo">252</span>   }<a name="line.252"></a>
+<span class="sourceLineNo">253</span><a name="line.253"></a>
+<span class="sourceLineNo">254</span>   @Override /* SerializerWriter */<a name="line.254"></a>
+<span class="sourceLineNo">255</span>   public UonWriter appendIf(boolean b, char c) throws IOException {<a name="line.255"></a>
+<span class="sourceLineNo">256</span>      super.appendIf(b, c);<a name="line.256"></a>
+<span class="sourceLineNo">257</span>      return this;<a name="line.257"></a>
+<span class="sourceLineNo">258</span>   }<a name="line.258"></a>
+<span class="sourceLineNo">259</span><a name="line.259"></a>
+<span class="sourceLineNo">260</span>   @Override /* SerializerWriter */<a name="line.260"></a>
+<span class="sourceLineNo">261</span>   public UonWriter append(char c) throws IOException {<a name="line.261"></a>
+<span class="sourceLineNo">262</span>      super.append(c);<a name="line.262"></a>
+<span class="sourceLineNo">263</span>      return this;<a name="line.263"></a>
+<span class="sourceLineNo">264</span>   }<a name="line.264"></a>
+<span class="sourceLineNo">265</span>}<a name="line.265"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/80ff9b74/content/site/apidocs/src-html/org/apache/juneau/urlencoding/UrlEncodingParser.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/urlencoding/UrlEncodingParser.html b/content/site/apidocs/src-html/org/apache/juneau/urlencoding/UrlEncodingParser.html
index 22f38a1..fe0ae83 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/urlencoding/UrlEncodingParser.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/urlencoding/UrlEncodingParser.html
@@ -423,7 +423,7 @@
 <span class="sourceLineNo">415</span>   }<a name="line.415"></a>
 <span class="sourceLineNo">416</span><a name="line.416"></a>
 <span class="sourceLineNo">417</span>   /**<a name="line.417"></a>
-<span class="sourceLineNo">418</span>    * Parses a single query parameter value into the specified class type.<a name="line.418"></a>
+<span class="sourceLineNo">418</span>    * Parses a single query parameter or header value into the specified class type.<a name="line.418"></a>
 <span class="sourceLineNo">419</span>    *<a name="line.419"></a>
 <span class="sourceLineNo">420</span>    * @param in The input query string value.<a name="line.420"></a>
 <span class="sourceLineNo">421</span>    * @param type The object type to create.<a name="line.421"></a>
@@ -434,99 +434,89 @@
 <span class="sourceLineNo">426</span>    * @return A new instance of the specified type.<a name="line.426"></a>
 <span class="sourceLineNo">427</span>    * @throws ParseException<a name="line.427"></a>
 <span class="sourceLineNo">428</span>    */<a name="line.428"></a>
-<span class="sourceLineNo">429</span>   public &lt;T&gt; T parseParameter(CharSequence in, Type type, Type...args) throws ParseException {<a name="line.429"></a>
+<span class="sourceLineNo">429</span>   public &lt;T&gt; T parsePart(String in, Type type, Type...args) throws ParseException {<a name="line.429"></a>
 <span class="sourceLineNo">430</span>      if (in == null)<a name="line.430"></a>
 <span class="sourceLineNo">431</span>         return null;<a name="line.431"></a>
-<span class="sourceLineNo">432</span>      UonParserSession session = createParameterSession(in);<a name="line.432"></a>
-<span class="sourceLineNo">433</span>      try {<a name="line.433"></a>
-<span class="sourceLineNo">434</span>         UonReader r = session.getReader();<a name="line.434"></a>
-<span class="sourceLineNo">435</span>         return (T)super.parseAnything(session, session.getClassMeta(type, args), r, null, true, null);<a name="line.435"></a>
-<span class="sourceLineNo">436</span>      } catch (ParseException e) {<a name="line.436"></a>
-<span class="sourceLineNo">437</span>         throw e;<a name="line.437"></a>
-<span class="sourceLineNo">438</span>      } catch (Exception e) {<a name="line.438"></a>
-<span class="sourceLineNo">439</span>         throw new ParseException(session, e);<a name="line.439"></a>
-<span class="sourceLineNo">440</span>      } finally {<a name="line.440"></a>
-<span class="sourceLineNo">441</span>         session.close();<a name="line.441"></a>
-<span class="sourceLineNo">442</span>      }<a name="line.442"></a>
-<span class="sourceLineNo">443</span>   }<a name="line.443"></a>
-<span class="sourceLineNo">444</span><a name="line.444"></a>
-<span class="sourceLineNo">445</span>   /**<a name="line.445"></a>
-<span class="sourceLineNo">446</span>    * Parses a single query parameter value into the specified class type.<a name="line.446"></a>
-<span class="sourceLineNo">447</span>    *<a name="line.447"></a>
-<span class="sourceLineNo">448</span>    * @param in The input query string value.<a name="line.448"></a>
-<span class="sourceLineNo">449</span>    * @param type The class type of the object to create.<a name="line.449"></a>
-<span class="sourceLineNo">450</span>    * @return A new instance of the specified type.<a name="line.450"></a>
-<span class="sourceLineNo">451</span>    * @throws ParseException<a name="line.451"></a>
-<span class="sourceLineNo">452</span>    */<a name="line.452"></a>
-<span class="sourceLineNo">453</span>   public &lt;T&gt; T parseParameter(CharSequence in, Class&lt;T&gt; type) throws ParseException {<a name="line.453"></a>
-<span class="sourceLineNo">454</span>      if (in == null)<a name="line.454"></a>
-<span class="sourceLineNo">455</span>         return null;<a name="line.455"></a>
-<span class="sourceLineNo">456</span>      UonParserSession session = createParameterSession(in);<a name="line.456"></a>
-<span class="sourceLineNo">457</span>      try {<a name="line.457"></a>
-<span class="sourceLineNo">458</span>         UonReader r = session.getReader();<a name="line.458"></a>
-<span class="sourceLineNo">459</span>         return super.parseAnything(session, session.getClassMeta(type), r, null, true, null);<a name="line.459"></a>
-<span class="sourceLineNo">460</span>      } catch (ParseException e) {<a name="line.460"></a>
-<span class="sourceLineNo">461</span>         throw e;<a name="line.461"></a>
-<span class="sourceLineNo">462</span>      } catch (Exception e) {<a name="line.462"></a>
-<span class="sourceLineNo">463</span>         throw new ParseException(session, e);<a name="line.463"></a>
-<span class="sourceLineNo">464</span>      } finally {<a name="line.464"></a>
-<span class="sourceLineNo">465</span>         session.close();<a name="line.465"></a>
-<span class="sourceLineNo">466</span>      }<a name="line.466"></a>
-<span class="sourceLineNo">467</span>   }<a name="line.467"></a>
-<span class="sourceLineNo">468</span><a name="line.468"></a>
-<span class="sourceLineNo">469</span>   /**<a name="line.469"></a>
-<span class="sourceLineNo">470</span>    * Same as {@link #parseParameter(CharSequence, Type, Type...)} except the type has already<a name="line.470"></a>
-<span class="sourceLineNo">471</span>    * been converted to a {@link ClassMeta} object.<a name="line.471"></a>
-<span class="sourceLineNo">472</span>    *<a name="line.472"></a>
-<span class="sourceLineNo">473</span>    * @param in The input query string value.<a name="line.473"></a>
-<span class="sourceLineNo">474</span>    * @param type The class type of the object to create.<a name="line.474"></a>
-<span class="sourceLineNo">475</span>    * @return A new instance of the specified type.<a name="line.475"></a>
-<span class="sourceLineNo">476</span>    * @throws ParseException<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    */<a name="line.477"></a>
-<span class="sourceLineNo">478</span>   public &lt;T&gt; T parseParameter(CharSequence in, ClassMeta&lt;T&gt; type) throws ParseException {<a name="line.478"></a>
-<span class="sourceLineNo">479</span>      if (in == null)<a name="line.479"></a>
-<span class="sourceLineNo">480</span>         return null;<a name="line.480"></a>
-<span class="sourceLineNo">481</span>      UonParserSession session = createParameterSession(in);<a name="line.481"></a>
-<span class="sourceLineNo">482</span>      try {<a name="line.482"></a>
-<span class="sourceLineNo">483</span>         UonReader r = session.getReader();<a name="line.483"></a>
-<span class="sourceLineNo">484</span>         return super.parseAnything(session, type, r, null, true, null);<a name="line.484"></a>
-<span class="sourceLineNo">485</span>      } catch (ParseException e) {<a name="line.485"></a>
-<span class="sourceLineNo">486</span>         throw e;<a name="line.486"></a>
-<span class="sourceLineNo">487</span>      } catch (Exception e) {<a name="line.487"></a>
-<span class="sourceLineNo">488</span>         throw new ParseException(session, e);<a name="line.488"></a>
-<span class="sourceLineNo">489</span>      } finally {<a name="line.489"></a>
-<span class="sourceLineNo">490</span>         session.close();<a name="line.490"></a>
-<span class="sourceLineNo">491</span>      }<a name="line.491"></a>
+<span class="sourceLineNo">432</span>      return (T)parsePart(in, getBeanContext().getClassMeta(type, args));<a name="line.432"></a>
+<span class="sourceLineNo">433</span>   }<a name="line.433"></a>
+<span class="sourceLineNo">434</span><a name="line.434"></a>
+<span class="sourceLineNo">435</span>   /**<a name="line.435"></a>
+<span class="sourceLineNo">436</span>    * Parses a single query parameter or header value into the specified class type.<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    *<a name="line.437"></a>
+<span class="sourceLineNo">438</span>    * @param in The input query string value.<a name="line.438"></a>
+<span class="sourceLineNo">439</span>    * @param type The class type of the object to create.<a name="line.439"></a>
+<span class="sourceLineNo">440</span>    * @return A new instance of the specified type.<a name="line.440"></a>
+<span class="sourceLineNo">441</span>    * @throws ParseException<a name="line.441"></a>
+<span class="sourceLineNo">442</span>    */<a name="line.442"></a>
+<span class="sourceLineNo">443</span>   public &lt;T&gt; T parsePart(String in, Class&lt;T&gt; type) throws ParseException {<a name="line.443"></a>
+<span class="sourceLineNo">444</span>      if (in == null)<a name="line.444"></a>
+<span class="sourceLineNo">445</span>         return null;<a name="line.445"></a>
+<span class="sourceLineNo">446</span>      return parsePart(in, getBeanContext().getClassMeta(type));<a name="line.446"></a>
+<span class="sourceLineNo">447</span>   }<a name="line.447"></a>
+<span class="sourceLineNo">448</span><a name="line.448"></a>
+<span class="sourceLineNo">449</span>   /**<a name="line.449"></a>
+<span class="sourceLineNo">450</span>    * Same as {@link #parsePart(String, Type, Type...)} except the type has already<a name="line.450"></a>
+<span class="sourceLineNo">451</span>    * been converted to a {@link ClassMeta} object.<a name="line.451"></a>
+<span class="sourceLineNo">452</span>    *<a name="line.452"></a>
+<span class="sourceLineNo">453</span>    * @param in The input query string value.<a name="line.453"></a>
+<span class="sourceLineNo">454</span>    * @param type The class type of the object to create.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>    * @return A new instance of the specified type.<a name="line.455"></a>
+<span class="sourceLineNo">456</span>    * @throws ParseException<a name="line.456"></a>
+<span class="sourceLineNo">457</span>    */<a name="line.457"></a>
+<span class="sourceLineNo">458</span>   public &lt;T&gt; T parsePart(String in, ClassMeta&lt;T&gt; type) throws ParseException {<a name="line.458"></a>
+<span class="sourceLineNo">459</span>      if (in == null)<a name="line.459"></a>
+<span class="sourceLineNo">460</span>         return null;<a name="line.460"></a>
+<span class="sourceLineNo">461</span>      if (type.isString() &amp;&amp; in.length() &gt; 0) {<a name="line.461"></a>
+<span class="sourceLineNo">462</span>         // Shortcut - If we're returning a string and the value doesn't start with "'" or is "null", then<a name="line.462"></a>
+<span class="sourceLineNo">463</span>         // just return the string since it's a plain value.<a name="line.463"></a>
+<span class="sourceLineNo">464</span>         // This allows us to bypass the creation of a UonParserSession object.<a name="line.464"></a>
+<span class="sourceLineNo">465</span>         char x = StringUtils.firstNonWhitespaceChar(in);<a name="line.465"></a>
+<span class="sourceLineNo">466</span>         if (x != '\'' &amp;&amp; x != 'n' &amp;&amp; in.indexOf('~') == -1)<a name="line.466"></a>
+<span class="sourceLineNo">467</span>            return (T)in;<a name="line.467"></a>
+<span class="sourceLineNo">468</span>         if (x == 'n' &amp;&amp; "null".equals(in))<a name="line.468"></a>
+<span class="sourceLineNo">469</span>            return null;<a name="line.469"></a>
+<span class="sourceLineNo">470</span>      }<a name="line.470"></a>
+<span class="sourceLineNo">471</span>      UonParserSession session = createParameterSession(in);<a name="line.471"></a>
+<span class="sourceLineNo">472</span>      try {<a name="line.472"></a>
+<span class="sourceLineNo">473</span>         UonReader r = session.getReader();<a name="line.473"></a>
+<span class="sourceLineNo">474</span>         return super.parseAnything(session, type, r, null, true, null);<a name="line.474"></a>
+<span class="sourceLineNo">475</span>      } catch (ParseException e) {<a name="line.475"></a>
+<span class="sourceLineNo">476</span>         throw e;<a name="line.476"></a>
+<span class="sourceLineNo">477</span>      } catch (Exception e) {<a name="line.477"></a>
+<span class="sourceLineNo">478</span>         throw new ParseException(session, e);<a name="line.478"></a>
+<span class="sourceLineNo">479</span>      } finally {<a name="line.479"></a>
+<span class="sourceLineNo">480</span>         session.close();<a name="line.480"></a>
+<span class="sourceLineNo">481</span>      }<a name="line.481"></a>
+<span class="sourceLineNo">482</span>   }<a name="line.482"></a>
+<span class="sourceLineNo">483</span><a name="line.483"></a>
+<span class="sourceLineNo">484</span><a name="line.484"></a>
+<span class="sourceLineNo">485</span>   //--------------------------------------------------------------------------------<a name="line.485"></a>
+<span class="sourceLineNo">486</span>   // Entry point methods<a name="line.486"></a>
+<span class="sourceLineNo">487</span>   //--------------------------------------------------------------------------------<a name="line.487"></a>
+<span class="sourceLineNo">488</span><a name="line.488"></a>
+<span class="sourceLineNo">489</span>   @Override /* Parser */<a name="line.489"></a>
+<span class="sourceLineNo">490</span>   public UrlEncodingParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone, MediaType mediaType) {<a name="line.490"></a>
+<span class="sourceLineNo">491</span>      return new UrlEncodingParserSession(ctx, op, input, javaMethod, outer, locale, timeZone, mediaType);<a name="line.491"></a>
 <span class="sourceLineNo">492</span>   }<a name="line.492"></a>
 <span class="sourceLineNo">493</span><a name="line.493"></a>
-<span class="sourceLineNo">494</span><a name="line.494"></a>
-<span class="sourceLineNo">495</span>   //--------------------------------------------------------------------------------<a name="line.495"></a>
-<span class="sourceLineNo">496</span>   // Entry point methods<a name="line.496"></a>
-<span class="sourceLineNo">497</span>   //--------------------------------------------------------------------------------<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>   @Override /* Parser */<a name="line.499"></a>
-<span class="sourceLineNo">500</span>   public UrlEncodingParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone, MediaType mediaType) {<a name="line.500"></a>
-<span class="sourceLineNo">501</span>      return new UrlEncodingParserSession(ctx, op, input, javaMethod, outer, locale, timeZone, mediaType);<a name="line.501"></a>
-<span class="sourceLineNo">502</span>   }<a name="line.502"></a>
-<span class="sourceLineNo">503</span><a name="line.503"></a>
-<span class="sourceLineNo">504</span>   @Override /* Parser */<a name="line.504"></a>
-<span class="sourceLineNo">505</span>   protected &lt;T&gt; T doParse(ParserSession session, ClassMeta&lt;T&gt; type) throws Exception {<a name="line.505"></a>
-<span class="sourceLineNo">506</span>      UrlEncodingParserSession s = (UrlEncodingParserSession)session;<a name="line.506"></a>
-<span class="sourceLineNo">507</span>      UonReader r = s.getReader();<a name="line.507"></a>
-<span class="sourceLineNo">508</span>      T o = parseAnything(s, type, r, s.getOuter());<a name="line.508"></a>
-<span class="sourceLineNo">509</span>      return o;<a name="line.509"></a>
+<span class="sourceLineNo">494</span>   @Override /* Parser */<a name="line.494"></a>
+<span class="sourceLineNo">495</span>   protected &lt;T&gt; T doParse(ParserSession session, ClassMeta&lt;T&gt; type) throws Exception {<a name="line.495"></a>
+<span class="sourceLineNo">496</span>      UrlEncodingParserSession s = (UrlEncodingParserSession)session;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>      UonReader r = s.getReader();<a name="line.497"></a>
+<span class="sourceLineNo">498</span>      T o = parseAnything(s, type, r, s.getOuter());<a name="line.498"></a>
+<span class="sourceLineNo">499</span>      return o;<a name="line.499"></a>
+<span class="sourceLineNo">500</span>   }<a name="line.500"></a>
+<span class="sourceLineNo">501</span><a name="line.501"></a>
+<span class="sourceLineNo">502</span>   @Override /* ReaderParser */<a name="line.502"></a>
+<span class="sourceLineNo">503</span>   protected &lt;K,V&gt; Map&lt;K,V&gt; doParseIntoMap(ParserSession session, Map&lt;K,V&gt; m, Type keyType, Type valueType) throws Exception {<a name="line.503"></a>
+<span class="sourceLineNo">504</span>      UrlEncodingParserSession s = (UrlEncodingParserSession)session;<a name="line.504"></a>
+<span class="sourceLineNo">505</span>      UonReader r = s.getReader();<a name="line.505"></a>
+<span class="sourceLineNo">506</span>      if (r.peekSkipWs() == '?')<a name="line.506"></a>
+<span class="sourceLineNo">507</span>         r.read();<a name="line.507"></a>
+<span class="sourceLineNo">508</span>      m = parseIntoMap(s, r, m, session.getClassMeta(Map.class, keyType, valueType), null);<a name="line.508"></a>
+<span class="sourceLineNo">509</span>      return m;<a name="line.509"></a>
 <span class="sourceLineNo">510</span>   }<a name="line.510"></a>
-<span class="sourceLineNo">511</span><a name="line.511"></a>
-<span class="sourceLineNo">512</span>   @Override /* ReaderParser */<a name="line.512"></a>
-<span class="sourceLineNo">513</span>   protected &lt;K,V&gt; Map&lt;K,V&gt; doParseIntoMap(ParserSession session, Map&lt;K,V&gt; m, Type keyType, Type valueType) throws Exception {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>      UrlEncodingParserSession s = (UrlEncodingParserSession)session;<a name="line.514"></a>
-<span class="sourceLineNo">515</span>      UonReader r = s.getReader();<a name="line.515"></a>
-<span class="sourceLineNo">516</span>      if (r.peekSkipWs() == '?')<a name="line.516"></a>
-<span class="sourceLineNo">517</span>         r.read();<a name="line.517"></a>
-<span class="sourceLineNo">518</span>      m = parseIntoMap(s, r, m, session.getClassMeta(Map.class, keyType, valueType), null);<a name="line.518"></a>
-<span class="sourceLineNo">519</span>      return m;<a name="line.519"></a>
-<span class="sourceLineNo">520</span>   }<a name="line.520"></a>
-<span class="sourceLineNo">521</span>}<a name="line.521"></a>
+<span class="sourceLineNo">511</span>}<a name="line.511"></a>
 
 
 


Mime
View raw message