commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util folder.gif file.gif URLParser.html index.html
Date Mon, 01 Apr 2002 05:43:03 GMT
dion        02/03/31 21:43:03

  Added:       docs/latka/xref/java/org/apache/commons/latka/util/xml
                        folder.gif file.gif index.html
                        DelegateHandlerImpl.html DelegateHandler.html
                        BasicDelegateHandler.html
               docs/latka/xref/java/org/apache/commons/latka/util
                        folder.gif file.gif URLParser.html index.html
  Log:
  New Maven generated site
  
  Revision  Changes    Path
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/folder.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/file.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/index.html
  
  Index: index.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <a href="../">[parent]</a>
  <hr>
  <table width="100%">
  <tr>
  <td><b>Name</b></td>
  <td><b>Size</b></td>
  <td><b>Last Modified</b></td>
  </tr>
  <tr valign="middle"><td valign="middle" NOWRAP><img src="./file.gif" valign="middle" border="0">&nbsp;<a href="BasicDelegateHandler.html">BasicDelegateHandler.java</a></td><td valign="middle" NOWRAP>15532 (in bytes) </td><td valign="middle" NOWRAP>1/04/2002</td></tr>
  <tr valign="middle"><td valign="middle" NOWRAP><img src="./file.gif" valign="middle" border="0">&nbsp;<a href="DelegateHandler.html">DelegateHandler.java</a></td><td valign="middle" NOWRAP>8328 (in bytes) </td><td valign="middle" NOWRAP>1/04/2002</td></tr>
  <tr valign="middle"><td valign="middle" NOWRAP><img src="./file.gif" valign="middle" border="0">&nbsp;<a href="DelegateHandlerImpl.html">DelegateHandlerImpl.java</a></td><td valign="middle" NOWRAP>11032 (in bytes) </td><td valign="middle" NOWRAP>1/04/2002</td></tr>
  </table>
  <hr>
  <center>This page automatically generated by Maven</center>
  </body>
  </html>
  
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/DelegateHandlerImpl.html
  
  Index: DelegateHandlerImpl.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <pre>
  <table bgcolor="#FFFFCC" cellpadding="0" cellspacing="0" border="0" width="100%"><a href="../../../../../../../../apidocs/org/apache/commons/latka/util/xml/DelegateHandlerImpl.html">View Javadoc</a></table>
  <a name="1" href="#1">1</a>   <font color="#329900"><i>/*</font></i>
  <a name="2" href="#2">2</a>   <font color="#329900"><i> * ====================================================================</font></i>
  <a name="3" href="#3">3</a>   <font color="#329900"><i> *</font></i>
  <a name="4" href="#4">4</a>   <font color="#329900"><i> * The Apache Software License, Version 1.1</font></i>
  <a name="5" href="#5">5</a>   <font color="#329900"><i> *</font></i>
  <a name="6" href="#6">6</a>   <font color="#329900"><i> * Copyright (c) 1999 The Apache Software Foundation.  All rights </font></i>
  <a name="7" href="#7">7</a>   <font color="#329900"><i> * reserved.</font></i>
  <a name="8" href="#8">8</a>   <font color="#329900"><i> *</font></i>
  <a name="9" href="#9">9</a>   <font color="#329900"><i> * Redistribution and use in source and binary forms, with or without</font></i>
  <a name="10" href="#10">10</a>  <font color="#329900"><i> * modification, are permitted provided that the following conditions</font></i>
  <a name="11" href="#11">11</a>  <font color="#329900"><i> * are met:</font></i>
  <a name="12" href="#12">12</a>  <font color="#329900"><i> *</font></i>
  <a name="13" href="#13">13</a>  <font color="#329900"><i> * 1. Redistributions of source code must retain the above copyright</font></i>
  <a name="14" href="#14">14</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer. </font></i>
  <a name="15" href="#15">15</a>  <font color="#329900"><i> *</font></i>
  <a name="16" href="#16">16</a>  <font color="#329900"><i> * 2. Redistributions in binary form must reproduce the above copyright</font></i>
  <a name="17" href="#17">17</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer in</font></i>
  <a name="18" href="#18">18</a>  <font color="#329900"><i> *    the documentation and/or other materials provided with the</font></i>
  <a name="19" href="#19">19</a>  <font color="#329900"><i> *    distribution.</font></i>
  <a name="20" href="#20">20</a>  <font color="#329900"><i> *</font></i>
  <a name="21" href="#21">21</a>  <font color="#329900"><i> * 3. The end-user documentation included with the redistribution, if</font></i>
  <a name="22" href="#22">22</a>  <font color="#329900"><i> *    any, must include the following acknowlegement:  </font></i>
  <a name="23" href="#23">23</a>  <font color="#329900"><i> *       "This product includes software developed by the </font></i>
  <a name="24" href="#24">24</a>  <font color="#329900"><i> *        Apache Software Foundation (<a href="http://www.apache.org/" target="alexandria_uri">http://www.apache.org/</a>)."</font></i>
  <a name="25" href="#25">25</a>  <font color="#329900"><i> *    Alternately, this acknowlegement may appear in the software itself,</font></i>
  <a name="26" href="#26">26</a>  <font color="#329900"><i> *    if and wherever such third-party acknowlegements normally appear.</font></i>
  <a name="27" href="#27">27</a>  <font color="#329900"><i> *</font></i>
  <a name="28" href="#28">28</a>  <font color="#329900"><i> * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software</font></i>
  <a name="29" href="#29">29</a>  <font color="#329900"><i> *    Foundation" must not be used to endorse or promote products derived</font></i>
  <a name="30" href="#30">30</a>  <font color="#329900"><i> *    from this software without prior written permission. For written </font></i>
  <a name="31" href="#31">31</a>  <font color="#329900"><i> *    permission, please contact apache@apache.org.</font></i>
  <a name="32" href="#32">32</a>  <font color="#329900"><i> *</font></i>
  <a name="33" href="#33">33</a>  <font color="#329900"><i> * 5. Products derived from this software may not be called "Apache"</font></i>
  <a name="34" href="#34">34</a>  <font color="#329900"><i> *    nor may "Apache" appear in their names without prior written</font></i>
  <a name="35" href="#35">35</a>  <font color="#329900"><i> *    permission of the Apache Group.</font></i>
  <a name="36" href="#36">36</a>  <font color="#329900"><i> *</font></i>
  <a name="37" href="#37">37</a>  <font color="#329900"><i> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</font></i>
  <a name="38" href="#38">38</a>  <font color="#329900"><i> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</font></i>
  <a name="39" href="#39">39</a>  <font color="#329900"><i> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</font></i>
  <a name="40" href="#40">40</a>  <font color="#329900"><i> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR</font></i>
  <a name="41" href="#41">41</a>  <font color="#329900"><i> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</font></i>
  <a name="42" href="#42">42</a>  <font color="#329900"><i> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</font></i>
  <a name="43" href="#43">43</a>  <font color="#329900"><i> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</font></i>
  <a name="44" href="#44">44</a>  <font color="#329900"><i> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</font></i>
  <a name="45" href="#45">45</a>  <font color="#329900"><i> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</font></i>
  <a name="46" href="#46">46</a>  <font color="#329900"><i> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</font></i>
  <a name="47" href="#47">47</a>  <font color="#329900"><i> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</font></i>
  <a name="48" href="#48">48</a>  <font color="#329900"><i> * SUCH DAMAGE.</font></i>
  <a name="49" href="#49">49</a>  <font color="#329900"><i> * ====================================================================</font></i>
  <a name="50" href="#50">50</a>  <font color="#329900"><i> *</font></i>
  <a name="51" href="#51">51</a>  <font color="#329900"><i> * This software consists of voluntary contributions made by many</font></i>
  <a name="52" href="#52">52</a>  <font color="#329900"><i> * individuals on behalf of the Apache Software Foundation.  For more</font></i>
  <a name="53" href="#53">53</a>  <font color="#329900"><i> * information on the Apache Software Foundation, please see</font></i>
  <a name="54" href="#54">54</a>  <font color="#329900"><i> * &lt;<a href="http://www.apache.org/&gt" target="alexandria_uri">http://www.apache.org/&gt</a>;.</font></i>
  <a name="55" href="#55">55</a>  <font color="#329900"><i> *</font></i>
  <a name="56" href="#56">56</a>  <font color="#329900"><i> * [Additional notices, if required by prior licensing conditions]</font></i>
  <a name="57" href="#57">57</a>  <font color="#329900"><i> *</font></i>
  <a name="58" href="#58">58</a>  <font color="#329900"><i> */</font></i>   
  <a name="59" href="#59">59</a>  
  <a name="60" href="#60">60</a>  <b>package</b> <a href="../../../../../../org/apache/commons/latka/util/xml/index.html">org.apache.commons.latka.util.xml</a>;
  <a name="61" href="#61">61</a>  
  <a name="62" href="#62">62</a>  <b>import</b> org.xml.sax.XMLReader;
  <a name="63" href="#63">63</a>  <b>import</b> org.xml.sax.ContentHandler;
  <a name="64" href="#64">64</a>  
  <a name="65" href="#65">65</a>  <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="66" href="#66">66</a>  <font color="#AA0000"><i> * A BasicDelegateHandler with convenient constructors.  Constructors </font></i>
  <a name="67" href="#67">67</a>  <font color="#AA0000"><i> * are a good way to insure that the init method is called.  This is </font></i>
  <a name="68" href="#68">68</a>  <font color="#AA0000"><i> * the best base class for most delegate handlers.  BasicDelegateHandler</font></i>
  <a name="69" href="#69">69</a>  <font color="#AA0000"><i> * is a good base class for delegate handlers produced by factories and/or</font></i>
  <a name="70" href="#70">70</a>  <font color="#AA0000"><i> * reflection.</font></i>
  <a name="71" href="#71">71</a>  <font color="#AA0000"><i> */</font></i>
  <a name="72" href="#72">72</a>  <b>public</b> <b>abstract</b> <b>class</b> <a href="../../../../../../org/apache/commons/latka/util/xml/DelegateHandlerImpl.html">DelegateHandlerImpl</a> <b>extends</b> <a href="../../../../../../org/apache/commons/latka/util/xml/BasicDelegateHandler.html">BasicDelegateHandler</a>
  <a name="73" href="#73">73</a>  {
  <a name="74" href="#74">74</a>  
  <a name="75" href="#75">75</a>    <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="76" href="#76">76</a>  <font color="#AA0000"><i>   * Create a DelegateHandler that releases to the</font></i>
  <a name="77" href="#77">77</a>  <font color="#AA0000"><i>   * current ContentHandler of the specified XMLReader</font></i>
  <a name="78" href="#78">78</a>  <font color="#AA0000"><i>   * </font></i>
  <a name="79" href="#79">79</a>  <font color="#AA0000"><i>   * @param reader XMLReader that will do the parsing</font></i>
  <a name="80" href="#80">80</a>  <font color="#AA0000"><i>   */</font></i>
  <a name="81" href="#81">81</a>    <b>public</b> <a href="../../../../../../org/apache/commons/latka/util/xml/DelegateHandlerImpl.html">DelegateHandlerImpl</a>(XMLReader reader) {
  <a name="82" href="#82">82</a>      init(reader);
  <a name="83" href="#83">83</a>    }
  <a name="84" href="#84">84</a>  
  <a name="85" href="#85">85</a>    <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="86" href="#86">86</a>  <font color="#AA0000"><i>   * Create a DelegateHandler that releases to a</font></i>
  <a name="87" href="#87">87</a>  <font color="#AA0000"><i>   * specific ContentHandler</font></i>
  <a name="88" href="#88">88</a>  <font color="#AA0000"><i>   * </font></i>
  <a name="89" href="#89">89</a>  <font color="#AA0000"><i>   * @param reader  XMLReader that will do the parsing</font></i>
  <a name="90" href="#90">90</a>  <font color="#AA0000"><i>   *                </font></i>
  <a name="91" href="#91">91</a>  <font color="#AA0000"><i>   * @param handler Handler that will resume parsing once release has been</font></i>
  <a name="92" href="#92">92</a>  <font color="#AA0000"><i>   *                called</font></i>
  <a name="93" href="#93">93</a>  <font color="#AA0000"><i>   */</font></i>
  <a name="94" href="#94">94</a>    <b>public</b> <a href="../../../../../../org/apache/commons/latka/util/xml/DelegateHandlerImpl.html">DelegateHandlerImpl</a>(XMLReader reader, ContentHandler handler) {
  <a name="95" href="#95">95</a>      init(reader,handler);
  <a name="96" href="#96">96</a>    }
  <a name="97" href="#97">97</a>  
  <a name="98" href="#98">98</a>  }
  </pre>
  <hr><center>This page automatically generated by Maven</center></body>
  </html>
  
  
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/DelegateHandler.html
  
  Index: DelegateHandler.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <pre>
  <table bgcolor="#FFFFCC" cellpadding="0" cellspacing="0" border="0" width="100%"><a href="../../../../../../../../apidocs/org/apache/commons/latka/util/xml/DelegateHandler.html">View Javadoc</a></table>
  <a name="1" href="#1">1</a>   <font color="#329900"><i>/*</font></i>
  <a name="2" href="#2">2</a>   <font color="#329900"><i> * ====================================================================</font></i>
  <a name="3" href="#3">3</a>   <font color="#329900"><i> *</font></i>
  <a name="4" href="#4">4</a>   <font color="#329900"><i> * The Apache Software License, Version 1.1</font></i>
  <a name="5" href="#5">5</a>   <font color="#329900"><i> *</font></i>
  <a name="6" href="#6">6</a>   <font color="#329900"><i> * Copyright (c) 1999 The Apache Software Foundation.  All rights </font></i>
  <a name="7" href="#7">7</a>   <font color="#329900"><i> * reserved.</font></i>
  <a name="8" href="#8">8</a>   <font color="#329900"><i> *</font></i>
  <a name="9" href="#9">9</a>   <font color="#329900"><i> * Redistribution and use in source and binary forms, with or without</font></i>
  <a name="10" href="#10">10</a>  <font color="#329900"><i> * modification, are permitted provided that the following conditions</font></i>
  <a name="11" href="#11">11</a>  <font color="#329900"><i> * are met:</font></i>
  <a name="12" href="#12">12</a>  <font color="#329900"><i> *</font></i>
  <a name="13" href="#13">13</a>  <font color="#329900"><i> * 1. Redistributions of source code must retain the above copyright</font></i>
  <a name="14" href="#14">14</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer. </font></i>
  <a name="15" href="#15">15</a>  <font color="#329900"><i> *</font></i>
  <a name="16" href="#16">16</a>  <font color="#329900"><i> * 2. Redistributions in binary form must reproduce the above copyright</font></i>
  <a name="17" href="#17">17</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer in</font></i>
  <a name="18" href="#18">18</a>  <font color="#329900"><i> *    the documentation and/or other materials provided with the</font></i>
  <a name="19" href="#19">19</a>  <font color="#329900"><i> *    distribution.</font></i>
  <a name="20" href="#20">20</a>  <font color="#329900"><i> *</font></i>
  <a name="21" href="#21">21</a>  <font color="#329900"><i> * 3. The end-user documentation included with the redistribution, if</font></i>
  <a name="22" href="#22">22</a>  <font color="#329900"><i> *    any, must include the following acknowlegement:  </font></i>
  <a name="23" href="#23">23</a>  <font color="#329900"><i> *       "This product includes software developed by the </font></i>
  <a name="24" href="#24">24</a>  <font color="#329900"><i> *        Apache Software Foundation (<a href="http://www.apache.org/" target="alexandria_uri">http://www.apache.org/</a>)."</font></i>
  <a name="25" href="#25">25</a>  <font color="#329900"><i> *    Alternately, this acknowlegement may appear in the software itself,</font></i>
  <a name="26" href="#26">26</a>  <font color="#329900"><i> *    if and wherever such third-party acknowlegements normally appear.</font></i>
  <a name="27" href="#27">27</a>  <font color="#329900"><i> *</font></i>
  <a name="28" href="#28">28</a>  <font color="#329900"><i> * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software</font></i>
  <a name="29" href="#29">29</a>  <font color="#329900"><i> *    Foundation" must not be used to endorse or promote products derived</font></i>
  <a name="30" href="#30">30</a>  <font color="#329900"><i> *    from this software without prior written permission. For written </font></i>
  <a name="31" href="#31">31</a>  <font color="#329900"><i> *    permission, please contact apache@apache.org.</font></i>
  <a name="32" href="#32">32</a>  <font color="#329900"><i> *</font></i>
  <a name="33" href="#33">33</a>  <font color="#329900"><i> * 5. Products derived from this software may not be called "Apache"</font></i>
  <a name="34" href="#34">34</a>  <font color="#329900"><i> *    nor may "Apache" appear in their names without prior written</font></i>
  <a name="35" href="#35">35</a>  <font color="#329900"><i> *    permission of the Apache Group.</font></i>
  <a name="36" href="#36">36</a>  <font color="#329900"><i> *</font></i>
  <a name="37" href="#37">37</a>  <font color="#329900"><i> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</font></i>
  <a name="38" href="#38">38</a>  <font color="#329900"><i> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</font></i>
  <a name="39" href="#39">39</a>  <font color="#329900"><i> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</font></i>
  <a name="40" href="#40">40</a>  <font color="#329900"><i> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR</font></i>
  <a name="41" href="#41">41</a>  <font color="#329900"><i> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</font></i>
  <a name="42" href="#42">42</a>  <font color="#329900"><i> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</font></i>
  <a name="43" href="#43">43</a>  <font color="#329900"><i> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</font></i>
  <a name="44" href="#44">44</a>  <font color="#329900"><i> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</font></i>
  <a name="45" href="#45">45</a>  <font color="#329900"><i> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</font></i>
  <a name="46" href="#46">46</a>  <font color="#329900"><i> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</font></i>
  <a name="47" href="#47">47</a>  <font color="#329900"><i> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</font></i>
  <a name="48" href="#48">48</a>  <font color="#329900"><i> * SUCH DAMAGE.</font></i>
  <a name="49" href="#49">49</a>  <font color="#329900"><i> * ====================================================================</font></i>
  <a name="50" href="#50">50</a>  <font color="#329900"><i> *</font></i>
  <a name="51" href="#51">51</a>  <font color="#329900"><i> * This software consists of voluntary contributions made by many</font></i>
  <a name="52" href="#52">52</a>  <font color="#329900"><i> * individuals on behalf of the Apache Software Foundation.  For more</font></i>
  <a name="53" href="#53">53</a>  <font color="#329900"><i> * information on the Apache Software Foundation, please see</font></i>
  <a name="54" href="#54">54</a>  <font color="#329900"><i> * &lt;<a href="http://www.apache.org/&gt" target="alexandria_uri">http://www.apache.org/&gt</a>;.</font></i>
  <a name="55" href="#55">55</a>  <font color="#329900"><i> *</font></i>
  <a name="56" href="#56">56</a>  <font color="#329900"><i> * [Additional notices, if required by prior licensing conditions]</font></i>
  <a name="57" href="#57">57</a>  <font color="#329900"><i> *</font></i>
  <a name="58" href="#58">58</a>  <font color="#329900"><i> */</font></i>   
  <a name="59" href="#59">59</a>  
  <a name="60" href="#60">60</a>  <b>package</b> <a href="../../../../../../org/apache/commons/latka/util/xml/index.html">org.apache.commons.latka.util.xml</a>;
  <a name="61" href="#61">61</a>  
  <a name="62" href="#62">62</a>  <b>import</b> org.xml.sax.Attributes;
  <a name="63" href="#63">63</a>  <b>import</b> org.xml.sax.ContentHandler;
  <a name="64" href="#64">64</a>  <b>import</b> org.xml.sax.SAXException;
  <a name="65" href="#65">65</a>  
  <a name="66" href="#66">66</a>  <b>public</b> <b>interface</b> <a href="../../../../../../org/apache/commons/latka/util/xml/DelegateHandler.html">DelegateHandler</a> <b>extends</b> ContentHandler {
  <a name="67" href="#67">67</a>      
  <a name="68" href="#68">68</a>    <b>public</b> <b>void</b> delegate(String namespaceURI, String localName, 
  <a name="69" href="#69">69</a>                           String rawName, Attributes atts) 
  <a name="70" href="#70">70</a>    throws SAXException;
  <a name="71" href="#71">71</a>    
  <a name="72" href="#72">72</a>    <b>public</b> <b>void</b> release();
  <a name="73" href="#73">73</a>    
  <a name="74" href="#74">74</a>  }
  </pre>
  <hr><center>This page automatically generated by Maven</center></body>
  </html>
  
  
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/xml/BasicDelegateHandler.html
  
  Index: BasicDelegateHandler.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <pre>
  <table bgcolor="#FFFFCC" cellpadding="0" cellspacing="0" border="0" width="100%"><a href="../../../../../../../../apidocs/org/apache/commons/latka/util/xml/BasicDelegateHandler.html">View Javadoc</a></table>
  <a name="1" href="#1">1</a>   
  <a name="2" href="#2">2</a>   <font color="#329900"><i>/*</font></i>
  <a name="3" href="#3">3</a>   <font color="#329900"><i> * ====================================================================</font></i>
  <a name="4" href="#4">4</a>   <font color="#329900"><i> *</font></i>
  <a name="5" href="#5">5</a>   <font color="#329900"><i> * The Apache Software License, Version 1.1</font></i>
  <a name="6" href="#6">6</a>   <font color="#329900"><i> *</font></i>
  <a name="7" href="#7">7</a>   <font color="#329900"><i> * Copyright (c) 1999 The Apache Software Foundation.  All rights </font></i>
  <a name="8" href="#8">8</a>   <font color="#329900"><i> * reserved.</font></i>
  <a name="9" href="#9">9</a>   <font color="#329900"><i> *</font></i>
  <a name="10" href="#10">10</a>  <font color="#329900"><i> * Redistribution and use in source and binary forms, with or without</font></i>
  <a name="11" href="#11">11</a>  <font color="#329900"><i> * modification, are permitted provided that the following conditions</font></i>
  <a name="12" href="#12">12</a>  <font color="#329900"><i> * are met:</font></i>
  <a name="13" href="#13">13</a>  <font color="#329900"><i> *</font></i>
  <a name="14" href="#14">14</a>  <font color="#329900"><i> * 1. Redistributions of source code must retain the above copyright</font></i>
  <a name="15" href="#15">15</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer. </font></i>
  <a name="16" href="#16">16</a>  <font color="#329900"><i> *</font></i>
  <a name="17" href="#17">17</a>  <font color="#329900"><i> * 2. Redistributions in binary form must reproduce the above copyright</font></i>
  <a name="18" href="#18">18</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer in</font></i>
  <a name="19" href="#19">19</a>  <font color="#329900"><i> *    the documentation and/or other materials provided with the</font></i>
  <a name="20" href="#20">20</a>  <font color="#329900"><i> *    distribution.</font></i>
  <a name="21" href="#21">21</a>  <font color="#329900"><i> *</font></i>
  <a name="22" href="#22">22</a>  <font color="#329900"><i> * 3. The end-user documentation included with the redistribution, if</font></i>
  <a name="23" href="#23">23</a>  <font color="#329900"><i> *    any, must include the following acknowlegement:  </font></i>
  <a name="24" href="#24">24</a>  <font color="#329900"><i> *       "This product includes software developed by the </font></i>
  <a name="25" href="#25">25</a>  <font color="#329900"><i> *        Apache Software Foundation (<a href="http://www.apache.org/" target="alexandria_uri">http://www.apache.org/</a>)."</font></i>
  <a name="26" href="#26">26</a>  <font color="#329900"><i> *    Alternately, this acknowlegement may appear in the software itself,</font></i>
  <a name="27" href="#27">27</a>  <font color="#329900"><i> *    if and wherever such third-party acknowlegements normally appear.</font></i>
  <a name="28" href="#28">28</a>  <font color="#329900"><i> *</font></i>
  <a name="29" href="#29">29</a>  <font color="#329900"><i> * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software</font></i>
  <a name="30" href="#30">30</a>  <font color="#329900"><i> *    Foundation" must not be used to endorse or promote products derived</font></i>
  <a name="31" href="#31">31</a>  <font color="#329900"><i> *    from this software without prior written permission. For written </font></i>
  <a name="32" href="#32">32</a>  <font color="#329900"><i> *    permission, please contact apache@apache.org.</font></i>
  <a name="33" href="#33">33</a>  <font color="#329900"><i> *</font></i>
  <a name="34" href="#34">34</a>  <font color="#329900"><i> * 5. Products derived from this software may not be called "Apache"</font></i>
  <a name="35" href="#35">35</a>  <font color="#329900"><i> *    nor may "Apache" appear in their names without prior written</font></i>
  <a name="36" href="#36">36</a>  <font color="#329900"><i> *    permission of the Apache Group.</font></i>
  <a name="37" href="#37">37</a>  <font color="#329900"><i> *</font></i>
  <a name="38" href="#38">38</a>  <font color="#329900"><i> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</font></i>
  <a name="39" href="#39">39</a>  <font color="#329900"><i> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</font></i>
  <a name="40" href="#40">40</a>  <font color="#329900"><i> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</font></i>
  <a name="41" href="#41">41</a>  <font color="#329900"><i> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR</font></i>
  <a name="42" href="#42">42</a>  <font color="#329900"><i> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</font></i>
  <a name="43" href="#43">43</a>  <font color="#329900"><i> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</font></i>
  <a name="44" href="#44">44</a>  <font color="#329900"><i> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</font></i>
  <a name="45" href="#45">45</a>  <font color="#329900"><i> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</font></i>
  <a name="46" href="#46">46</a>  <font color="#329900"><i> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</font></i>
  <a name="47" href="#47">47</a>  <font color="#329900"><i> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</font></i>
  <a name="48" href="#48">48</a>  <font color="#329900"><i> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</font></i>
  <a name="49" href="#49">49</a>  <font color="#329900"><i> * SUCH DAMAGE.</font></i>
  <a name="50" href="#50">50</a>  <font color="#329900"><i> * ====================================================================</font></i>
  <a name="51" href="#51">51</a>  <font color="#329900"><i> *</font></i>
  <a name="52" href="#52">52</a>  <font color="#329900"><i> * This software consists of voluntary contributions made by many</font></i>
  <a name="53" href="#53">53</a>  <font color="#329900"><i> * individuals on behalf of the Apache Software Foundation.  For more</font></i>
  <a name="54" href="#54">54</a>  <font color="#329900"><i> * information on the Apache Software Foundation, please see</font></i>
  <a name="55" href="#55">55</a>  <font color="#329900"><i> * &lt;<a href="http://www.apache.org/&gt" target="alexandria_uri">http://www.apache.org/&gt</a>;.</font></i>
  <a name="56" href="#56">56</a>  <font color="#329900"><i> *</font></i>
  <a name="57" href="#57">57</a>  <font color="#329900"><i> * [Additional notices, if required by prior licensing conditions]</font></i>
  <a name="58" href="#58">58</a>  <font color="#329900"><i> *</font></i>
  <a name="59" href="#59">59</a>  <font color="#329900"><i> */</font></i>   
  <a name="60" href="#60">60</a>  
  <a name="61" href="#61">61</a>  <b>package</b> <a href="../../../../../../org/apache/commons/latka/util/xml/index.html">org.apache.commons.latka.util.xml</a>;
  <a name="62" href="#62">62</a>  
  <a name="63" href="#63">63</a>  <b>import</b> org.apache.log4j.Category;
  <a name="64" href="#64">64</a>  
  <a name="65" href="#65">65</a>  
  <a name="66" href="#66">66</a>  <b>import</b> org.xml.sax.Attributes;
  <a name="67" href="#67">67</a>  <b>import</b> org.xml.sax.SAXException;
  <a name="68" href="#68">68</a>  <b>import</b> org.xml.sax.ContentHandler;
  <a name="69" href="#69">69</a>  <b>import</b> org.xml.sax.XMLReader;
  <a name="70" href="#70">70</a>  <b>import</b> org.xml.sax.helpers.DefaultHandler;
  <a name="71" href="#71">71</a>  
  <a name="72" href="#72">72</a>  <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="73" href="#73">73</a>  <font color="#AA0000"><i> * Typically, you will want to use DelegateHandlerImpl as your base class, not</font></i>
  <a name="74" href="#74">74</a>  <font color="#AA0000"><i> * this one.  BasicDelegateHandler</font></i>
  <a name="75" href="#75">75</a>  <font color="#AA0000"><i> * is a good base class for delegate handlers produced by factories and/or</font></i>
  <a name="76" href="#76">76</a>  <font color="#AA0000"><i> * reflection.</font></i>
  <a name="77" href="#77">77</a>  <font color="#AA0000"><i> */</font></i>
  <a name="78" href="#78">78</a>  <b>public</b> <b>abstract</b> <b>class</b> <a href="../../../../../../org/apache/commons/latka/util/xml/BasicDelegateHandler.html">BasicDelegateHandler</a> <b>extends</b> DefaultHandler 
  <a name="79" href="#79">79</a>  implements <a href="../../../../../../org/apache/commons/latka/util/xml/DelegateHandler.html">DelegateHandler</a> {
  <a name="80" href="#80">80</a>  
  <a name="81" href="#81">81</a>    <b>protected</b> ContentHandler _handler = <b>null</b>;
  <a name="82" href="#82">82</a>    <b>protected</b> XMLReader _reader = <b>null</b>;
  <a name="83" href="#83">83</a>  
  <a name="84" href="#84">84</a>    <font color="#329900"><i>//debug</font></i>
  <a name="85" href="#85">85</a>    <b>private</b> String _delegatorClassName = <b>null</b>;
  <a name="86" href="#86">86</a>    <b>private</b> String _delegateClassName = <b>null</b>;
  <a name="87" href="#87">87</a>  
  <a name="88" href="#88">88</a>    <b>protected</b> <b>static</b> <b>final</b> Category log = Category.getInstance(BasicDelegateHandler.<b>class</b>);
  <a name="89" href="#89">89</a>  
  <a name="90" href="#90">90</a>    <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="91" href="#91">91</a>  <font color="#AA0000"><i>   * Create a DelegateHandler that releases to the</font></i>
  <a name="92" href="#92">92</a>  <font color="#AA0000"><i>   * current ContentHandler of the specified XMLReader</font></i>
  <a name="93" href="#93">93</a>  <font color="#AA0000"><i>   * </font></i>
  <a name="94" href="#94">94</a>  <font color="#AA0000"><i>   * @param reader XMLReader that will do the parsing</font></i>
  <a name="95" href="#95">95</a>  <font color="#AA0000"><i>   */</font></i>
  <a name="96" href="#96">96</a>    <b>protected</b> <b>void</b> init(XMLReader reader) {
  <a name="97" href="#97">97</a>      init(reader,reader.getContentHandler());
  <a name="98" href="#98">98</a>    }
  <a name="99" href="#99">99</a>  
  <a name="100" href="#100">100</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="101" href="#101">101</a> <font color="#AA0000"><i>   * Create a DelegateHandler that releases to a</font></i>
  <a name="102" href="#102">102</a> <font color="#AA0000"><i>   * specific ContentHandler</font></i>
  <a name="103" href="#103">103</a> <font color="#AA0000"><i>   * </font></i>
  <a name="104" href="#104">104</a> <font color="#AA0000"><i>   * @param reader  XMLReader that will do the parsing</font></i>
  <a name="105" href="#105">105</a> <font color="#AA0000"><i>   *                </font></i>
  <a name="106" href="#106">106</a> <font color="#AA0000"><i>   * @param handler Handler that will resume parsing once release has been</font></i>
  <a name="107" href="#107">107</a> <font color="#AA0000"><i>   *                called</font></i>
  <a name="108" href="#108">108</a> <font color="#AA0000"><i>   */</font></i>
  <a name="109" href="#109">109</a>   <b>protected</b> <b>void</b> init(XMLReader reader, ContentHandler handler) {
  <a name="110" href="#110">110</a>     _reader  = reader;
  <a name="111" href="#111">111</a>     _handler = handler;
  <a name="112" href="#112">112</a>   }
  <a name="113" href="#113">113</a> 
  <a name="114" href="#114">114</a>   <b>public</b> <b>void</b> delegate(String namespaceURI, String localName, 
  <a name="115" href="#115">115</a>                        String rawName, Attributes atts)  
  <a name="116" href="#116">116</a>   throws SAXException {
  <a name="117" href="#117">117</a> 
  <a name="118" href="#118">118</a>     <font color="#329900"><i>// it's important to delegate immediately, in case the following</font></i>
  <a name="119" href="#119">119</a>     <font color="#329900"><i>// method call releases on the first element</font></i>
  <a name="120" href="#120">120</a>     delegate();
  <a name="121" href="#121">121</a> 
  <a name="122" href="#122">122</a>     <font color="#329900"><i>//log.info("broadcasting first event to delegate: " + _handler);</font></i>
  <a name="123" href="#123">123</a>     startElement(namespaceURI,localName,rawName,atts);
  <a name="124" href="#124">124</a>   }
  <a name="125" href="#125">125</a>   
  <a name="126" href="#126">126</a>   <b>protected</b> <b>void</b> delegate() {
  <a name="127" href="#127">127</a>     <font color="#329900"><i>//debug</font></i>
  <a name="128" href="#128">128</a>     <b>if</b> (log.isDebugEnabled()) {
  <a name="129" href="#129">129</a>       _delegatorClassName = _handler.getClass().getName();
  <a name="130" href="#130">130</a>       _delegateClassName  = <b>this</b>.getClass().getName();
  <a name="131" href="#131">131</a>       log.debug(<font color="#000099">"beginning delegation"</font>);
  <a name="132" href="#132">132</a>       log.debug(<font color="#000099">"delegating from "</font> + _delegatorClassName + <font color="#000099">" to "</font> + _delegateClassName);
  <a name="133" href="#133">133</a>     }
  <a name="134" href="#134">134</a>     
  <a name="135" href="#135">135</a>     _reader.setContentHandler(<b>this</b>);
  <a name="136" href="#136">136</a>   }
  <a name="137" href="#137">137</a> 
  <a name="138" href="#138">138</a>   <b>public</b> <b>void</b> release() {
  <a name="139" href="#139">139</a>     <b>if</b> (log.isDebugEnabled()) {
  <a name="140" href="#140">140</a>       log.debug(<font color="#000099">"releasing from "</font> + _delegateClassName  + <font color="#000099">" to "</font> + _delegatorClassName);
  <a name="141" href="#141">141</a>     }
  <a name="142" href="#142">142</a> 
  <a name="143" href="#143">143</a>     _reader.setContentHandler(_handler);
  <a name="144" href="#144">144</a>   }
  <a name="145" href="#145">145</a> 
  <a name="146" href="#146">146</a>   <b>protected</b> <b>void</b> release(String namespaceURI, String localName,
  <a name="147" href="#147">147</a>                          String rawName, Attributes atts) 
  <a name="148" href="#148">148</a>   throws SAXException {
  <a name="149" href="#149">149</a>     log.debug(<font color="#000099">"begin tag release"</font>);
  <a name="150" href="#150">150</a>     release();
  <a name="151" href="#151">151</a>     _handler.startElement(namespaceURI,localName,rawName,atts);
  <a name="152" href="#152">152</a>   }
  <a name="153" href="#153">153</a> 
  <a name="154" href="#154">154</a>   <b>protected</b> <b>void</b> release(String namespaceURI, String localName, 
  <a name="155" href="#155">155</a>                          String rawName) 
  <a name="156" href="#156">156</a>   throws SAXException {
  <a name="157" href="#157">157</a>     <font color="#329900"><i>//log.debug("end tag release");</font></i>
  <a name="158" href="#158">158</a>     release();
  <a name="159" href="#159">159</a>     _handler.endElement(namespaceURI,localName,rawName);
  <a name="160" href="#160">160</a>   }
  <a name="161" href="#161">161</a> 
  <a name="162" href="#162">162</a> }
  </pre>
  <hr><center>This page automatically generated by Maven</center></body>
  </html>
  
  
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/folder.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/file.gif
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/URLParser.html
  
  Index: URLParser.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <pre>
  <table bgcolor="#FFFFCC" cellpadding="0" cellspacing="0" border="0" width="100%"><a href="../../../../../../../apidocs/org/apache/commons/latka/util/URLParser.html">View Javadoc</a></table>
  <a name="1" href="#1">1</a>   <font color="#329900"><i>/*</font></i>
  <a name="2" href="#2">2</a>   <font color="#329900"><i> * ====================================================================</font></i>
  <a name="3" href="#3">3</a>   <font color="#329900"><i> *</font></i>
  <a name="4" href="#4">4</a>   <font color="#329900"><i> * The Apache Software License, Version 1.1</font></i>
  <a name="5" href="#5">5</a>   <font color="#329900"><i> *</font></i>
  <a name="6" href="#6">6</a>   <font color="#329900"><i> * Copyright (c) 1999 The Apache Software Foundation.  All rights </font></i>
  <a name="7" href="#7">7</a>   <font color="#329900"><i> * reserved.</font></i>
  <a name="8" href="#8">8</a>   <font color="#329900"><i> *</font></i>
  <a name="9" href="#9">9</a>   <font color="#329900"><i> * Redistribution and use in source and binary forms, with or without</font></i>
  <a name="10" href="#10">10</a>  <font color="#329900"><i> * modification, are permitted provided that the following conditions</font></i>
  <a name="11" href="#11">11</a>  <font color="#329900"><i> * are met:</font></i>
  <a name="12" href="#12">12</a>  <font color="#329900"><i> *</font></i>
  <a name="13" href="#13">13</a>  <font color="#329900"><i> * 1. Redistributions of source code must retain the above copyright</font></i>
  <a name="14" href="#14">14</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer. </font></i>
  <a name="15" href="#15">15</a>  <font color="#329900"><i> *</font></i>
  <a name="16" href="#16">16</a>  <font color="#329900"><i> * 2. Redistributions in binary form must reproduce the above copyright</font></i>
  <a name="17" href="#17">17</a>  <font color="#329900"><i> *    notice, this list of conditions and the following disclaimer in</font></i>
  <a name="18" href="#18">18</a>  <font color="#329900"><i> *    the documentation and/or other materials provided with the</font></i>
  <a name="19" href="#19">19</a>  <font color="#329900"><i> *    distribution.</font></i>
  <a name="20" href="#20">20</a>  <font color="#329900"><i> *</font></i>
  <a name="21" href="#21">21</a>  <font color="#329900"><i> * 3. The end-user documentation included with the redistribution, if</font></i>
  <a name="22" href="#22">22</a>  <font color="#329900"><i> *    any, must include the following acknowlegement:  </font></i>
  <a name="23" href="#23">23</a>  <font color="#329900"><i> *       "This product includes software developed by the </font></i>
  <a name="24" href="#24">24</a>  <font color="#329900"><i> *        Apache Software Foundation (<a href="http://www.apache.org/" target="alexandria_uri">http://www.apache.org/</a>)."</font></i>
  <a name="25" href="#25">25</a>  <font color="#329900"><i> *    Alternately, this acknowlegement may appear in the software itself,</font></i>
  <a name="26" href="#26">26</a>  <font color="#329900"><i> *    if and wherever such third-party acknowlegements normally appear.</font></i>
  <a name="27" href="#27">27</a>  <font color="#329900"><i> *</font></i>
  <a name="28" href="#28">28</a>  <font color="#329900"><i> * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software</font></i>
  <a name="29" href="#29">29</a>  <font color="#329900"><i> *    Foundation" must not be used to endorse or promote products derived</font></i>
  <a name="30" href="#30">30</a>  <font color="#329900"><i> *    from this software without prior written permission. For written </font></i>
  <a name="31" href="#31">31</a>  <font color="#329900"><i> *    permission, please contact apache@apache.org.</font></i>
  <a name="32" href="#32">32</a>  <font color="#329900"><i> *</font></i>
  <a name="33" href="#33">33</a>  <font color="#329900"><i> * 5. Products derived from this software may not be called "Apache"</font></i>
  <a name="34" href="#34">34</a>  <font color="#329900"><i> *    nor may "Apache" appear in their names without prior written</font></i>
  <a name="35" href="#35">35</a>  <font color="#329900"><i> *    permission of the Apache Group.</font></i>
  <a name="36" href="#36">36</a>  <font color="#329900"><i> *</font></i>
  <a name="37" href="#37">37</a>  <font color="#329900"><i> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</font></i>
  <a name="38" href="#38">38</a>  <font color="#329900"><i> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</font></i>
  <a name="39" href="#39">39</a>  <font color="#329900"><i> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</font></i>
  <a name="40" href="#40">40</a>  <font color="#329900"><i> * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR</font></i>
  <a name="41" href="#41">41</a>  <font color="#329900"><i> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</font></i>
  <a name="42" href="#42">42</a>  <font color="#329900"><i> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</font></i>
  <a name="43" href="#43">43</a>  <font color="#329900"><i> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</font></i>
  <a name="44" href="#44">44</a>  <font color="#329900"><i> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</font></i>
  <a name="45" href="#45">45</a>  <font color="#329900"><i> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</font></i>
  <a name="46" href="#46">46</a>  <font color="#329900"><i> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</font></i>
  <a name="47" href="#47">47</a>  <font color="#329900"><i> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</font></i>
  <a name="48" href="#48">48</a>  <font color="#329900"><i> * SUCH DAMAGE.</font></i>
  <a name="49" href="#49">49</a>  <font color="#329900"><i> * ====================================================================</font></i>
  <a name="50" href="#50">50</a>  <font color="#329900"><i> *</font></i>
  <a name="51" href="#51">51</a>  <font color="#329900"><i> * This software consists of voluntary contributions made by many</font></i>
  <a name="52" href="#52">52</a>  <font color="#329900"><i> * individuals on behalf of the Apache Software Foundation.  For more</font></i>
  <a name="53" href="#53">53</a>  <font color="#329900"><i> * information on the Apache Software Foundation, please see</font></i>
  <a name="54" href="#54">54</a>  <font color="#329900"><i> * &lt;<a href="http://www.apache.org/&gt" target="alexandria_uri">http://www.apache.org/&gt</a>;.</font></i>
  <a name="55" href="#55">55</a>  <font color="#329900"><i> *</font></i>
  <a name="56" href="#56">56</a>  <font color="#329900"><i> * [Additional notices, if required by prior licensing conditions]</font></i>
  <a name="57" href="#57">57</a>  <font color="#329900"><i> *</font></i>
  <a name="58" href="#58">58</a>  <font color="#329900"><i> */</font></i>   
  <a name="59" href="#59">59</a>  
  <a name="60" href="#60">60</a>  <b>package</b> <a href="../../../../../org/apache/commons/latka/util/index.html">org.apache.commons.latka.util</a>;
  <a name="61" href="#61">61</a>  
  <a name="62" href="#62">62</a>  <b>import</b> java.util.Map;
  <a name="63" href="#63">63</a>  <b>import</b> java.util.Vector;
  <a name="64" href="#64">64</a>  <b>import</b> java.util.Iterator;
  <a name="65" href="#65">65</a>  <b>import</b> java.util.Hashtable;
  <a name="66" href="#66">66</a>  <b>import</b> java.util.Collection;
  <a name="67" href="#67">67</a>  
  <a name="68" href="#68">68</a>  <b>import</b> java.io.Reader;
  <a name="69" href="#69">69</a>  <b>import</b> java.io.InputStream;
  <a name="70" href="#70">70</a>  <b>import</b> java.io.FileInputStream;
  <a name="71" href="#71">71</a>  <b>import</b> java.io.FileNotFoundException;
  <a name="72" href="#72">72</a>  
  <a name="73" href="#73">73</a>  <b>import</b> java.net.URL;
  <a name="74" href="#74">74</a>  <b>import</b> java.net.MalformedURLException;
  <a name="75" href="#75">75</a>  
  <a name="76" href="#76">76</a>  <b>import</b> org.apache.regexp.RE;
  <a name="77" href="#77">77</a>  <b>import</b> org.apache.regexp.REProgram;
  <a name="78" href="#78">78</a>  <b>import</b> org.apache.regexp.RECompiler;
  <a name="79" href="#79">79</a>  <b>import</b> org.apache.regexp.RESyntaxException;
  <a name="80" href="#80">80</a>  <b>import</b> org.apache.regexp.CharacterIterator;
  <a name="81" href="#81">81</a>  <b>import</b> org.apache.regexp.StringCharacterIterator;
  <a name="82" href="#82">82</a>  <b>import</b> org.apache.regexp.StreamCharacterIterator;
  <a name="83" href="#83">83</a>  <b>import</b> org.apache.regexp.ReaderCharacterIterator;
  <a name="84" href="#84">84</a>  
  <a name="85" href="#85">85</a>  
  <a name="86" href="#86">86</a>  <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="87" href="#87">87</a>  <font color="#AA0000"><i> * The URLParser utility class uses the org.apache.regexp package</font></i>
  <a name="88" href="#88">88</a>  <font color="#AA0000"><i> * to extract URL's from an HTML document.</font></i>
  <a name="89" href="#89">89</a>  <font color="#AA0000"><i> *</font></i>
  <a name="90" href="#90">90</a>  <font color="#AA0000"><i> * @author &lt;a href="<a href="mailto:" target="alexandria_uri">mailto:</a> dsale@us.britannica.com"&gt;Doug Sale&lt;/a&gt;</font></i>
  <a name="91" href="#91">91</a>  <font color="#AA0000"><i> */</font></i>
  <a name="92" href="#92">92</a>  
  <a name="93" href="#93">93</a>  <b>public</b> <b>class</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a> {
  <a name="94" href="#94">94</a>  
  <a name="95" href="#95">95</a>    <font color="#329900"><i>/////////////////////</font></i>
  <a name="96" href="#96">96</a>    <font color="#329900"><i>// CLASS VARIABLES //</font></i>
  <a name="97" href="#97">97</a>    <font color="#329900"><i>/////////////////////</font></i>
  <a name="98" href="#98">98</a>  
  <a name="99" href="#99">99</a>    <font color="#329900"><i>// Parse Flags //</font></i>
  <a name="100" href="#100">100</a> 
  <a name="101" href="#101">101</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the ANCHOR_PATTERN */</font></i></font></i>
  <a name="102" href="#102">102</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_ANCHORS =   1;
  <a name="103" href="#103">103</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the FRAME_PATTERN */</font></i></font></i>
  <a name="104" href="#104">104</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_FRAMES  =   2;
  <a name="105" href="#105">105</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the IMAGE_PATTERN */</font></i></font></i>
  <a name="106" href="#106">106</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_IMAGES  =   4;
  <a name="107" href="#107">107</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the LAYER_PATTERN */</font></i></font></i>
  <a name="108" href="#108">108</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_LAYERS  =   8;
  <a name="109" href="#109">109</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the LINK_PATTERN */</font></i></font></i>
  <a name="110" href="#110">110</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_LINKS   =  16;
  <a name="111" href="#111">111</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the OBJECT_PATTERN */</font></i></font></i>
  <a name="112" href="#112">112</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_OBJECTS =  32;
  <a name="113" href="#113">113</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using the SCRIPT_PATTERN */</font></i></font></i>
  <a name="114" href="#114">114</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_SCRIPTS =  64;
  <a name="115" href="#115">115</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Flag indicating to parse using all patterns */</font></i></font></i>
  <a name="116" href="#116">116</a>   <b>public</b> <b>static</b> <b>final</b> <b>int</b> PARSE_ALL     =  Integer.MAX_VALUE; 
  <a name="117" href="#117">117</a> 
  <a name="118" href="#118">118</a>   <font color="#329900"><i>// Parse Patterns //</font></i>
  <a name="119" href="#119">119</a> 
  <a name="120" href="#120">120</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;HREF&lt;/code&gt; attribute of the HTML &lt;code&gt;A&lt;/code&gt; element. */</font></i></font></i>
  <a name="121" href="#121">121</a>   <b>public</b> <b>static</b> <b>final</b> String ANCHOR_PATTERN =
  <a name="122" href="#122">122</a>     <font color="#000099">"&lt;A&#47;&#47;s+[^&gt;]*?HREF&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^#\'\&quot;&gt;&#47;&#47;s]+)[^\'\&quot;&gt;&#47;&#47;s]*&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="123" href="#123">123</a> 
  <a name="124" href="#124">124</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;SRC&lt;/code&gt; attribute of the HTML &lt;code&gt;FRAME&lt;/code&gt; element. */</font></i></font></i>
  <a name="125" href="#125">125</a>   <b>public</b> <b>static</b> <b>final</b> String FRAME_PATTERN  =
  <a name="126" href="#126">126</a>     <font color="#000099">"&lt;FRAME&#47;&#47;s+[^&gt;]*?SRC&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="127" href="#127">127</a> 
  <a name="128" href="#128">128</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;SRC&lt;/code&gt; attribute of the HTML &lt;code&gt;IMG&lt;/code&gt; element. */</font></i></font></i>
  <a name="129" href="#129">129</a>   <b>public</b> <b>static</b> <b>final</b> String IMAGE_PATTERN  =
  <a name="130" href="#130">130</a>     <font color="#000099">"&lt;IMG&#47;&#47;s+[^&gt;]*?SRC&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="131" href="#131">131</a> 
  <a name="132" href="#132">132</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;SRC&lt;/code&gt; attribute of the HTML &lt;code&gt;LAYER&lt;/code&gt; element. */</font></i></font></i>
  <a name="133" href="#133">133</a>   <b>public</b> <b>static</b> <b>final</b> String LAYER_PATTERN  =
  <a name="134" href="#134">134</a>     <font color="#000099">"&lt;LAYER&#47;&#47;s+[^&gt;]*?SRC&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="135" href="#135">135</a> 
  <a name="136" href="#136">136</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;HREF&lt;/code&gt; attribute of the HTML &lt;code&gt;LINK&lt;/code&gt; element. */</font></i></font></i>
  <a name="137" href="#137">137</a>   <b>public</b> <b>static</b> <b>final</b> String LINK_PATTERN   =
  <a name="138" href="#138">138</a>     <font color="#000099">"&lt;LINK&#47;&#47;s+[^&gt;]*?HREF&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="139" href="#139">139</a> 
  <a name="140" href="#140">140</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;SRC&lt;/code&gt; attribute of the HTML &lt;code&gt;OBJECT&lt;/code&gt; element. */</font></i></font></i>
  <a name="141" href="#141">141</a>   <b>public</b> <b>static</b> <b>final</b> String OBJECT_PATTERN =
  <a name="142" href="#142">142</a>     <font color="#000099">"&lt;OBJECT&#47;&#47;s+[^&gt;]*?SRC&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="143" href="#143">143</a> 
  <a name="144" href="#144">144</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>* Extracts the URL from the &lt;code&gt;SRC&lt;/code&gt; attribute of the HTML &lt;code&gt;SCRIPT&lt;/code&gt; element. */</font></i></font></i>
  <a name="145" href="#145">145</a>   <b>public</b> <b>static</b> <b>final</b> String SCRIPT_PATTERN =
  <a name="146" href="#146">146</a>     <font color="#000099">"&lt;SCRIPT&#47;&#47;s+[^&gt;]*?SRC&#47;&#47;s*=&#47;&#47;s*([\&quot;\']?)([^\'\&quot;&gt;&#47;&#47;s]*)&#47;&#47;1[^&gt;]*&gt;"</font>;
  <a name="147" href="#147">147</a> 
  <a name="148" href="#148">148</a>   <font color="#329900"><i>// pattern and program containers</font></i>
  <a name="149" href="#149">149</a>   <b>protected</b> <b>static</b> Map _patterns;
  <a name="150" href="#150">150</a>   <b>protected</b> <b>static</b> Map _programs;
  <a name="151" href="#151">151</a> 
  <a name="152" href="#152">152</a>   <b>protected</b> <b>static</b> <b>int</b>   _numPatterns = 7;
  <a name="153" href="#153">153</a>   <b>protected</b> <b>static</b> <b>float</b> _loadFactor  = 0.75f;
  <a name="154" href="#154">154</a> 
  <a name="155" href="#155">155</a>   <font color="#329900"><i>///////////////////////</font></i>
  <a name="156" href="#156">156</a>   <font color="#329900"><i>// CLASS INITIALIZER //</font></i>
  <a name="157" href="#157">157</a>   <font color="#329900"><i>///////////////////////</font></i>
  <a name="158" href="#158">158</a> 
  <a name="159" href="#159">159</a>   <b>static</b> {
  <a name="160" href="#160">160</a>     <font color="#329900"><i>// ensure that '_patterns' capacity doesn't have to increase on class initialization</font></i>
  <a name="161" href="#161">161</a>     _patterns = <b>new</b> Hashtable((<b>int</b>)(_numPatterns/_loadFactor) + 1, _loadFactor);
  <a name="162" href="#162">162</a>     _programs = <b>new</b> Hashtable((<b>int</b>)(_numPatterns/_loadFactor) + 1, _loadFactor);
  <a name="163" href="#163">163</a> 
  <a name="164" href="#164">164</a>     _patterns.put(<b>new</b> Integer(PARSE_ANCHORS), ANCHOR_PATTERN);
  <a name="165" href="#165">165</a>     _patterns.put(<b>new</b> Integer(PARSE_FRAMES), FRAME_PATTERN);
  <a name="166" href="#166">166</a>     _patterns.put(<b>new</b> Integer(PARSE_IMAGES), IMAGE_PATTERN);
  <a name="167" href="#167">167</a>     _patterns.put(<b>new</b> Integer(PARSE_LAYERS), LAYER_PATTERN);
  <a name="168" href="#168">168</a>     _patterns.put(<b>new</b> Integer(PARSE_LINKS), LINK_PATTERN);
  <a name="169" href="#169">169</a>     _patterns.put(<b>new</b> Integer(PARSE_OBJECTS), OBJECT_PATTERN);
  <a name="170" href="#170">170</a>     _patterns.put(<b>new</b> Integer(PARSE_SCRIPTS), SCRIPT_PATTERN);
  <a name="171" href="#171">171</a>   }
  <a name="172" href="#172">172</a> 
  <a name="173" href="#173">173</a>   <font color="#329900"><i>////////////////////////</font></i>
  <a name="174" href="#174">174</a>   <font color="#329900"><i>// INSTANCE VARIABLES //</font></i>
  <a name="175" href="#175">175</a>   <font color="#329900"><i>////////////////////////</font></i>
  <a name="176" href="#176">176</a> 
  <a name="177" href="#177">177</a>   <b>protected</b> RECompiler _compiler;
  <a name="178" href="#178">178</a>   <b>protected</b> RE         _engine;
  <a name="179" href="#179">179</a> 
  <a name="180" href="#180">180</a>   <b>protected</b> <b>int</b> _parseFlag;
  <a name="181" href="#181">181</a>   <b>protected</b> URL _baseURL;
  <a name="182" href="#182">182</a>   <b>protected</b> <b>boolean</b> _includeMalformedURLs;
  <a name="183" href="#183">183</a>   <b>protected</b> Collection _malformedURLs;
  <a name="184" href="#184">184</a> 
  <a name="185" href="#185">185</a>   <font color="#329900"><i>//////////////////</font></i>
  <a name="186" href="#186">186</a>   <font color="#329900"><i>// CONSTRUCTORS //</font></i>
  <a name="187" href="#187">187</a>   <font color="#329900"><i>//////////////////</font></i>
  <a name="188" href="#188">188</a> 
  <a name="189" href="#189">189</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="190" href="#190">190</a> <font color="#AA0000"><i>   * Creates a URLParser instance that includes malformed URL's,</font></i>
  <a name="191" href="#191">191</a> <font color="#AA0000"><i>   * parses all element types, and does not resolve relative URL's.</font></i>
  <a name="192" href="#192">192</a> <font color="#AA0000"><i>   */</font></i>
  <a name="193" href="#193">193</a>   <b>public</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>() {
  <a name="194" href="#194">194</a>     <b>this</b>(URLParser.PARSE_ALL, <b>null</b>, <b>true</b>);
  <a name="195" href="#195">195</a>   }
  <a name="196" href="#196">196</a> 
  <a name="197" href="#197">197</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="198" href="#198">198</a> <font color="#AA0000"><i>   * Creates a URLParser instance that includes malformed URL's,</font></i>
  <a name="199" href="#199">199</a> <font color="#AA0000"><i>   * parses &lt;code&gt;parseFlag&lt;/code&gt; element types,</font></i>
  <a name="200" href="#200">200</a> <font color="#AA0000"><i>   * and does not resolve relative URL's.</font></i>
  <a name="201" href="#201">201</a> <font color="#AA0000"><i>   */</font></i>
  <a name="202" href="#202">202</a>   <b>public</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>(<b>int</b> parseFlag) {
  <a name="203" href="#203">203</a>     <b>this</b>(parseFlag, <b>null</b>, false);
  <a name="204" href="#204">204</a>   }
  <a name="205" href="#205">205</a> 
  <a name="206" href="#206">206</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="207" href="#207">207</a> <font color="#AA0000"><i>   * Creates a URLParser instance that treats malformed URL's</font></i>
  <a name="208" href="#208">208</a> <font color="#AA0000"><i>   * according to &lt;code&gt;includeMalformedURLs&lt;/code&gt;,</font></i>
  <a name="209" href="#209">209</a> <font color="#AA0000"><i>   * parses all element types, and resolves relative URL's</font></i>
  <a name="210" href="#210">210</a> <font color="#AA0000"><i>   * according to &lt;code&gt;baseURL&lt;/code&gt;.</font></i>
  <a name="211" href="#211">211</a> <font color="#AA0000"><i>   */</font></i>
  <a name="212" href="#212">212</a>   <b>public</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>(URL baseURL, <b>boolean</b> includeMalformedURLs) {
  <a name="213" href="#213">213</a>     <b>this</b>(URLParser.PARSE_ALL, baseURL, includeMalformedURLs);
  <a name="214" href="#214">214</a>   }
  <a name="215" href="#215">215</a> 
  <a name="216" href="#216">216</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="217" href="#217">217</a> <font color="#AA0000"><i>   * Creates a URLParser instance that treats malformed URL's</font></i>
  <a name="218" href="#218">218</a> <font color="#AA0000"><i>   * according to &lt;code&gt;includeMalformedURLs&lt;/code&gt;,</font></i>
  <a name="219" href="#219">219</a> <font color="#AA0000"><i>   * parses element types according to &lt;code&gt;parseFlag&lt;/code&gt;,</font></i>
  <a name="220" href="#220">220</a> <font color="#AA0000"><i>   * and resolves relative URL's according to &lt;code&gt;baseURL&lt;/code&gt;.</font></i>
  <a name="221" href="#221">221</a> <font color="#AA0000"><i>   */</font></i>
  <a name="222" href="#222">222</a>   <b>public</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>(<b>int</b> parseFlag, URL baseURL, <b>boolean</b> includeMalformedURLs) {
  <a name="223" href="#223">223</a>     _parseFlag = parseFlag;
  <a name="224" href="#224">224</a>     _baseURL = baseURL;
  <a name="225" href="#225">225</a>     _includeMalformedURLs = includeMalformedURLs;
  <a name="226" href="#226">226</a> 
  <a name="227" href="#227">227</a>     _engine = <b>new</b> RE();
  <a name="228" href="#228">228</a>     _engine.setMatchFlags(RE.MATCH_CASEINDEPENDENT);
  <a name="229" href="#229">229</a> 
  <a name="230" href="#230">230</a>     _compiler = <b>new</b> RECompiler();
  <a name="231" href="#231">231</a>   }
  <a name="232" href="#232">232</a> 
  <a name="233" href="#233">233</a>   <font color="#329900"><i>//////////////////////</font></i>
  <a name="234" href="#234">234</a>   <font color="#329900"><i>// INSTANCE METHODS //</font></i>
  <a name="235" href="#235">235</a>   <font color="#329900"><i>//////////////////////</font></i>
  <a name="236" href="#236">236</a> 
  <a name="237" href="#237">237</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="238" href="#238">238</a> <font color="#AA0000"><i>   * Set a new parse flag.</font></i>
  <a name="239" href="#239">239</a> <font color="#AA0000"><i>   *</font></i>
  <a name="240" href="#240">240</a> <font color="#AA0000"><i>   * @param parseFlag new parse flag</font></i>
  <a name="241" href="#241">241</a> <font color="#AA0000"><i>   */</font></i>
  <a name="242" href="#242">242</a>   <b>public</b> <b>void</b> setParseFlag(<b>int</b> parseFlag) {
  <a name="243" href="#243">243</a>     _parseFlag = parseFlag;
  <a name="244" href="#244">244</a>   } 
  <a name="245" href="#245">245</a> 
  <a name="246" href="#246">246</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="247" href="#247">247</a> <font color="#AA0000"><i>   * Returns the current parse flag.</font></i>
  <a name="248" href="#248">248</a> <font color="#AA0000"><i>   *</font></i>
  <a name="249" href="#249">249</a> <font color="#AA0000"><i>   * @return the current parse flag</font></i>
  <a name="250" href="#250">250</a> <font color="#AA0000"><i>   */</font></i>
  <a name="251" href="#251">251</a>   <b>public</b> <b>int</b> getParseFlag() {
  <a name="252" href="#252">252</a>     <b>return</b> _parseFlag;
  <a name="253" href="#253">253</a>   } 
  <a name="254" href="#254">254</a> 
  <a name="255" href="#255">255</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="256" href="#256">256</a> <font color="#AA0000"><i>   * Add a new parse flag to the existing parse flag.</font></i>
  <a name="257" href="#257">257</a> <font color="#AA0000"><i>   *</font></i>
  <a name="258" href="#258">258</a> <font color="#AA0000"><i>   * @param parseFlag parse flag to be added</font></i>
  <a name="259" href="#259">259</a> <font color="#AA0000"><i>   */</font></i>
  <a name="260" href="#260">260</a>   <b>public</b> <b>void</b> addParseFlag(<b>int</b> parseFlag) {
  <a name="261" href="#261">261</a>     _parseFlag |= parseFlag;
  <a name="262" href="#262">262</a>   } 
  <a name="263" href="#263">263</a> 
  <a name="264" href="#264">264</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="265" href="#265">265</a> <font color="#AA0000"><i>   * Remove a parse flag from the existing parse flag.</font></i>
  <a name="266" href="#266">266</a> <font color="#AA0000"><i>   *</font></i>
  <a name="267" href="#267">267</a> <font color="#AA0000"><i>   * @param parseFlag parse flag to be removed</font></i>
  <a name="268" href="#268">268</a> <font color="#AA0000"><i>   */</font></i>
  <a name="269" href="#269">269</a>   <b>public</b> <b>void</b> removeParseFlag(<b>int</b> parseFlag) {
  <a name="270" href="#270">270</a>     _parseFlag ^= parseFlag;
  <a name="271" href="#271">271</a>   } 
  <a name="272" href="#272">272</a> 
  <a name="273" href="#273">273</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="274" href="#274">274</a> <font color="#AA0000"><i>   * Clear all parse flags.</font></i>
  <a name="275" href="#275">275</a> <font color="#AA0000"><i>   */</font></i>
  <a name="276" href="#276">276</a>   <b>public</b> <b>void</b> clearParseFlag() {
  <a name="277" href="#277">277</a>     _parseFlag = 0;
  <a name="278" href="#278">278</a>   }
  <a name="279" href="#279">279</a> 
  <a name="280" href="#280">280</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="281" href="#281">281</a> <font color="#AA0000"><i>   * Set a base URL to use when resolving relative URL's.  URLParser cannot check</font></i>
  <a name="282" href="#282">282</a> <font color="#AA0000"><i>   * for malformed URL's unless a base URL is set.</font></i>
  <a name="283" href="#283">283</a> <font color="#AA0000"><i>   *</font></i>
  <a name="284" href="#284">284</a> <font color="#AA0000"><i>   * @param baseURL the base URL used to resolve relative URL's</font></i>
  <a name="285" href="#285">285</a> <font color="#AA0000"><i>   *</font></i>
  <a name="286" href="#286">286</a> <font color="#AA0000"><i>   */</font></i>
  <a name="287" href="#287">287</a>   <b>public</b> <b>void</b> setBaseURL(URL baseURL) {
  <a name="288" href="#288">288</a>     _baseURL = baseURL;
  <a name="289" href="#289">289</a>   }
  <a name="290" href="#290">290</a> 
  <a name="291" href="#291">291</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="292" href="#292">292</a> <font color="#AA0000"><i>   * Return the base URL.</font></i>
  <a name="293" href="#293">293</a> <font color="#AA0000"><i>   *</font></i>
  <a name="294" href="#294">294</a> <font color="#AA0000"><i>   * @return the base URL</font></i>
  <a name="295" href="#295">295</a> <font color="#AA0000"><i>   */</font></i>
  <a name="296" href="#296">296</a>   <b>public</b> URL getBaseURL() {
  <a name="297" href="#297">297</a>     <b>return</b> _baseURL;
  <a name="298" href="#298">298</a>   }
  <a name="299" href="#299">299</a>   
  <a name="300" href="#300">300</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="301" href="#301">301</a> <font color="#AA0000"><i>   * Set behavior for malformed URL's.  If &lt;code&gt;includeMalformedURL&lt;/code&gt;</font></i>
  <a name="302" href="#302">302</a> <font color="#AA0000"><i>   * is true, malformed URL's will be included in the returned Collection.</font></i>
  <a name="303" href="#303">303</a> <font color="#AA0000"><i>   * Malformed URL's from the last parsing are always available via</font></i>
  <a name="304" href="#304">304</a> <font color="#AA0000"><i>   * {@link #getMalformedURLs}</font></i>
  <a name="305" href="#305">305</a> <font color="#AA0000"><i>   *</font></i>
  <a name="306" href="#306">306</a> <font color="#AA0000"><i>   * @param includeMalformedURL a boolean determining parsing</font></i>
  <a name="307" href="#307">307</a> <font color="#AA0000"><i>   * behavior with respect to malformed URL's</font></i>
  <a name="308" href="#308">308</a> <font color="#AA0000"><i>   */</font></i>
  <a name="309" href="#309">309</a>   <b>public</b> <b>void</b> setIncludeMalformedURLs(<b>boolean</b> includeMalformedURLs) {
  <a name="310" href="#310">310</a>     _includeMalformedURLs = includeMalformedURLs;
  <a name="311" href="#311">311</a>   }
  <a name="312" href="#312">312</a> 
  <a name="313" href="#313">313</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="314" href="#314">314</a> <font color="#AA0000"><i>   * Returns the &lt;code&gt;includeMalformedURL&lt;/code&gt; flag.</font></i>
  <a name="315" href="#315">315</a> <font color="#AA0000"><i>   *</font></i>
  <a name="316" href="#316">316</a> <font color="#AA0000"><i>   * @return boolean value of &lt;code&gt;includeMalformedURL&lt;/code&gt; flag</font></i>
  <a name="317" href="#317">317</a> <font color="#AA0000"><i>   */</font></i>
  <a name="318" href="#318">318</a>   <b>public</b> <b>boolean</b> includeMalformedURLs() {
  <a name="319" href="#319">319</a>     <b>return</b> _includeMalformedURLs;
  <a name="320" href="#320">320</a>   }
  <a name="321" href="#321">321</a> 
  <a name="322" href="#322">322</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="323" href="#323">323</a> <font color="#AA0000"><i>   * Returns a Collection of malformed URL's from the previous parsing.</font></i>
  <a name="324" href="#324">324</a> <font color="#AA0000"><i>   *</font></i>
  <a name="325" href="#325">325</a> <font color="#AA0000"><i>   * @return a collection of malformed URL's or null if no parsing has been done yet.</font></i>
  <a name="326" href="#326">326</a> <font color="#AA0000"><i>   */</font></i>
  <a name="327" href="#327">327</a>   <b>public</b> Collection getMalformedURLs() {
  <a name="328" href="#328">328</a>     <b>return</b> _malformedURLs;
  <a name="329" href="#329">329</a>   }
  <a name="330" href="#330">330</a> 
  <a name="331" href="#331">331</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="332" href="#332">332</a> <font color="#AA0000"><i>   * Parses the InputStream's output and returns a collection of URL's.</font></i>
  <a name="333" href="#333">333</a> <font color="#AA0000"><i>   *</font></i>
  <a name="334" href="#334">334</a> <font color="#AA0000"><i>   * @param input an input stream to extract URL's from</font></i>
  <a name="335" href="#335">335</a> <font color="#AA0000"><i>   * @return a collection of URL's</font></i>
  <a name="336" href="#336">336</a> <font color="#AA0000"><i>   */</font></i>
  <a name="337" href="#337">337</a>   <b>public</b> Collection parse(InputStream input) {
  <a name="338" href="#338">338</a>     <b>return</b> parse(<b>new</b> StreamCharacterIterator(input));
  <a name="339" href="#339">339</a>   }
  <a name="340" href="#340">340</a> 
  <a name="341" href="#341">341</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="342" href="#342">342</a> <font color="#AA0000"><i>   * Parses the String and returns a collection of URL's.</font></i>
  <a name="343" href="#343">343</a> <font color="#AA0000"><i>   *</font></i>
  <a name="344" href="#344">344</a> <font color="#AA0000"><i>   * @param input a string to extract URL's from</font></i>
  <a name="345" href="#345">345</a> <font color="#AA0000"><i>   * @return a collection of URL's</font></i>
  <a name="346" href="#346">346</a> <font color="#AA0000"><i>   */</font></i>
  <a name="347" href="#347">347</a>   <b>public</b> Collection parse(String input) {
  <a name="348" href="#348">348</a>     <b>return</b> parse(<b>new</b> StringCharacterIterator(input));
  <a name="349" href="#349">349</a>   }
  <a name="350" href="#350">350</a> 
  <a name="351" href="#351">351</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="352" href="#352">352</a> <font color="#AA0000"><i>   * Parses the Reader's output and returns a collection of URL's.</font></i>
  <a name="353" href="#353">353</a> <font color="#AA0000"><i>   *</font></i>
  <a name="354" href="#354">354</a> <font color="#AA0000"><i>   * @param input a Reader to extract URL's from</font></i>
  <a name="355" href="#355">355</a> <font color="#AA0000"><i>   * @return a collection of URL's</font></i>
  <a name="356" href="#356">356</a> <font color="#AA0000"><i>   */</font></i>
  <a name="357" href="#357">357</a>   <b>public</b> Collection parse(Reader input) {
  <a name="358" href="#358">358</a>     <b>return</b> parse(<b>new</b> ReaderCharacterIterator(input));
  <a name="359" href="#359">359</a>   }
  <a name="360" href="#360">360</a> 
  <a name="361" href="#361">361</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="362" href="#362">362</a> <font color="#AA0000"><i>   * Parses the CharacterIterator's data and returns a collection of URL's.</font></i>
  <a name="363" href="#363">363</a> <font color="#AA0000"><i>   *</font></i>
  <a name="364" href="#364">364</a> <font color="#AA0000"><i>   * @param input a CharacterIterator to extract URL's from</font></i>
  <a name="365" href="#365">365</a> <font color="#AA0000"><i>   * @return a collection of URL's</font></i>
  <a name="366" href="#366">366</a> <font color="#AA0000"><i>   */</font></i>
  <a name="367" href="#367">367</a>   <b>public</b> Collection parse(CharacterIterator input) {
  <a name="368" href="#368">368</a> 
  <a name="369" href="#369">369</a>     Collection urls = <b>new</b> Vector();
  <a name="370" href="#370">370</a> 
  <a name="371" href="#371">371</a>     _malformedURLs = <b>new</b> Vector();
  <a name="372" href="#372">372</a> 
  <a name="373" href="#373">373</a>     <font color="#329900"><i>// check all defined patterns</font></i>
  <a name="374" href="#374">374</a>     <b>for</b> (<b>int</b> mask = 0x00000001 &lt;&lt; _numPatterns; mask != 0; mask &gt;&gt;&gt;= 1) {
  <a name="375" href="#375">375</a> 
  <a name="376" href="#376">376</a>       <b>int</b> key = _parseFlag & mask;
  <a name="377" href="#377">377</a> 
  <a name="378" href="#378">378</a>       <b>if</b> (key != 0) { <font color="#329900"><i>// if flag set</font></i>
  <a name="379" href="#379">379</a> 
  <a name="380" href="#380">380</a>         <font color="#329900"><i>// get pattern corresponding to key</font></i>
  <a name="381" href="#381">381</a>         String pattern = (String) _patterns.get(<b>new</b> Integer(key));
  <a name="382" href="#382">382</a>         
  <a name="383" href="#383">383</a>         <b>if</b> (pattern != <b>null</b>) { <font color="#329900"><i>// if pattern is defined</font></i>
  <a name="384" href="#384">384</a>           <font color="#329900"><i>// parse input using pattern, add results to url collection</font></i>
  <a name="385" href="#385">385</a>           urls.addAll(parse(input, pattern));
  <a name="386" href="#386">386</a>         }
  <a name="387" href="#387">387</a>       }
  <a name="388" href="#388">388</a>     }
  <a name="389" href="#389">389</a> 
  <a name="390" href="#390">390</a>     <b>return</b> urls;
  <a name="391" href="#391">391</a>   }
  <a name="392" href="#392">392</a> 
  <a name="393" href="#393">393</a>   <b>protected</b> Collection parse(CharacterIterator input, String pattern) {
  <a name="394" href="#394">394</a> 
  <a name="395" href="#395">395</a>     Collection urls = <b>new</b> Vector();
  <a name="396" href="#396">396</a> 
  <a name="397" href="#397">397</a>     REProgram program = getProgram(pattern);
  <a name="398" href="#398">398</a> 
  <a name="399" href="#399">399</a>     _engine.setProgram(program);
  <a name="400" href="#400">400</a> 
  <a name="401" href="#401">401</a>     <b>int</b> index = 0;
  <a name="402" href="#402">402</a>     String url;
  <a name="403" href="#403">403</a> 
  <a name="404" href="#404">404</a>     <b>while</b> (_engine.match(input, index)) {
  <a name="405" href="#405">405</a>       index = _engine.getParenEnd(0);
  <a name="406" href="#406">406</a>       url = _engine.getParen(2);
  <a name="407" href="#407">407</a> 
  <a name="408" href="#408">408</a>       <b>try</b> {
  <a name="409" href="#409">409</a>         url = resolveURL(url);
  <a name="410" href="#410">410</a>         urls.add(url);
  <a name="411" href="#411">411</a>       }
  <a name="412" href="#412">412</a>       <b>catch</b> (MalformedURLException e) {
  <a name="413" href="#413">413</a>         <b>if</b> (_includeMalformedURLs) {
  <a name="414" href="#414">414</a>           urls.add(url);
  <a name="415" href="#415">415</a>         }
  <a name="416" href="#416">416</a>         _malformedURLs.add(url);
  <a name="417" href="#417">417</a>       }
  <a name="418" href="#418">418</a>     }
  <a name="419" href="#419">419</a> 
  <a name="420" href="#420">420</a>     <b>return</b> urls;
  <a name="421" href="#421">421</a>   }
  <a name="422" href="#422">422</a> 
  <a name="423" href="#423">423</a>   <b>protected</b> String resolveURL(String url)
  <a name="424" href="#424">424</a>     throws MalformedURLException {
  <a name="425" href="#425">425</a> 
  <a name="426" href="#426">426</a>     String resolvedURL;
  <a name="427" href="#427">427</a> 
  <a name="428" href="#428">428</a>     <font color="#329900"><i>// if a base URL has been provided to resolve against</font></i>
  <a name="429" href="#429">429</a>     <b>if</b> (_baseURL != <b>null</b>) {
  <a name="430" href="#430">430</a>       resolvedURL = <b>new</b> URL(_baseURL, url).toExternalForm();
  <a name="431" href="#431">431</a>     }
  <a name="432" href="#432">432</a>     <b>else</b> {
  <a name="433" href="#433">433</a>       resolvedURL = url;
  <a name="434" href="#434">434</a>     }
  <a name="435" href="#435">435</a> 
  <a name="436" href="#436">436</a>     <b>return</b> resolvedURL;
  <a name="437" href="#437">437</a>   }
  <a name="438" href="#438">438</a> 
  <a name="439" href="#439">439</a>   <b>protected</b> REProgram getProgram(String pattern) {
  <a name="440" href="#440">440</a>     REProgram program = (REProgram) _programs.get(pattern);
  <a name="441" href="#441">441</a> 
  <a name="442" href="#442">442</a>     <font color="#329900"><i>// cache RE programs</font></i>
  <a name="443" href="#443">443</a>     <b>if</b> (program == <b>null</b>) {
  <a name="444" href="#444">444</a>       <b>try</b> {
  <a name="445" href="#445">445</a>         program = _compiler.compile(pattern);
  <a name="446" href="#446">446</a>         _programs.put(pattern, program);
  <a name="447" href="#447">447</a>       }
  <a name="448" href="#448">448</a>       <b>catch</b> (RESyntaxException x) {
  <a name="449" href="#449">449</a>         <b>throw</b> <b>new</b> RuntimeException(
  <a name="450" href="#450">450</a>           <font color="#000099">"The Regular Expression Compiler could not compile the following regular expression: "</font>
  <a name="451" href="#451">451</a>           + pattern);
  <a name="452" href="#452">452</a>       }
  <a name="453" href="#453">453</a>     }
  <a name="454" href="#454">454</a> 
  <a name="455" href="#455">455</a>     <b>return</b> program;
  <a name="456" href="#456">456</a>   }
  <a name="457" href="#457">457</a> 
  <a name="458" href="#458">458</a>   <font color="#329900"><i>///////////////////</font></i>
  <a name="459" href="#459">459</a>   <font color="#329900"><i>// CLASS METHODS //</font></i>
  <a name="460" href="#460">460</a>   <font color="#329900"><i>///////////////////</font></i>
  <a name="461" href="#461">461</a> 
  <a name="462" href="#462">462</a>   <font color="#AA0000"><i>/**<font color="#AA0000"><i>*</font></i></font></i>
  <a name="463" href="#463">463</a> <font color="#AA0000"><i>   * Parse a file, extracting all URL's to standard output.</font></i>
  <a name="464" href="#464">464</a> <font color="#AA0000"><i>   * Usage: java com.britannica.util.URLParser &lt;filename&gt; [&lt;base URL&gt;]</font></i>
  <a name="465" href="#465">465</a> <font color="#AA0000"><i>   *</font></i>
  <a name="466" href="#466">466</a> <font color="#AA0000"><i>   * If a base URL is specified, malformed URL's will be output to </font></i>
  <a name="467" href="#467">467</a> <font color="#AA0000"><i>   * standard error.</font></i>
  <a name="468" href="#468">468</a> <font color="#AA0000"><i>   *</font></i>
  <a name="469" href="#469">469</a> <font color="#AA0000"><i>   * Return Codes:</font></i>
  <a name="470" href="#470">470</a> <font color="#AA0000"><i>   *   0 - success</font></i>
  <a name="471" href="#471">471</a> <font color="#AA0000"><i>   *   1 - bad usage</font></i>
  <a name="472" href="#472">472</a> <font color="#AA0000"><i>   *   2 - bad filename</font></i>
  <a name="473" href="#473">473</a> <font color="#AA0000"><i>   *   3 - bad base url</font></i>
  <a name="474" href="#474">474</a> <font color="#AA0000"><i>   */</font></i>
  <a name="475" href="#475">475</a>   <b>public</b> <b>static</b> <b>void</b> main(String[] args) {
  <a name="476" href="#476">476</a> 
  <a name="477" href="#477">477</a>     <b>final</b> String USAGE_MSG = <font color="#000099">"Usage: java com.britannica.util.URLParser &lt;filename&gt; [&lt;base URL&gt;]"</font>;
  <a name="478" href="#478">478</a>     <b>final</b> String FILE_MSG  = <font color="#000099">"File not found: "</font>;
  <a name="479" href="#479">479</a>     <b>final</b> String URL_MSG   = <font color="#000099">"Malformed Base URL: "</font>;
  <a name="480" href="#480">480</a> 
  <a name="481" href="#481">481</a>     <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>  parser;
  <a name="482" href="#482">482</a>     Collection urls;
  <a name="483" href="#483">483</a>     Iterator   iter;
  <a name="484" href="#484">484</a> 
  <a name="485" href="#485">485</a>     <b>try</b> {
  <a name="486" href="#486">486</a>       <b>if</b> (args.length &gt; 1) {
  <a name="487" href="#487">487</a>         parser = <b>new</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>(<b>new</b> URL(args[1]), false);
  <a name="488" href="#488">488</a>       }
  <a name="489" href="#489">489</a>       <b>else</b> {
  <a name="490" href="#490">490</a>         parser = <b>new</b> <a href="../../../../../org/apache/commons/latka/util/URLParser.html">URLParser</a>();
  <a name="491" href="#491">491</a>       }
  <a name="492" href="#492">492</a> 
  <a name="493" href="#493">493</a>       urls = parser.parse(<b>new</b> FileInputStream(args[0]));
  <a name="494" href="#494">494</a>       iter = urls.iterator(); 
  <a name="495" href="#495">495</a> 
  <a name="496" href="#496">496</a>       <b>while</b> (iter.hasNext()) {
  <a name="497" href="#497">497</a>         System.out.println((String) iter.next());
  <a name="498" href="#498">498</a>       }
  <a name="499" href="#499">499</a> 
  <a name="500" href="#500">500</a>       <b>if</b> (args.length &gt; 1) {
  <a name="501" href="#501">501</a>         urls = parser.getMalformedURLs();
  <a name="502" href="#502">502</a>         iter = urls.iterator(); 
  <a name="503" href="#503">503</a>   
  <a name="504" href="#504">504</a>         <b>while</b> (iter.hasNext()) {
  <a name="505" href="#505">505</a>           System.err.println((String) iter.next());
  <a name="506" href="#506">506</a>         }
  <a name="507" href="#507">507</a>       }
  <a name="508" href="#508">508</a>     }
  <a name="509" href="#509">509</a>     <b>catch</b> (ArrayIndexOutOfBoundsException e) {
  <a name="510" href="#510">510</a>       System.err.println(USAGE_MSG);
  <a name="511" href="#511">511</a>       System.exit(1);
  <a name="512" href="#512">512</a>     }
  <a name="513" href="#513">513</a>     <b>catch</b> (FileNotFoundException e) {
  <a name="514" href="#514">514</a>       System.err.println(FILE_MSG + args[0]);
  <a name="515" href="#515">515</a>       System.exit(2);
  <a name="516" href="#516">516</a>     }
  <a name="517" href="#517">517</a>     <b>catch</b> (MalformedURLException e) {
  <a name="518" href="#518">518</a>       System.err.println(URL_MSG + args[1]);
  <a name="519" href="#519">519</a>       System.exit(3);
  <a name="520" href="#520">520</a>     }
  <a name="521" href="#521">521</a> 
  <a name="522" href="#522">522</a>     System.exit(0);
  <a name="523" href="#523">523</a>   }
  <a name="524" href="#524">524</a> }
  </pre>
  <hr><center>This page automatically generated by Maven</center></body>
  </html>
  
  
  
  
  1.1                  jakarta-commons/docs/latka/xref/java/org/apache/commons/latka/util/index.html
  
  Index: index.html
  ===================================================================
  <html>
  <body bgcolor="white">
  <a href="../">[parent]</a>
  <hr>
  <table width="100%">
  <tr>
  <td><b>Name</b></td>
  <td><b>Size</b></td>
  <td><b>Last Modified</b></td>
  </tr>
  <tr valign="middle"><td valign="middle" NOWRAP><img src="./folder.gif" valign="middle" border="0">&nbsp;<a href="xml/index.html">xml</a></td><td valign="middle" NOWRAP>0 (in bytes) </td><td valign="middle" NOWRAP>30/03/2002</td></tr>
  <tr valign="middle"><td valign="middle" NOWRAP><img src="./file.gif" valign="middle" border="0">&nbsp;<a href="URLParser.html">URLParser.java</a></td><td valign="middle" NOWRAP>46893 (in bytes) </td><td valign="middle" NOWRAP>1/04/2002</td></tr>
  </table>
  <hr>
  <center>This page automatically generated by Maven</center>
  </body>
  </html>
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message