juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [22/51] [partial] incubator-juneau-website git commit: Javadoc updates.
Date Sat, 01 Apr 2017 23:58:10 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/5aed2f48/content/site/apidocs/src-html/org/apache/juneau/html/HtmlSerializer.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/html/HtmlSerializer.html b/content/site/apidocs/src-html/org/apache/juneau/html/HtmlSerializer.html
index 3aa18df..63dfc3a 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/html/HtmlSerializer.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/html/HtmlSerializer.html
@@ -398,7 +398,7 @@
 <span class="sourceLineNo">390</span>            out.i(i+2);<a name="line.390"></a>
 <span class="sourceLineNo">391</span>         out.eTag("td").nl();<a name="line.391"></a>
 <span class="sourceLineNo">392</span>         out.sTag(i+2, "td");<a name="line.392"></a>
-<span class="sourceLineNo">393</span>         cr = serializeAnything(session, out, value, valueType, (key == null ? "_x0000_" : key.toString()), 2, null, false);<a name="line.393"></a>
+<span class="sourceLineNo">393</span>         cr = serializeAnything(session, out, value, valueType, (key == null ? "_x0000_" : session.toString(key)), 2, null, false);<a name="line.393"></a>
 <span class="sourceLineNo">394</span>         if (cr == CR_NORMAL)<a name="line.394"></a>
 <span class="sourceLineNo">395</span>            out.i(i+2);<a name="line.395"></a>
 <span class="sourceLineNo">396</span>         out.eTag("td").nl();<a name="line.396"></a>
@@ -493,211 +493,217 @@
 <span class="sourceLineNo">485</span><a name="line.485"></a>
 <span class="sourceLineNo">486</span>         out.oTag(i, "table").attr(btpn, type2).append('&gt;').nl();<a name="line.486"></a>
 <span class="sourceLineNo">487</span>         out.sTag(i+1, "tr").nl();<a name="line.487"></a>
-<span class="sourceLineNo">488</span>         for (Object key : th)<a name="line.488"></a>
-<span class="sourceLineNo">489</span>            out.sTag(i+2, "th").append(key).eTag("th").nl();<a name="line.489"></a>
-<span class="sourceLineNo">490</span>         out.eTag(i+1, "tr").nl();<a name="line.490"></a>
-<span class="sourceLineNo">491</span><a name="line.491"></a>
-<span class="sourceLineNo">492</span>         for (Object o : c) {<a name="line.492"></a>
-<span class="sourceLineNo">493</span>            ClassMeta&lt;?&gt; cm = session.getClassMetaForObject(o);<a name="line.493"></a>
+<span class="sourceLineNo">488</span>         for (Object key : th) {<a name="line.488"></a>
+<span class="sourceLineNo">489</span>            out.sTag(i+2, "th");<a name="line.489"></a>
+<span class="sourceLineNo">490</span>            out.text(session.convertToType(key, String.class));<a name="line.490"></a>
+<span class="sourceLineNo">491</span>            out.eTag("th").nl();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>         }<a name="line.492"></a>
+<span class="sourceLineNo">493</span>         out.eTag(i+1, "tr").nl();<a name="line.493"></a>
 <span class="sourceLineNo">494</span><a name="line.494"></a>
-<span class="sourceLineNo">495</span>            if (cm != null &amp;&amp; cm.getPojoSwap() != null) {<a name="line.495"></a>
-<span class="sourceLineNo">496</span>               PojoSwap f = cm.getPojoSwap();<a name="line.496"></a>
-<span class="sourceLineNo">497</span>               o = f.swap(session, o);<a name="line.497"></a>
-<span class="sourceLineNo">498</span>               cm = cm.getSerializedClassMeta();<a name="line.498"></a>
-<span class="sourceLineNo">499</span>            }<a name="line.499"></a>
-<span class="sourceLineNo">500</span><a name="line.500"></a>
-<span class="sourceLineNo">501</span>            out.oTag(i+1, "tr");<a name="line.501"></a>
-<span class="sourceLineNo">502</span>            String typeName = (cm == null ? null : cm.getDictionaryName());<a name="line.502"></a>
-<span class="sourceLineNo">503</span>            if (typeName != null &amp;&amp; sType.getElementType() != cm)<a name="line.503"></a>
-<span class="sourceLineNo">504</span>               out.attr(btpn, typeName);<a name="line.504"></a>
-<span class="sourceLineNo">505</span>            out.cTag().nl();<a name="line.505"></a>
-<span class="sourceLineNo">506</span><a name="line.506"></a>
-<span class="sourceLineNo">507</span>            if (cm == null) {<a name="line.507"></a>
-<span class="sourceLineNo">508</span>               serializeAnything(session, out, o, null, null, 1, null, false);<a name="line.508"></a>
+<span class="sourceLineNo">495</span>         for (Object o : c) {<a name="line.495"></a>
+<span class="sourceLineNo">496</span>            ClassMeta&lt;?&gt; cm = session.getClassMetaForObject(o);<a name="line.496"></a>
+<span class="sourceLineNo">497</span><a name="line.497"></a>
+<span class="sourceLineNo">498</span>            if (cm != null &amp;&amp; cm.getPojoSwap() != null) {<a name="line.498"></a>
+<span class="sourceLineNo">499</span>               PojoSwap f = cm.getPojoSwap();<a name="line.499"></a>
+<span class="sourceLineNo">500</span>               o = f.swap(session, o);<a name="line.500"></a>
+<span class="sourceLineNo">501</span>               cm = cm.getSerializedClassMeta();<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>            out.oTag(i+1, "tr");<a name="line.504"></a>
+<span class="sourceLineNo">505</span>            String typeName = (cm == null ? null : cm.getDictionaryName());<a name="line.505"></a>
+<span class="sourceLineNo">506</span>            if (typeName != null &amp;&amp; sType.getElementType() != cm)<a name="line.506"></a>
+<span class="sourceLineNo">507</span>               out.attr(btpn, typeName);<a name="line.507"></a>
+<span class="sourceLineNo">508</span>            out.cTag().nl();<a name="line.508"></a>
 <span class="sourceLineNo">509</span><a name="line.509"></a>
-<span class="sourceLineNo">510</span>            } else if (cm.isMap() &amp;&amp; ! (cm.isBeanMap())) {<a name="line.510"></a>
-<span class="sourceLineNo">511</span>               Map m2 = session.sort((Map)o);<a name="line.511"></a>
+<span class="sourceLineNo">510</span>            if (cm == null) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>               serializeAnything(session, out, o, null, null, 1, null, false);<a name="line.511"></a>
 <span class="sourceLineNo">512</span><a name="line.512"></a>
-<span class="sourceLineNo">513</span>               for (Object k : th) {<a name="line.513"></a>
-<span class="sourceLineNo">514</span>                  out.sTag(i+2, "td");<a name="line.514"></a>
-<span class="sourceLineNo">515</span>                  ContentResult cr = serializeAnything(session, out, m2.get(k), seType, session.toString(k), 2, null, false);<a name="line.515"></a>
-<span class="sourceLineNo">516</span>                  if (cr == CR_NORMAL)<a name="line.516"></a>
-<span class="sourceLineNo">517</span>                     out.i(i+2);<a name="line.517"></a>
-<span class="sourceLineNo">518</span>                  out.eTag("td").nl();<a name="line.518"></a>
-<span class="sourceLineNo">519</span>               }<a name="line.519"></a>
-<span class="sourceLineNo">520</span>            } else {<a name="line.520"></a>
-<span class="sourceLineNo">521</span>               BeanMap m2 = null;<a name="line.521"></a>
-<span class="sourceLineNo">522</span>               if (o instanceof BeanMap)<a name="line.522"></a>
-<span class="sourceLineNo">523</span>                  m2 = (BeanMap)o;<a name="line.523"></a>
-<span class="sourceLineNo">524</span>               else<a name="line.524"></a>
-<span class="sourceLineNo">525</span>                  m2 = session.toBeanMap(o);<a name="line.525"></a>
-<span class="sourceLineNo">526</span><a name="line.526"></a>
-<span class="sourceLineNo">527</span>               for (Object k : th) {<a name="line.527"></a>
-<span class="sourceLineNo">528</span>                  BeanMapEntry p = m2.getProperty(session.toString(k));<a name="line.528"></a>
-<span class="sourceLineNo">529</span>                  BeanPropertyMeta pMeta = p.getMeta();<a name="line.529"></a>
-<span class="sourceLineNo">530</span>                  out.sTag(i+2, "td");<a name="line.530"></a>
-<span class="sourceLineNo">531</span>                  ContentResult cr = serializeAnything(session, out, p.getValue(), pMeta.getClassMeta(), p.getKey().toString(), 2, pMeta, false);<a name="line.531"></a>
-<span class="sourceLineNo">532</span>                  if (cr == CR_NORMAL)<a name="line.532"></a>
-<span class="sourceLineNo">533</span>                     out.i(i+2);<a name="line.533"></a>
-<span class="sourceLineNo">534</span>                  out.eTag("td").nl();<a name="line.534"></a>
-<span class="sourceLineNo">535</span>               }<a name="line.535"></a>
-<span class="sourceLineNo">536</span>            }<a name="line.536"></a>
-<span class="sourceLineNo">537</span>            out.eTag(i+1, "tr").nl();<a name="line.537"></a>
-<span class="sourceLineNo">538</span>         }<a name="line.538"></a>
-<span class="sourceLineNo">539</span>         out.eTag(i, "table").nl();<a name="line.539"></a>
-<span class="sourceLineNo">540</span><a name="line.540"></a>
-<span class="sourceLineNo">541</span>      } else {<a name="line.541"></a>
-<span class="sourceLineNo">542</span>         out.oTag(i, "ul");<a name="line.542"></a>
-<span class="sourceLineNo">543</span>         if (! type2.equals("array"))<a name="line.543"></a>
-<span class="sourceLineNo">544</span>            out.attr(btpn, type2);<a name="line.544"></a>
-<span class="sourceLineNo">545</span>         out.append('&gt;').nl();<a name="line.545"></a>
-<span class="sourceLineNo">546</span>         for (Object o : c) {<a name="line.546"></a>
-<span class="sourceLineNo">547</span>            out.sTag(i+1, "li");<a name="line.547"></a>
-<span class="sourceLineNo">548</span>            ContentResult cr = serializeAnything(session, out, o, seType, name, 1, null, false);<a name="line.548"></a>
-<span class="sourceLineNo">549</span>            if (cr == CR_NORMAL)<a name="line.549"></a>
-<span class="sourceLineNo">550</span>               out.i(i+1);<a name="line.550"></a>
-<span class="sourceLineNo">551</span>            out.eTag("li").nl();<a name="line.551"></a>
-<span class="sourceLineNo">552</span>         }<a name="line.552"></a>
-<span class="sourceLineNo">553</span>         out.eTag(i, "ul").nl();<a name="line.553"></a>
-<span class="sourceLineNo">554</span>      }<a name="line.554"></a>
-<span class="sourceLineNo">555</span>   }<a name="line.555"></a>
-<span class="sourceLineNo">556</span><a name="line.556"></a>
-<span class="sourceLineNo">557</span>   /*<a name="line.557"></a>
-<span class="sourceLineNo">558</span>    * Returns the table column headers for the specified collection of objects.<a name="line.558"></a>
-<span class="sourceLineNo">559</span>    * Returns null if collection should not be serialized as a 2-dimensional table.<a name="line.559"></a>
-<span class="sourceLineNo">560</span>    * 2-dimensional tables are used for collections of objects that all have the same set of property names.<a name="line.560"></a>
-<span class="sourceLineNo">561</span>    */<a name="line.561"></a>
-<span class="sourceLineNo">562</span>   @SuppressWarnings({ "rawtypes", "unchecked" })<a name="line.562"></a>
-<span class="sourceLineNo">563</span>   private static Object[] getTableHeaders(SerializerSession session, Collection c, HtmlBeanPropertyMeta hbpMeta) throws Exception {<a name="line.563"></a>
-<span class="sourceLineNo">564</span>      if (c.size() == 0)<a name="line.564"></a>
-<span class="sourceLineNo">565</span>         return null;<a name="line.565"></a>
-<span class="sourceLineNo">566</span>      c = session.sort(c);<a name="line.566"></a>
-<span class="sourceLineNo">567</span>      Object[] th;<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      Set&lt;Object&gt; s = new TreeSet&lt;Object&gt;();<a name="line.568"></a>
-<span class="sourceLineNo">569</span>      Set&lt;ClassMeta&gt; prevC = new HashSet&lt;ClassMeta&gt;();<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      Object o1 = null;<a name="line.570"></a>
-<span class="sourceLineNo">571</span>      for (Object o : c)<a name="line.571"></a>
-<span class="sourceLineNo">572</span>         if (o != null) {<a name="line.572"></a>
-<span class="sourceLineNo">573</span>            o1 = o;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>            break;<a name="line.574"></a>
-<span class="sourceLineNo">575</span>         }<a name="line.575"></a>
-<span class="sourceLineNo">576</span>      if (o1 == null)<a name="line.576"></a>
-<span class="sourceLineNo">577</span>         return null;<a name="line.577"></a>
-<span class="sourceLineNo">578</span>      ClassMeta&lt;?&gt; cm = session.getClassMetaForObject(o1);<a name="line.578"></a>
-<span class="sourceLineNo">579</span>      if (cm.getPojoSwap() != null) {<a name="line.579"></a>
-<span class="sourceLineNo">580</span>         PojoSwap f = cm.getPojoSwap();<a name="line.580"></a>
-<span class="sourceLineNo">581</span>         o1 = f.swap(session, o1);<a name="line.581"></a>
-<span class="sourceLineNo">582</span>         cm = cm.getSerializedClassMeta();<a name="line.582"></a>
-<span class="sourceLineNo">583</span>      }<a name="line.583"></a>
-<span class="sourceLineNo">584</span>      if (cm == null || ! cm.isMapOrBean())<a name="line.584"></a>
-<span class="sourceLineNo">585</span>         return null;<a name="line.585"></a>
-<span class="sourceLineNo">586</span>      if (cm.getInnerClass().isAnnotationPresent(HtmlLink.class))<a name="line.586"></a>
+<span class="sourceLineNo">513</span>            } else if (cm.isMap() &amp;&amp; ! (cm.isBeanMap())) {<a name="line.513"></a>
+<span class="sourceLineNo">514</span>               Map m2 = session.sort((Map)o);<a name="line.514"></a>
+<span class="sourceLineNo">515</span><a name="line.515"></a>
+<span class="sourceLineNo">516</span>               for (Object k : th) {<a name="line.516"></a>
+<span class="sourceLineNo">517</span>                  out.sTag(i+2, "td");<a name="line.517"></a>
+<span class="sourceLineNo">518</span>                  ContentResult cr = serializeAnything(session, out, m2.get(k), seType, session.toString(k), 2, null, false);<a name="line.518"></a>
+<span class="sourceLineNo">519</span>                  if (cr == CR_NORMAL)<a name="line.519"></a>
+<span class="sourceLineNo">520</span>                     out.i(i+2);<a name="line.520"></a>
+<span class="sourceLineNo">521</span>                  out.eTag("td").nl();<a name="line.521"></a>
+<span class="sourceLineNo">522</span>               }<a name="line.522"></a>
+<span class="sourceLineNo">523</span>            } else {<a name="line.523"></a>
+<span class="sourceLineNo">524</span>               BeanMap m2 = null;<a name="line.524"></a>
+<span class="sourceLineNo">525</span>               if (o instanceof BeanMap)<a name="line.525"></a>
+<span class="sourceLineNo">526</span>                  m2 = (BeanMap)o;<a name="line.526"></a>
+<span class="sourceLineNo">527</span>               else<a name="line.527"></a>
+<span class="sourceLineNo">528</span>                  m2 = session.toBeanMap(o);<a name="line.528"></a>
+<span class="sourceLineNo">529</span><a name="line.529"></a>
+<span class="sourceLineNo">530</span>               for (Object k : th) {<a name="line.530"></a>
+<span class="sourceLineNo">531</span>                  BeanMapEntry p = m2.getProperty(session.toString(k));<a name="line.531"></a>
+<span class="sourceLineNo">532</span>                  BeanPropertyMeta pMeta = p.getMeta();<a name="line.532"></a>
+<span class="sourceLineNo">533</span>                  out.sTag(i+2, "td");<a name="line.533"></a>
+<span class="sourceLineNo">534</span>                  ContentResult cr = serializeAnything(session, out, p.getValue(), pMeta.getClassMeta(), p.getKey().toString(), 2, pMeta, false);<a name="line.534"></a>
+<span class="sourceLineNo">535</span>                  if (cr == CR_NORMAL)<a name="line.535"></a>
+<span class="sourceLineNo">536</span>                     out.i(i+2);<a name="line.536"></a>
+<span class="sourceLineNo">537</span>                  out.eTag("td").nl();<a name="line.537"></a>
+<span class="sourceLineNo">538</span>               }<a name="line.538"></a>
+<span class="sourceLineNo">539</span>            }<a name="line.539"></a>
+<span class="sourceLineNo">540</span>            out.eTag(i+1, "tr").nl();<a name="line.540"></a>
+<span class="sourceLineNo">541</span>         }<a name="line.541"></a>
+<span class="sourceLineNo">542</span>         out.eTag(i, "table").nl();<a name="line.542"></a>
+<span class="sourceLineNo">543</span><a name="line.543"></a>
+<span class="sourceLineNo">544</span>      } else {<a name="line.544"></a>
+<span class="sourceLineNo">545</span>         out.oTag(i, "ul");<a name="line.545"></a>
+<span class="sourceLineNo">546</span>         if (! type2.equals("array"))<a name="line.546"></a>
+<span class="sourceLineNo">547</span>            out.attr(btpn, type2);<a name="line.547"></a>
+<span class="sourceLineNo">548</span>         out.append('&gt;').nl();<a name="line.548"></a>
+<span class="sourceLineNo">549</span>         for (Object o : c) {<a name="line.549"></a>
+<span class="sourceLineNo">550</span>            out.sTag(i+1, "li");<a name="line.550"></a>
+<span class="sourceLineNo">551</span>            ContentResult cr = serializeAnything(session, out, o, seType, name, 1, null, false);<a name="line.551"></a>
+<span class="sourceLineNo">552</span>            if (cr == CR_NORMAL)<a name="line.552"></a>
+<span class="sourceLineNo">553</span>               out.i(i+1);<a name="line.553"></a>
+<span class="sourceLineNo">554</span>            out.eTag("li").nl();<a name="line.554"></a>
+<span class="sourceLineNo">555</span>         }<a name="line.555"></a>
+<span class="sourceLineNo">556</span>         out.eTag(i, "ul").nl();<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      }<a name="line.557"></a>
+<span class="sourceLineNo">558</span>   }<a name="line.558"></a>
+<span class="sourceLineNo">559</span><a name="line.559"></a>
+<span class="sourceLineNo">560</span>   /*<a name="line.560"></a>
+<span class="sourceLineNo">561</span>    * Returns the table column headers for the specified collection of objects.<a name="line.561"></a>
+<span class="sourceLineNo">562</span>    * Returns null if collection should not be serialized as a 2-dimensional table.<a name="line.562"></a>
+<span class="sourceLineNo">563</span>    * 2-dimensional tables are used for collections of objects that all have the same set of property names.<a name="line.563"></a>
+<span class="sourceLineNo">564</span>    */<a name="line.564"></a>
+<span class="sourceLineNo">565</span>   @SuppressWarnings({ "rawtypes", "unchecked" })<a name="line.565"></a>
+<span class="sourceLineNo">566</span>   private static Object[] getTableHeaders(SerializerSession session, Collection c, HtmlBeanPropertyMeta hbpMeta) throws Exception {<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      if (c.size() == 0)<a name="line.567"></a>
+<span class="sourceLineNo">568</span>         return null;<a name="line.568"></a>
+<span class="sourceLineNo">569</span>      c = session.sort(c);<a name="line.569"></a>
+<span class="sourceLineNo">570</span>      Object[] th;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      Set&lt;ClassMeta&gt; prevC = new HashSet&lt;ClassMeta&gt;();<a name="line.571"></a>
+<span class="sourceLineNo">572</span>      Object o1 = null;<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      for (Object o : c)<a name="line.573"></a>
+<span class="sourceLineNo">574</span>         if (o != null) {<a name="line.574"></a>
+<span class="sourceLineNo">575</span>            o1 = o;<a name="line.575"></a>
+<span class="sourceLineNo">576</span>            break;<a name="line.576"></a>
+<span class="sourceLineNo">577</span>         }<a name="line.577"></a>
+<span class="sourceLineNo">578</span>      if (o1 == null)<a name="line.578"></a>
+<span class="sourceLineNo">579</span>         return null;<a name="line.579"></a>
+<span class="sourceLineNo">580</span>      ClassMeta&lt;?&gt; cm = session.getClassMetaForObject(o1);<a name="line.580"></a>
+<span class="sourceLineNo">581</span>      if (cm.getPojoSwap() != null) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>         PojoSwap f = cm.getPojoSwap();<a name="line.582"></a>
+<span class="sourceLineNo">583</span>         o1 = f.swap(session, o1);<a name="line.583"></a>
+<span class="sourceLineNo">584</span>         cm = cm.getSerializedClassMeta();<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      }<a name="line.585"></a>
+<span class="sourceLineNo">586</span>      if (cm == null || ! cm.isMapOrBean())<a name="line.586"></a>
 <span class="sourceLineNo">587</span>         return null;<a name="line.587"></a>
-<span class="sourceLineNo">588</span>      HtmlClassMeta h = cm.getExtendedMeta(HtmlClassMeta.class);<a name="line.588"></a>
-<span class="sourceLineNo">589</span>      if (h.isNoTables() || (hbpMeta != null &amp;&amp; hbpMeta.isNoTables()))<a name="line.589"></a>
-<span class="sourceLineNo">590</span>         return null;<a name="line.590"></a>
-<span class="sourceLineNo">591</span>      if (h.isNoTableHeaders() || (hbpMeta != null &amp;&amp; hbpMeta.isNoTableHeaders()))<a name="line.591"></a>
-<span class="sourceLineNo">592</span>         return new Object[0];<a name="line.592"></a>
-<span class="sourceLineNo">593</span>      if (session.canIgnoreValue(cm, null, o1))<a name="line.593"></a>
-<span class="sourceLineNo">594</span>         return null;<a name="line.594"></a>
-<span class="sourceLineNo">595</span>      if (cm.isMap() &amp;&amp; ! cm.isBeanMap()) {<a name="line.595"></a>
-<span class="sourceLineNo">596</span>         Set&lt;Object&gt; set = new LinkedHashSet&lt;Object&gt;();<a name="line.596"></a>
-<span class="sourceLineNo">597</span>         for (Object o : c) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>            if (! session.canIgnoreValue(cm, null, o)) {<a name="line.598"></a>
-<span class="sourceLineNo">599</span>               if (! cm.isInstance(o))<a name="line.599"></a>
-<span class="sourceLineNo">600</span>                  return null;<a name="line.600"></a>
-<span class="sourceLineNo">601</span>               Map m = session.sort((Map)o);<a name="line.601"></a>
-<span class="sourceLineNo">602</span>               for (Map.Entry e : (Set&lt;Map.Entry&gt;)m.entrySet()) {<a name="line.602"></a>
-<span class="sourceLineNo">603</span>                  if (e.getValue() != null)<a name="line.603"></a>
-<span class="sourceLineNo">604</span>                     set.add(e.getKey() == null ? null : e.getKey());<a name="line.604"></a>
-<span class="sourceLineNo">605</span>               }<a name="line.605"></a>
-<span class="sourceLineNo">606</span>            }<a name="line.606"></a>
-<span class="sourceLineNo">607</span>         }<a name="line.607"></a>
-<span class="sourceLineNo">608</span>         th = set.toArray(new Object[set.size()]);<a name="line.608"></a>
-<span class="sourceLineNo">609</span>      } else {<a name="line.609"></a>
-<span class="sourceLineNo">610</span>         Set&lt;Object&gt; set = new LinkedHashSet&lt;Object&gt;();<a name="line.610"></a>
-<span class="sourceLineNo">611</span>         for (Object o : c) {<a name="line.611"></a>
-<span class="sourceLineNo">612</span>            if (! session.canIgnoreValue(cm, null, o)) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>               if (! cm.isInstance(o))<a name="line.613"></a>
-<span class="sourceLineNo">614</span>                  return null;<a name="line.614"></a>
-<span class="sourceLineNo">615</span>               BeanMap&lt;?&gt; bm = (o instanceof BeanMap ? (BeanMap)o : session.toBeanMap(o));<a name="line.615"></a>
-<span class="sourceLineNo">616</span>               for (Map.Entry&lt;String,Object&gt; e : bm.entrySet()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>                  if (e.getValue() != null)<a name="line.617"></a>
-<span class="sourceLineNo">618</span>                     set.add(e.getKey());<a name="line.618"></a>
-<span class="sourceLineNo">619</span>               }<a name="line.619"></a>
-<span class="sourceLineNo">620</span>            }<a name="line.620"></a>
-<span class="sourceLineNo">621</span>         }<a name="line.621"></a>
-<span class="sourceLineNo">622</span>         th = set.toArray(new Object[set.size()]);<a name="line.622"></a>
-<span class="sourceLineNo">623</span>      }<a name="line.623"></a>
-<span class="sourceLineNo">624</span>      prevC.add(cm);<a name="line.624"></a>
-<span class="sourceLineNo">625</span>      s.addAll(Arrays.asList(th));<a name="line.625"></a>
-<span class="sourceLineNo">626</span><a name="line.626"></a>
-<span class="sourceLineNo">627</span>      for (Object o : c) {<a name="line.627"></a>
-<span class="sourceLineNo">628</span>         if (o == null)<a name="line.628"></a>
-<span class="sourceLineNo">629</span>            continue;<a name="line.629"></a>
-<span class="sourceLineNo">630</span>         cm = session.getClassMetaForObject(o);<a name="line.630"></a>
-<span class="sourceLineNo">631</span>         if (cm != null &amp;&amp; cm.getPojoSwap() != null) {<a name="line.631"></a>
-<span class="sourceLineNo">632</span>            PojoSwap f = cm.getPojoSwap();<a name="line.632"></a>
-<span class="sourceLineNo">633</span>            o = f.swap(session, o);<a name="line.633"></a>
-<span class="sourceLineNo">634</span>            cm = cm.getSerializedClassMeta();<a name="line.634"></a>
-<span class="sourceLineNo">635</span>         }<a name="line.635"></a>
-<span class="sourceLineNo">636</span>         if (prevC.contains(cm))<a name="line.636"></a>
-<span class="sourceLineNo">637</span>            continue;<a name="line.637"></a>
-<span class="sourceLineNo">638</span>         if (cm == null || ! (cm.isMap() || cm.isBean()))<a name="line.638"></a>
-<span class="sourceLineNo">639</span>            return null;<a name="line.639"></a>
-<span class="sourceLineNo">640</span>         if (cm.getInnerClass().isAnnotationPresent(HtmlLink.class))<a name="line.640"></a>
-<span class="sourceLineNo">641</span>            return null;<a name="line.641"></a>
-<span class="sourceLineNo">642</span>         if (session.canIgnoreValue(cm, null, o))<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            return null;<a name="line.643"></a>
-<span class="sourceLineNo">644</span>         if (cm.isMap() &amp;&amp; ! cm.isBeanMap()) {<a name="line.644"></a>
-<span class="sourceLineNo">645</span>            Map m = (Map)o;<a name="line.645"></a>
-<span class="sourceLineNo">646</span>            if (th.length != m.keySet().size())<a name="line.646"></a>
-<span class="sourceLineNo">647</span>               return null;<a name="line.647"></a>
-<span class="sourceLineNo">648</span>            for (Object k : m.keySet())<a name="line.648"></a>
-<span class="sourceLineNo">649</span>               if (! s.contains(k.toString()))<a name="line.649"></a>
-<span class="sourceLineNo">650</span>                  return null;<a name="line.650"></a>
-<span class="sourceLineNo">651</span>         } else {<a name="line.651"></a>
-<span class="sourceLineNo">652</span>            BeanMap&lt;?&gt; bm = (o instanceof BeanMap ? (BeanMap)o : session.toBeanMap(o));<a name="line.652"></a>
-<span class="sourceLineNo">653</span>            int l = 0;<a name="line.653"></a>
-<span class="sourceLineNo">654</span>            for (String k : bm.keySet()) {<a name="line.654"></a>
-<span class="sourceLineNo">655</span>               if (! s.contains(k))<a name="line.655"></a>
+<span class="sourceLineNo">588</span>      if (cm.getInnerClass().isAnnotationPresent(HtmlLink.class))<a name="line.588"></a>
+<span class="sourceLineNo">589</span>         return null;<a name="line.589"></a>
+<span class="sourceLineNo">590</span>      HtmlClassMeta h = cm.getExtendedMeta(HtmlClassMeta.class);<a name="line.590"></a>
+<span class="sourceLineNo">591</span>      if (h.isNoTables() || (hbpMeta != null &amp;&amp; hbpMeta.isNoTables()))<a name="line.591"></a>
+<span class="sourceLineNo">592</span>         return null;<a name="line.592"></a>
+<span class="sourceLineNo">593</span>      if (h.isNoTableHeaders() || (hbpMeta != null &amp;&amp; hbpMeta.isNoTableHeaders()))<a name="line.593"></a>
+<span class="sourceLineNo">594</span>         return new Object[0];<a name="line.594"></a>
+<span class="sourceLineNo">595</span>      if (session.canIgnoreValue(cm, null, o1))<a name="line.595"></a>
+<span class="sourceLineNo">596</span>         return null;<a name="line.596"></a>
+<span class="sourceLineNo">597</span>      if (cm.isMap() &amp;&amp; ! cm.isBeanMap()) {<a name="line.597"></a>
+<span class="sourceLineNo">598</span>         Set&lt;Object&gt; set = new LinkedHashSet&lt;Object&gt;();<a name="line.598"></a>
+<span class="sourceLineNo">599</span>         for (Object o : c) {<a name="line.599"></a>
+<span class="sourceLineNo">600</span>            if (! session.canIgnoreValue(cm, null, o)) {<a name="line.600"></a>
+<span class="sourceLineNo">601</span>               if (! cm.isInstance(o))<a name="line.601"></a>
+<span class="sourceLineNo">602</span>                  return null;<a name="line.602"></a>
+<span class="sourceLineNo">603</span>               Map m = session.sort((Map)o);<a name="line.603"></a>
+<span class="sourceLineNo">604</span>               for (Map.Entry e : (Set&lt;Map.Entry&gt;)m.entrySet()) {<a name="line.604"></a>
+<span class="sourceLineNo">605</span>                  if (e.getValue() != null)<a name="line.605"></a>
+<span class="sourceLineNo">606</span>                     set.add(e.getKey() == null ? null : e.getKey());<a name="line.606"></a>
+<span class="sourceLineNo">607</span>               }<a name="line.607"></a>
+<span class="sourceLineNo">608</span>            }<a name="line.608"></a>
+<span class="sourceLineNo">609</span>         }<a name="line.609"></a>
+<span class="sourceLineNo">610</span>         th = set.toArray(new Object[set.size()]);<a name="line.610"></a>
+<span class="sourceLineNo">611</span>      } else {<a name="line.611"></a>
+<span class="sourceLineNo">612</span>         Set&lt;Object&gt; set = new LinkedHashSet&lt;Object&gt;();<a name="line.612"></a>
+<span class="sourceLineNo">613</span>         for (Object o : c) {<a name="line.613"></a>
+<span class="sourceLineNo">614</span>            if (! session.canIgnoreValue(cm, null, o)) {<a name="line.614"></a>
+<span class="sourceLineNo">615</span>               if (! cm.isInstance(o))<a name="line.615"></a>
+<span class="sourceLineNo">616</span>                  return null;<a name="line.616"></a>
+<span class="sourceLineNo">617</span>               BeanMap&lt;?&gt; bm = (o instanceof BeanMap ? (BeanMap)o : session.toBeanMap(o));<a name="line.617"></a>
+<span class="sourceLineNo">618</span>               for (Map.Entry&lt;String,Object&gt; e : bm.entrySet()) {<a name="line.618"></a>
+<span class="sourceLineNo">619</span>                  if (e.getValue() != null)<a name="line.619"></a>
+<span class="sourceLineNo">620</span>                     set.add(e.getKey());<a name="line.620"></a>
+<span class="sourceLineNo">621</span>               }<a name="line.621"></a>
+<span class="sourceLineNo">622</span>            }<a name="line.622"></a>
+<span class="sourceLineNo">623</span>         }<a name="line.623"></a>
+<span class="sourceLineNo">624</span>         th = set.toArray(new Object[set.size()]);<a name="line.624"></a>
+<span class="sourceLineNo">625</span>      }<a name="line.625"></a>
+<span class="sourceLineNo">626</span>      prevC.add(cm);<a name="line.626"></a>
+<span class="sourceLineNo">627</span>      boolean isSortable = true;<a name="line.627"></a>
+<span class="sourceLineNo">628</span>      for (Object o : th)<a name="line.628"></a>
+<span class="sourceLineNo">629</span>         isSortable &amp;= (o instanceof Comparable);<a name="line.629"></a>
+<span class="sourceLineNo">630</span>      Set&lt;Object&gt; s = (isSortable ? new TreeSet&lt;Object&gt;() : new LinkedHashSet&lt;Object&gt;());<a name="line.630"></a>
+<span class="sourceLineNo">631</span>      s.addAll(Arrays.asList(th));<a name="line.631"></a>
+<span class="sourceLineNo">632</span><a name="line.632"></a>
+<span class="sourceLineNo">633</span>      for (Object o : c) {<a name="line.633"></a>
+<span class="sourceLineNo">634</span>         if (o == null)<a name="line.634"></a>
+<span class="sourceLineNo">635</span>            continue;<a name="line.635"></a>
+<span class="sourceLineNo">636</span>         cm = session.getClassMetaForObject(o);<a name="line.636"></a>
+<span class="sourceLineNo">637</span>         if (cm != null &amp;&amp; cm.getPojoSwap() != null) {<a name="line.637"></a>
+<span class="sourceLineNo">638</span>            PojoSwap f = cm.getPojoSwap();<a name="line.638"></a>
+<span class="sourceLineNo">639</span>            o = f.swap(session, o);<a name="line.639"></a>
+<span class="sourceLineNo">640</span>            cm = cm.getSerializedClassMeta();<a name="line.640"></a>
+<span class="sourceLineNo">641</span>         }<a name="line.641"></a>
+<span class="sourceLineNo">642</span>         if (prevC.contains(cm))<a name="line.642"></a>
+<span class="sourceLineNo">643</span>            continue;<a name="line.643"></a>
+<span class="sourceLineNo">644</span>         if (cm == null || ! (cm.isMap() || cm.isBean()))<a name="line.644"></a>
+<span class="sourceLineNo">645</span>            return null;<a name="line.645"></a>
+<span class="sourceLineNo">646</span>         if (cm.getInnerClass().isAnnotationPresent(HtmlLink.class))<a name="line.646"></a>
+<span class="sourceLineNo">647</span>            return null;<a name="line.647"></a>
+<span class="sourceLineNo">648</span>         if (session.canIgnoreValue(cm, null, o))<a name="line.648"></a>
+<span class="sourceLineNo">649</span>            return null;<a name="line.649"></a>
+<span class="sourceLineNo">650</span>         if (cm.isMap() &amp;&amp; ! cm.isBeanMap()) {<a name="line.650"></a>
+<span class="sourceLineNo">651</span>            Map m = (Map)o;<a name="line.651"></a>
+<span class="sourceLineNo">652</span>            if (th.length != m.keySet().size())<a name="line.652"></a>
+<span class="sourceLineNo">653</span>               return null;<a name="line.653"></a>
+<span class="sourceLineNo">654</span>            for (Object k : m.keySet())<a name="line.654"></a>
+<span class="sourceLineNo">655</span>               if (! s.contains(k.toString()))<a name="line.655"></a>
 <span class="sourceLineNo">656</span>                  return null;<a name="line.656"></a>
-<span class="sourceLineNo">657</span>               l++;<a name="line.657"></a>
-<span class="sourceLineNo">658</span>            }<a name="line.658"></a>
-<span class="sourceLineNo">659</span>            if (s.size() != l)<a name="line.659"></a>
-<span class="sourceLineNo">660</span>               return null;<a name="line.660"></a>
-<span class="sourceLineNo">661</span>         }<a name="line.661"></a>
-<span class="sourceLineNo">662</span>      }<a name="line.662"></a>
-<span class="sourceLineNo">663</span>      return th;<a name="line.663"></a>
-<span class="sourceLineNo">664</span>   }<a name="line.664"></a>
-<span class="sourceLineNo">665</span><a name="line.665"></a>
-<span class="sourceLineNo">666</span>   /**<a name="line.666"></a>
-<span class="sourceLineNo">667</span>    * Returns the schema serializer based on the settings of this serializer.<a name="line.667"></a>
-<span class="sourceLineNo">668</span>    * @return The schema serializer.<a name="line.668"></a>
-<span class="sourceLineNo">669</span>    */<a name="line.669"></a>
-<span class="sourceLineNo">670</span>   @Override /* XmlSerializer */<a name="line.670"></a>
-<span class="sourceLineNo">671</span>   public HtmlSerializer getSchemaSerializer() {<a name="line.671"></a>
-<span class="sourceLineNo">672</span>      if (schemaSerializer == null)<a name="line.672"></a>
-<span class="sourceLineNo">673</span>         schemaSerializer = new HtmlSchemaDocSerializer(propertyStore, getOverrideProperties());<a name="line.673"></a>
-<span class="sourceLineNo">674</span>      return schemaSerializer;<a name="line.674"></a>
-<span class="sourceLineNo">675</span>   }<a name="line.675"></a>
-<span class="sourceLineNo">676</span><a name="line.676"></a>
-<span class="sourceLineNo">677</span><a name="line.677"></a>
-<span class="sourceLineNo">678</span>   //--------------------------------------------------------------------------------<a name="line.678"></a>
-<span class="sourceLineNo">679</span>   // Entry point methods<a name="line.679"></a>
-<span class="sourceLineNo">680</span>   //--------------------------------------------------------------------------------<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>   @Override /* Serializer */<a name="line.682"></a>
-<span class="sourceLineNo">683</span>   public HtmlSerializerSession createSession(Object output, ObjectMap op, Method javaMethod, Locale locale, TimeZone timeZone, MediaType mediaType) {<a name="line.683"></a>
-<span class="sourceLineNo">684</span>      return new HtmlSerializerSession(ctx, op, output, javaMethod, locale, timeZone, mediaType);<a name="line.684"></a>
-<span class="sourceLineNo">685</span>   }<a name="line.685"></a>
-<span class="sourceLineNo">686</span><a name="line.686"></a>
-<span class="sourceLineNo">687</span>   @Override /* Serializer */<a name="line.687"></a>
-<span class="sourceLineNo">688</span>   protected void doSerialize(SerializerSession session, Object o) throws Exception {<a name="line.688"></a>
-<span class="sourceLineNo">689</span>      HtmlSerializerSession s = (HtmlSerializerSession)session;<a name="line.689"></a>
-<span class="sourceLineNo">690</span>      doSerialize(s, o, s.getWriter());<a name="line.690"></a>
+<span class="sourceLineNo">657</span>         } else {<a name="line.657"></a>
+<span class="sourceLineNo">658</span>            BeanMap&lt;?&gt; bm = (o instanceof BeanMap ? (BeanMap)o : session.toBeanMap(o));<a name="line.658"></a>
+<span class="sourceLineNo">659</span>            int l = 0;<a name="line.659"></a>
+<span class="sourceLineNo">660</span>            for (String k : bm.keySet()) {<a name="line.660"></a>
+<span class="sourceLineNo">661</span>               if (! s.contains(k))<a name="line.661"></a>
+<span class="sourceLineNo">662</span>                  return null;<a name="line.662"></a>
+<span class="sourceLineNo">663</span>               l++;<a name="line.663"></a>
+<span class="sourceLineNo">664</span>            }<a name="line.664"></a>
+<span class="sourceLineNo">665</span>            if (s.size() != l)<a name="line.665"></a>
+<span class="sourceLineNo">666</span>               return null;<a name="line.666"></a>
+<span class="sourceLineNo">667</span>         }<a name="line.667"></a>
+<span class="sourceLineNo">668</span>      }<a name="line.668"></a>
+<span class="sourceLineNo">669</span>      return th;<a name="line.669"></a>
+<span class="sourceLineNo">670</span>   }<a name="line.670"></a>
+<span class="sourceLineNo">671</span><a name="line.671"></a>
+<span class="sourceLineNo">672</span>   /**<a name="line.672"></a>
+<span class="sourceLineNo">673</span>    * Returns the schema serializer based on the settings of this serializer.<a name="line.673"></a>
+<span class="sourceLineNo">674</span>    * @return The schema serializer.<a name="line.674"></a>
+<span class="sourceLineNo">675</span>    */<a name="line.675"></a>
+<span class="sourceLineNo">676</span>   @Override /* XmlSerializer */<a name="line.676"></a>
+<span class="sourceLineNo">677</span>   public HtmlSerializer getSchemaSerializer() {<a name="line.677"></a>
+<span class="sourceLineNo">678</span>      if (schemaSerializer == null)<a name="line.678"></a>
+<span class="sourceLineNo">679</span>         schemaSerializer = new HtmlSchemaDocSerializer(propertyStore, getOverrideProperties());<a name="line.679"></a>
+<span class="sourceLineNo">680</span>      return schemaSerializer;<a name="line.680"></a>
+<span class="sourceLineNo">681</span>   }<a name="line.681"></a>
+<span class="sourceLineNo">682</span><a name="line.682"></a>
+<span class="sourceLineNo">683</span><a name="line.683"></a>
+<span class="sourceLineNo">684</span>   //--------------------------------------------------------------------------------<a name="line.684"></a>
+<span class="sourceLineNo">685</span>   // Entry point methods<a name="line.685"></a>
+<span class="sourceLineNo">686</span>   //--------------------------------------------------------------------------------<a name="line.686"></a>
+<span class="sourceLineNo">687</span><a name="line.687"></a>
+<span class="sourceLineNo">688</span>   @Override /* Serializer */<a name="line.688"></a>
+<span class="sourceLineNo">689</span>   public HtmlSerializerSession createSession(Object output, ObjectMap op, Method javaMethod, Locale locale, TimeZone timeZone, MediaType mediaType) {<a name="line.689"></a>
+<span class="sourceLineNo">690</span>      return new HtmlSerializerSession(ctx, op, output, javaMethod, locale, timeZone, mediaType);<a name="line.690"></a>
 <span class="sourceLineNo">691</span>   }<a name="line.691"></a>
-<span class="sourceLineNo">692</span>}<a name="line.692"></a>
+<span class="sourceLineNo">692</span><a name="line.692"></a>
+<span class="sourceLineNo">693</span>   @Override /* Serializer */<a name="line.693"></a>
+<span class="sourceLineNo">694</span>   protected void doSerialize(SerializerSession session, Object o) throws Exception {<a name="line.694"></a>
+<span class="sourceLineNo">695</span>      HtmlSerializerSession s = (HtmlSerializerSession)session;<a name="line.695"></a>
+<span class="sourceLineNo">696</span>      doSerialize(s, o, s.getWriter());<a name="line.696"></a>
+<span class="sourceLineNo">697</span>   }<a name="line.697"></a>
+<span class="sourceLineNo">698</span>}<a name="line.698"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/5aed2f48/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigFile.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigFile.html b/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigFile.html
index 941f21c..c555860 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigFile.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigFile.html
@@ -752,20 +752,19 @@
 <span class="sourceLineNo">744</span>      return null;<a name="line.744"></a>
 <span class="sourceLineNo">745</span>   }<a name="line.745"></a>
 <span class="sourceLineNo">746</span><a name="line.746"></a>
-<span class="sourceLineNo">747</span><a name="line.747"></a>
-<span class="sourceLineNo">748</span>   private static int parseIntWithSuffix(String s) {<a name="line.748"></a>
-<span class="sourceLineNo">749</span>      assertFieldNotNull(s, "s");<a name="line.749"></a>
-<span class="sourceLineNo">750</span>      int m = 1;<a name="line.750"></a>
-<span class="sourceLineNo">751</span>      if (s.endsWith("M")) {<a name="line.751"></a>
-<span class="sourceLineNo">752</span>         m = 1024*1024;<a name="line.752"></a>
-<span class="sourceLineNo">753</span>         s = s.substring(0, s.length()-1).trim();<a name="line.753"></a>
-<span class="sourceLineNo">754</span>      } else if (s.endsWith("K")) {<a name="line.754"></a>
-<span class="sourceLineNo">755</span>         m = 1024;<a name="line.755"></a>
-<span class="sourceLineNo">756</span>         s = s.substring(0, s.length()-1).trim();<a name="line.756"></a>
-<span class="sourceLineNo">757</span>      }<a name="line.757"></a>
-<span class="sourceLineNo">758</span>      return Integer.parseInt(s) * m;<a name="line.758"></a>
-<span class="sourceLineNo">759</span>   }<a name="line.759"></a>
-<span class="sourceLineNo">760</span>}<a name="line.760"></a>
+<span class="sourceLineNo">747</span>   private static int parseIntWithSuffix(String s) {<a name="line.747"></a>
+<span class="sourceLineNo">748</span>      assertFieldNotNull(s, "s");<a name="line.748"></a>
+<span class="sourceLineNo">749</span>      int m = 1;<a name="line.749"></a>
+<span class="sourceLineNo">750</span>      if (s.endsWith("M")) {<a name="line.750"></a>
+<span class="sourceLineNo">751</span>         m = 1024*1024;<a name="line.751"></a>
+<span class="sourceLineNo">752</span>         s = s.substring(0, s.length()-1).trim();<a name="line.752"></a>
+<span class="sourceLineNo">753</span>      } else if (s.endsWith("K")) {<a name="line.753"></a>
+<span class="sourceLineNo">754</span>         m = 1024;<a name="line.754"></a>
+<span class="sourceLineNo">755</span>         s = s.substring(0, s.length()-1).trim();<a name="line.755"></a>
+<span class="sourceLineNo">756</span>      }<a name="line.756"></a>
+<span class="sourceLineNo">757</span>      return Integer.parseInt(s) * m;<a name="line.757"></a>
+<span class="sourceLineNo">758</span>   }<a name="line.758"></a>
+<span class="sourceLineNo">759</span>}<a name="line.759"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/5aed2f48/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigMgr.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigMgr.html b/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigMgr.html
deleted file mode 100644
index aacfc03..0000000
--- a/content/site/apidocs/src-html/org/apache/juneau/ini/ConfigMgr.html
+++ /dev/null
@@ -1,386 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
-<head>
-<title>Source code</title>
-<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">
-</head>
-<body>
-<div class="sourceContainer">
-<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a>
-<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *<a name="line.2"></a>
-<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *<a name="line.3"></a>
-<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *<a name="line.4"></a>
-<span class="sourceLineNo">005</span>// * with the License.  You may obtain a copy of the License at                                                              *<a name="line.5"></a>
-<span class="sourceLineNo">006</span>// *                                                                                                                         *<a name="line.6"></a>
-<span class="sourceLineNo">007</span>// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *<a name="line.7"></a>
-<span class="sourceLineNo">008</span>// *                                                                                                                         *<a name="line.8"></a>
-<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *<a name="line.9"></a>
-<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *<a name="line.10"></a>
-<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License.                                              *<a name="line.11"></a>
-<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a>
-<span class="sourceLineNo">013</span>package org.apache.juneau.ini;<a name="line.13"></a>
-<span class="sourceLineNo">014</span><a name="line.14"></a>
-<span class="sourceLineNo">015</span>import static org.apache.juneau.ini.ConfigFileFormat.*;<a name="line.15"></a>
-<span class="sourceLineNo">016</span><a name="line.16"></a>
-<span class="sourceLineNo">017</span>import java.io.*;<a name="line.17"></a>
-<span class="sourceLineNo">018</span>import java.nio.charset.*;<a name="line.18"></a>
-<span class="sourceLineNo">019</span>import java.util.*;<a name="line.19"></a>
-<span class="sourceLineNo">020</span>import java.util.concurrent.*;<a name="line.20"></a>
-<span class="sourceLineNo">021</span><a name="line.21"></a>
-<span class="sourceLineNo">022</span>import org.apache.juneau.internal.*;<a name="line.22"></a>
-<span class="sourceLineNo">023</span>import org.apache.juneau.json.*;<a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.juneau.parser.*;<a name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.juneau.serializer.*;<a name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.juneau.utils.*;<a name="line.26"></a>
-<span class="sourceLineNo">027</span><a name="line.27"></a>
-<span class="sourceLineNo">028</span>/**<a name="line.28"></a>
-<span class="sourceLineNo">029</span> * Manager for retrieving shared instances of {@link ConfigFile ConfigFiles}.<a name="line.29"></a>
-<span class="sourceLineNo">030</span> *<a name="line.30"></a>
-<span class="sourceLineNo">031</span> * &lt;h5 class='section'&gt;Example:&lt;/h5&gt;<a name="line.31"></a>
-<span class="sourceLineNo">032</span> * &lt;p class='bcode'&gt;<a name="line.32"></a>
-<span class="sourceLineNo">033</span> *    ConfigFile cf = ConfigMgr.&lt;jsf&gt;DEFAULT&lt;/jsf&gt;.get(&lt;js&gt;"MyConfig.cfg"&lt;/js&gt;);<a name="line.33"></a>
-<span class="sourceLineNo">034</span> *    String setting = cf.get(&lt;js&gt;"MySection/mysetting"&lt;/js&gt;);<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * &lt;/p&gt;<a name="line.35"></a>
-<span class="sourceLineNo">036</span> */<a name="line.36"></a>
-<span class="sourceLineNo">037</span>public class ConfigMgr {<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>   /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>    * Default reusable configuration manager.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>    * &lt;ul class='spaced-list'&gt;<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    *    &lt;li&gt;Read-only: &lt;jk&gt;false&lt;/jk&gt;.<a name="line.42"></a>
-<span class="sourceLineNo">043</span>    *    &lt;li&gt;Encoder: {@link XorEncoder}.<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    *    &lt;li&gt;Serializer: {@link JsonSerializer#DEFAULT}.<a name="line.44"></a>
-<span class="sourceLineNo">045</span>    *    &lt;li&gt;Parser: {@link JsonParser#DEFAULT}.<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    *    &lt;li&gt;Charset: {@link Charset#defaultCharset()}.<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    *    &lt;li&gt;Search paths: [&lt;js&gt;"."&lt;/js&gt;].<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    * &lt;/ul&gt;<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    */<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   public static final ConfigMgr DEFAULT = new ConfigMgr(false, new XorEncoder(), JsonSerializer.DEFAULT, JsonParser.DEFAULT, Charset.defaultCharset(), new String[]{"."});<a name="line.50"></a>
-<span class="sourceLineNo">051</span><a name="line.51"></a>
-<span class="sourceLineNo">052</span>   private ConcurrentHashMap&lt;String,File&gt; files = new ConcurrentHashMap&lt;String,File&gt;();<a name="line.52"></a>
-<span class="sourceLineNo">053</span>   private ConcurrentHashMap&lt;File,ConfigFile&gt; configs = new ConcurrentHashMap&lt;File,ConfigFile&gt;();<a name="line.53"></a>
-<span class="sourceLineNo">054</span>   private final WriterSerializer serializer;<a name="line.54"></a>
-<span class="sourceLineNo">055</span>   private final ReaderParser parser;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   private final Encoder encoder;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   private final boolean readOnly;<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   private final Charset charset;<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   private final List&lt;File&gt; searchPaths = new LinkedList&lt;File&gt;();<a name="line.59"></a>
-<span class="sourceLineNo">060</span><a name="line.60"></a>
-<span class="sourceLineNo">061</span>   /**<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    * Create a custom configuration manager.<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    *<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    * @param readOnly Make {@link ConfigFile ConfigFiles} read-only.<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    * @param encoder Optional.  Specify the encoder to use for encoded config file entries (e.g. &lt;js&gt;"mySecret*={...}"&lt;/js&gt;).<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    * @param serializer Optional.  Specify the serializer to use for serializing POJOs when using {@link ConfigFile#put(String, Object)}.<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    * @param parser Optional.  Specify the parser to use for parsing POJOs when using {@link ConfigFile#getObject(Class,String)}.<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    * @param charset Optional.  Specify the config file character encoding.  If &lt;jk&gt;null&lt;/jk&gt;, uses {@link Charset#defaultCharset()}.<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    * @param searchPaths Specify the search paths for config files.  Can contain relative or absolute paths.<a name="line.69"></a>
-<span class="sourceLineNo">070</span>    */<a name="line.70"></a>
-<span class="sourceLineNo">071</span>   public ConfigMgr(boolean readOnly, Encoder encoder, WriterSerializer serializer, ReaderParser parser, Charset charset, String[] searchPaths) {<a name="line.71"></a>
-<span class="sourceLineNo">072</span>      this.readOnly = readOnly;<a name="line.72"></a>
-<span class="sourceLineNo">073</span>      this.encoder = encoder;<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      this.serializer = serializer;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>      this.parser = parser;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>      this.charset = charset;<a name="line.76"></a>
-<span class="sourceLineNo">077</span>      if (searchPaths != null)<a name="line.77"></a>
-<span class="sourceLineNo">078</span>         for (String p : searchPaths)<a name="line.78"></a>
-<span class="sourceLineNo">079</span>            this.searchPaths.add(new File(p));<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   }<a name="line.80"></a>
-<span class="sourceLineNo">081</span><a name="line.81"></a>
-<span class="sourceLineNo">082</span>   /**<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    * Returns the config file with the specified absolute or relative path.<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    * &lt;p&gt;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>    * Multiple calls to the same path return the same &lt;code&gt;ConfigFile&lt;/code&gt; instance.<a name="line.85"></a>
-<span class="sourceLineNo">086</span>    *<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    * @param path The absolute or relative path of the config file.<a name="line.87"></a>
-<span class="sourceLineNo">088</span>    * @return The config file.<a name="line.88"></a>
-<span class="sourceLineNo">089</span>    * @throws IOException If config file could not be parsed.<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    * @throws FileNotFoundException If config file could not be found.<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    */<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   public ConfigFile get(String path) throws IOException {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      return get(path, false);<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   }<a name="line.94"></a>
-<span class="sourceLineNo">095</span><a name="line.95"></a>
-<span class="sourceLineNo">096</span>   /**<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    * Returns the config file with the specified absolute or relative path.<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    * &lt;p&gt;<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    * Multiple calls to the same path return the same &lt;code&gt;ConfigFile&lt;/code&gt; instance.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    * &lt;p&gt;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>    * If file doesn't exist and &lt;code&gt;create&lt;/code&gt; is &lt;jk&gt;true&lt;/jk&gt;, the configuration file will be<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    * create in the location identified by the first entry in the search paths.<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    *<a name="line.103"></a>
-<span class="sourceLineNo">104</span>    * @param path The absolute or relative path of the config file.<a name="line.104"></a>
-<span class="sourceLineNo">105</span>    * @param create Create the config file if it doesn't exist.<a name="line.105"></a>
-<span class="sourceLineNo">106</span>    * @return The config file.<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    * @throws IOException If config file could not be parsed.<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    * @throws FileNotFoundException If config file could not be found or could not be created.<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    */<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   public ConfigFile get(String path, boolean create) throws IOException {<a name="line.110"></a>
-<span class="sourceLineNo">111</span><a name="line.111"></a>
-<span class="sourceLineNo">112</span>      File f = resolve(path, create);<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>      ConfigFile cf = configs.get(f);<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      if (cf != null)<a name="line.115"></a>
-<span class="sourceLineNo">116</span>         return cf;<a name="line.116"></a>
-<span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>      cf = new ConfigFileImpl(f, readOnly, encoder, serializer, parser, charset);<a name="line.118"></a>
-<span class="sourceLineNo">119</span>      configs.putIfAbsent(f, cf);<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      return configs.get(f);<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   }<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>    * Create a new empty config file not backed by any file.<a name="line.124"></a>
-<span class="sourceLineNo">125</span>    *<a name="line.125"></a>
-<span class="sourceLineNo">126</span>    * @return A new config file.<a name="line.126"></a>
-<span class="sourceLineNo">127</span>    * @throws IOException<a name="line.127"></a>
-<span class="sourceLineNo">128</span>    */<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   public ConfigFile create() throws IOException {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>      return new ConfigFileImpl(null, false, encoder, serializer, parser, charset);<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>    * Create a new config file backed by the specified file.<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    * Note that {@link #get(String)} is the preferred method for getting access to config files<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    *    since this method will create a new config file each time it is called.<a name="line.136"></a>
-<span class="sourceLineNo">137</span>    * This method is provided primarily for testing purposes.<a name="line.137"></a>
-<span class="sourceLineNo">138</span>    *<a name="line.138"></a>
-<span class="sourceLineNo">139</span>    * @param f The file to create a config file from.<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    * @return A new config file.<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>   public ConfigFile create(File f) throws IOException {<a name="line.143"></a>
-<span class="sourceLineNo">144</span>      return new ConfigFileImpl(f, false, encoder, serializer, parser, charset);<a name="line.144"></a>
-<span class="sourceLineNo">145</span>   }<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>    * Create a new config file not backed by a file.<a name="line.148"></a>
-<span class="sourceLineNo">149</span>    *<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    * @param r The reader containing an INI-formatted file to initialize the config file from.<a name="line.150"></a>
-<span class="sourceLineNo">151</span>    * @return A new config file.<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    * @throws IOException<a name="line.152"></a>
-<span class="sourceLineNo">153</span>    */<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   public ConfigFile create(Reader r) throws IOException {<a name="line.154"></a>
-<span class="sourceLineNo">155</span>      return new ConfigFileImpl(null, false, encoder, serializer, parser, charset).load(r);<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>    * Reloads any config files that were modified.<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    * @throws IOException<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    */<a name="line.161"></a>
-<span class="sourceLineNo">162</span>   public void loadIfModified() throws IOException {<a name="line.162"></a>
-<span class="sourceLineNo">163</span>      for (ConfigFile cf : configs.values())<a name="line.163"></a>
-<span class="sourceLineNo">164</span>         cf.loadIfModified();<a name="line.164"></a>
-<span class="sourceLineNo">165</span>   }<a name="line.165"></a>
-<span class="sourceLineNo">166</span><a name="line.166"></a>
-<span class="sourceLineNo">167</span>   /**<a name="line.167"></a>
-<span class="sourceLineNo">168</span>    * Delete all configuration files registered with this config manager.<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    */<a name="line.169"></a>
-<span class="sourceLineNo">170</span>   public void deleteAll() {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      for (File f : Collections.list(configs.keys()))  // Don't use keySet(), otherwise fails on Java 6/7 if compiled using Java 8.<a name="line.171"></a>
-<span class="sourceLineNo">172</span>         FileUtils.delete(f);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      files.clear();<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      configs.clear();<a name="line.174"></a>
-<span class="sourceLineNo">175</span>   }<a name="line.175"></a>
-<span class="sourceLineNo">176</span><a name="line.176"></a>
-<span class="sourceLineNo">177</span>   private File resolve(String path, boolean create) throws IOException {<a name="line.177"></a>
-<span class="sourceLineNo">178</span><a name="line.178"></a>
-<span class="sourceLineNo">179</span>      // See if it's cached.<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      File f = files.get(path);<a name="line.180"></a>
-<span class="sourceLineNo">181</span>      if (f != null)<a name="line.181"></a>
-<span class="sourceLineNo">182</span>         return f;<a name="line.182"></a>
-<span class="sourceLineNo">183</span><a name="line.183"></a>
-<span class="sourceLineNo">184</span>      // Handle absolute file.<a name="line.184"></a>
-<span class="sourceLineNo">185</span>      f = new File(path);<a name="line.185"></a>
-<span class="sourceLineNo">186</span>      if (f.isAbsolute()) {<a name="line.186"></a>
-<span class="sourceLineNo">187</span>         if (create)<a name="line.187"></a>
-<span class="sourceLineNo">188</span>            FileUtils.create(f);<a name="line.188"></a>
-<span class="sourceLineNo">189</span>         if (f.exists())<a name="line.189"></a>
-<span class="sourceLineNo">190</span>            return addFile(path, f);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>         throw new FileNotFoundException("Could not find config file '"+path+"'");<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>      if (searchPaths.isEmpty())<a name="line.194"></a>
-<span class="sourceLineNo">195</span>         throw new FileNotFoundException("No search paths specified on ConfigMgr.");<a name="line.195"></a>
-<span class="sourceLineNo">196</span><a name="line.196"></a>
-<span class="sourceLineNo">197</span>      // Handle paths relative to search paths.<a name="line.197"></a>
-<span class="sourceLineNo">198</span>      for (File sf : searchPaths) {<a name="line.198"></a>
-<span class="sourceLineNo">199</span>         f = new File(sf.getAbsolutePath() + "/" + path);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>         if (f.exists())<a name="line.200"></a>
-<span class="sourceLineNo">201</span>            return addFile(path, f);<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>      if (create) {<a name="line.204"></a>
-<span class="sourceLineNo">205</span>         f = new File(searchPaths.get(0).getAbsolutePath() + "/" + path);<a name="line.205"></a>
-<span class="sourceLineNo">206</span>         FileUtils.create(f);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            return addFile(path, f);<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>      throw new FileNotFoundException("Could not find config file '"+path+"'");<a name="line.210"></a>
-<span class="sourceLineNo">211</span>   }<a name="line.211"></a>
-<span class="sourceLineNo">212</span><a name="line.212"></a>
-<span class="sourceLineNo">213</span>   private File addFile(String path, File f) {<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      files.putIfAbsent(path, f);<a name="line.214"></a>
-<span class="sourceLineNo">215</span>      return files.get(path);<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>   /**<a name="line.218"></a>
-<span class="sourceLineNo">219</span>    * Implements command-line features for working with INI configuration files.<a name="line.219"></a>
-<span class="sourceLineNo">220</span>    * &lt;p&gt;<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    * Invoke as a normal Java program...<a name="line.221"></a>
-<span class="sourceLineNo">222</span>    * &lt;p&gt;<a name="line.222"></a>
-<span class="sourceLineNo">223</span>    * &lt;p class='bcode'&gt;<a name="line.223"></a>
-<span class="sourceLineNo">224</span>    *    java org.apache.juneau.ini.ConfigMgr [args]<a name="line.224"></a>
-<span class="sourceLineNo">225</span>    * &lt;/p&gt;<a name="line.225"></a>
-<span class="sourceLineNo">226</span>    * &lt;p&gt;<a name="line.226"></a>
-<span class="sourceLineNo">227</span>    * Arguments can be any of the following...<a name="line.227"></a>
-<span class="sourceLineNo">228</span>    * &lt;ul class='spaced-list'&gt;<a name="line.228"></a>
-<span class="sourceLineNo">229</span>    *    &lt;li&gt;No arguments&lt;br&gt;<a name="line.229"></a>
-<span class="sourceLineNo">230</span>    *       Prints usage message.&lt;br&gt;<a name="line.230"></a>
-<span class="sourceLineNo">231</span>    *    &lt;li&gt;&lt;code&gt;createBatchEnvFile -configfile &amp;lt;configFile&amp;gt; -envfile &amp;lt;batchFile&amp;gt; [-verbose]&lt;/code&gt;&lt;br&gt;<a name="line.231"></a>
-<span class="sourceLineNo">232</span>    *       Creates a batch file that will set each config file entry as an environment variable.&lt;br&gt;<a name="line.232"></a>
-<span class="sourceLineNo">233</span>    *       Characters in the keys that are not valid as environment variable names (e.g. &lt;js&gt;'/'&lt;/js&gt; and &lt;js&gt;'.'&lt;/js&gt;)<a name="line.233"></a>
-<span class="sourceLineNo">234</span>    *          will be converted to underscores.&lt;br&gt;<a name="line.234"></a>
-<span class="sourceLineNo">235</span>    *    &lt;li&gt;&lt;code&gt;createShellEnvFile -configFile &amp;lt;configFile&amp;gt; -envFile &amp;lt;configFile&amp;gt; [-verbose]&lt;/code&gt;<a name="line.235"></a>
-<span class="sourceLineNo">236</span>    *       Creates a shell script that will set each config file entry as an environment variable.&lt;br&gt;<a name="line.236"></a>
-<span class="sourceLineNo">237</span>    *       Characters in the keys that are not valid as environment variable names (e.g. &lt;js&gt;'/'&lt;/js&gt; and &lt;js&gt;'.'&lt;/js&gt;)<a name="line.237"></a>
-<span class="sourceLineNo">238</span>    *          will be converted to underscores.&lt;br&gt;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>    *    &lt;li&gt;&lt;code&gt;setVals -configFile &amp;lt;configFile&amp;gt; -vals [var1=val1 [var2=val2...]] [-verbose]&lt;/code&gt;<a name="line.239"></a>
-<span class="sourceLineNo">240</span>    *       Sets values in config files.&lt;br&gt;<a name="line.240"></a>
-<span class="sourceLineNo">241</span>    * &lt;/ul&gt;<a name="line.241"></a>
-<span class="sourceLineNo">242</span>    * &lt;p&gt;<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    * For example, the following command will create the file &lt;code&gt;'MyConfig.bat'&lt;/code&gt; from the contents of the file &lt;code&gt;'MyConfig.cfg'&lt;/code&gt;.<a name="line.243"></a>
-<span class="sourceLineNo">244</span>    * &lt;p class='bcode'&gt;<a name="line.244"></a>
-<span class="sourceLineNo">245</span>    *    java org.apache.juneau.ini.ConfigMgr createBatchEnvFile -configfile C:\foo\MyConfig.cfg -batchfile C:\foo\MyConfig.bat<a name="line.245"></a>
-<span class="sourceLineNo">246</span>    * &lt;/p&gt;<a name="line.246"></a>
-<span class="sourceLineNo">247</span>    *<a name="line.247"></a>
-<span class="sourceLineNo">248</span>    * @param args Command-line arguments<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    */<a name="line.249"></a>
-<span class="sourceLineNo">250</span>   public static void main(String[] args) {<a name="line.250"></a>
-<span class="sourceLineNo">251</span><a name="line.251"></a>
-<span class="sourceLineNo">252</span>      Args a = new Args(args);<a name="line.252"></a>
-<span class="sourceLineNo">253</span>      String command = a.getArg(0);<a name="line.253"></a>
-<span class="sourceLineNo">254</span>      String configFile = a.getArg("configFile");<a name="line.254"></a>
-<span class="sourceLineNo">255</span>      String envFile = a.getArg("envFile");<a name="line.255"></a>
-<span class="sourceLineNo">256</span>      List&lt;String&gt; vals = a.getArgs("vals");<a name="line.256"></a>
-<span class="sourceLineNo">257</span><a name="line.257"></a>
-<span class="sourceLineNo">258</span>      if (command == null || ! (command.equals("createBatchEnvFile") || command.equals("createShellEnvFile") || command.equals("setVals")))<a name="line.258"></a>
-<span class="sourceLineNo">259</span>         printUsageAndExit();<a name="line.259"></a>
-<span class="sourceLineNo">260</span>      else if (configFile.isEmpty())<a name="line.260"></a>
-<span class="sourceLineNo">261</span>         printUsageAndExit();<a name="line.261"></a>
-<span class="sourceLineNo">262</span>      else if (command.equals("setVals") &amp;&amp; vals.isEmpty())<a name="line.262"></a>
-<span class="sourceLineNo">263</span>         printUsageAndExit();<a name="line.263"></a>
-<span class="sourceLineNo">264</span>      else if ((command.equals("createBatchEnvFile") || command.equals("createShellEnvFile")) &amp;&amp; envFile.isEmpty())<a name="line.264"></a>
-<span class="sourceLineNo">265</span>         printUsageAndExit();<a name="line.265"></a>
-<span class="sourceLineNo">266</span>      else {<a name="line.266"></a>
-<span class="sourceLineNo">267</span>         try {<a name="line.267"></a>
-<span class="sourceLineNo">268</span>            ConfigFile cf = ConfigMgr.DEFAULT.get(configFile);<a name="line.268"></a>
-<span class="sourceLineNo">269</span><a name="line.269"></a>
-<span class="sourceLineNo">270</span>            if (command.equalsIgnoreCase("setVals")) {<a name="line.270"></a>
-<span class="sourceLineNo">271</span>               for (String val : vals) {<a name="line.271"></a>
-<span class="sourceLineNo">272</span>                  String[] x = val.split("\\=");<a name="line.272"></a>
-<span class="sourceLineNo">273</span>                  if (x.length != 2)<a name="line.273"></a>
-<span class="sourceLineNo">274</span>                     throw new RuntimeException("Invalid format for value: '"+val+"'.  Must be in the format 'key=value'");<a name="line.274"></a>
-<span class="sourceLineNo">275</span>                  cf.put(x[0], x[1]);<a name="line.275"></a>
-<span class="sourceLineNo">276</span>               }<a name="line.276"></a>
-<span class="sourceLineNo">277</span>               cf.save();<a name="line.277"></a>
-<span class="sourceLineNo">278</span>               return;<a name="line.278"></a>
-<span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>            } else if (command.equalsIgnoreCase("createBatchEnvFile")) {<a name="line.280"></a>
-<span class="sourceLineNo">281</span>               Writer fw = new OutputStreamWriter(new FileOutputStream(envFile), Charset.defaultCharset());<a name="line.281"></a>
-<span class="sourceLineNo">282</span>               try {<a name="line.282"></a>
-<span class="sourceLineNo">283</span>                  cf.serializeTo(fw, BATCH);<a name="line.283"></a>
-<span class="sourceLineNo">284</span>               } finally {<a name="line.284"></a>
-<span class="sourceLineNo">285</span>                  fw.close();<a name="line.285"></a>
-<span class="sourceLineNo">286</span>               }<a name="line.286"></a>
-<span class="sourceLineNo">287</span>               return;<a name="line.287"></a>
-<span class="sourceLineNo">288</span><a name="line.288"></a>
-<span class="sourceLineNo">289</span>            } else if (command.equalsIgnoreCase("createShellEnvFile")) {<a name="line.289"></a>
-<span class="sourceLineNo">290</span>               Writer fw = new OutputStreamWriter(new FileOutputStream(envFile), Charset.defaultCharset());<a name="line.290"></a>
-<span class="sourceLineNo">291</span>               try {<a name="line.291"></a>
-<span class="sourceLineNo">292</span>                  cf.serializeTo(fw, SHELL);<a name="line.292"></a>
-<span class="sourceLineNo">293</span>               } finally {<a name="line.293"></a>
-<span class="sourceLineNo">294</span>                  fw.close();<a name="line.294"></a>
-<span class="sourceLineNo">295</span>               }<a name="line.295"></a>
-<span class="sourceLineNo">296</span>               return;<a name="line.296"></a>
-<span class="sourceLineNo">297</span>            }<a name="line.297"></a>
-<span class="sourceLineNo">298</span><a name="line.298"></a>
-<span class="sourceLineNo">299</span>         } catch (Exception e) {<a name="line.299"></a>
-<span class="sourceLineNo">300</span>            e.printStackTrace();<a name="line.300"></a>
-<span class="sourceLineNo">301</span>         }<a name="line.301"></a>
-<span class="sourceLineNo">302</span>      }<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   }<a name="line.303"></a>
-<span class="sourceLineNo">304</span><a name="line.304"></a>
-<span class="sourceLineNo">305</span>   private static void printUsageAndExit() {<a name="line.305"></a>
-<span class="sourceLineNo">306</span>      System.err.println("---Usage---"); // NOT DEBUG<a name="line.306"></a>
-<span class="sourceLineNo">307</span>      System.err.println("java -cp juneau.jar org.apache.juneau.ini.ConfigFile createBatchEnvFile -configFile &lt;configFile&gt; -envFile &lt;envFile&gt; [-verbose]"); // NOT DEBUG<a name="line.307"></a>
-<span class="sourceLineNo">308</span>      System.err.println("java -cp juneau.jar org.apache.juneau.ini.ConfigFile createShellEnvFile -configFile &lt;configFile&gt; -envFile &lt;envFile&gt; [-verbose]"); // NOT DEBUG<a name="line.308"></a>
-<span class="sourceLineNo">309</span>      System.err.println("java -cp juneau.jar org.apache.juneau.ini.ConfigFile setVals -configFile &lt;configFile&gt; -vals [var1 val1 [var2 val2...]] [-verbose]"); // NOT DEBUG<a name="line.309"></a>
-<span class="sourceLineNo">310</span>      int rc = Integer.getInteger("exit.2", 2);<a name="line.310"></a>
-<span class="sourceLineNo">311</span>      if (rc != 0)<a name="line.311"></a>
-<span class="sourceLineNo">312</span>         System.exit(rc);<a name="line.312"></a>
-<span class="sourceLineNo">313</span>   }<a name="line.313"></a>
-<span class="sourceLineNo">314</span>}<a name="line.314"></a>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-</pre>
-</div>
-</body>
-</html>


Mime
View raw message