User: pathoss 
  Date: 02/05/12 14:36:20

  Modified:    core/src/xdoclet/loader Tag: MODULE_REFACTORING_BRANCH
                        ModuleFinder.java XDocletXmlParser.java
  Log:
  Use logging instead of System.out.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.6   +9 -5      xdoclet/core/src/xdoclet/loader/ModuleFinder.java
  
  Index: ModuleFinder.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/ModuleFinder.java,v
  retrieving revision 1.3.2.5
  retrieving revision 1.3.2.6
  diff -u -w -r1.3.2.5 -r1.3.2.6
  --- ModuleFinder.java 12 May 2002 11:58:02 -0000      1.3.2.5
  +++ ModuleFinder.java 12 May 2002 21:36:20 -0000      1.3.2.6
  @@ -13,18 +13,20 @@
   import java.util.jar.JarFile;
   
   import javax.xml.parsers.DocumentBuilderFactory;
  +import org.apache.commons.logging.Log;
   import org.apache.tools.ant.Project;
   
  +import xdoclet.util.LogUtil;
  +
   /**
    * Finds xdoclet modules.
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created   7. april 2002
  - * @version   $Revision: 1.3.2.5 $
  + * @version   $Revision: 1.3.2.6 $
    */
   public class ModuleFinder
   {
  -
       private final static FileFilter jarFilter =
           new FileFilter()
           {
  @@ -56,6 +58,8 @@
   
       public static List findModules()
       {
  +        Log log = LogUtil.getLog(ModuleFinder.class, "findModules");
  +
           ArrayList result = new ArrayList();
           XDocletXmlParser parser = new XDocletXmlParser();
   
  @@ -70,7 +74,7 @@
                   JarEntry xdocletXml = jar.getJarEntry("META-INF/xdoclet.xml");
   
                   if (xdocletXml != null) {
  -                    System.out.println(file.getAbsolutePath() + " has a 
META-INF/xdoclet.xml. Parsing it.");
  +                    log.info(file.getAbsolutePath() + " has a META-INF/xdoclet.xml. 
Parsing it.");
   
                       InputStream xdocletXmlIs = jar.getInputStream(xdocletXml);
                       XDocletModule module = parser.parse(xdocletXmlIs);
  @@ -79,11 +83,11 @@
                           result.add(module);
                       }
                       else {
  -                        System.err.println("META-INF/xdoclet.xml is bad in " + 
file.getAbsolutePath());
  +                        log.warn("META-INF/xdoclet.xml is bad in " + 
file.getAbsolutePath());
                       }
                   }
                   else {
  -                    System.out.println("Skipping " + file.getAbsolutePath() + " (No 
META-INF/xdoclet.xml in here)");
  +                    log.info("Skipping " + file.getAbsolutePath() + " (No 
META-INF/xdoclet.xml found)");
                   }
               }
               catch (IOException e) {
  
  
  
  1.3.2.3   +10 -10    xdoclet/core/src/xdoclet/loader/XDocletXmlParser.java
  
  Index: XDocletXmlParser.java
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/XDocletXmlParser.java,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -w -r1.3.2.2 -r1.3.2.3
  --- XDocletXmlParser.java     12 May 2002 11:58:02 -0000      1.3.2.2
  +++ XDocletXmlParser.java     12 May 2002 21:36:20 -0000      1.3.2.3
  @@ -20,12 +20,12 @@
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Aslak Helles�y</a>
    * @created   7. april 2002
  - * @version   $Revision: 1.3.2.2 $
  + * @version   $Revision: 1.3.2.3 $
    */
   class XDocletXmlParser extends DefaultHandler
   {
       private final SAXParserFactory _factory;
  -    private XDocletModule _module;
  +    private XDocletModule module;
   
       public XDocletXmlParser()
       {
  @@ -46,41 +46,41 @@
               parser.parse(in, this);
           }
           catch (IOException e) {
  -            _module = null;
  +            module = null;
               e.printStackTrace();
           }
           catch (IllegalArgumentException e) {
  -            _module = null;
  +            module = null;
               e.printStackTrace();
           }
           catch (ParserConfigurationException e) {
  -            _module = null;
  +            module = null;
               e.printStackTrace();
           }
           catch (SAXException e) {
  -            _module = null;
  +            module = null;
               e.printStackTrace();
           }
  -        return _module;
  +        return module;
       }
   
       public void startDocument()
       {
  -        _module = new XDocletModule();
  +        module = new XDocletModule();
       }
   
       public void startElement(String namespaceURI, String localName, String qName, 
Attributes attributes)
       {
   
           if (qName.equals("taghandler")) {
  -            _module.addTagHandler(
  +            module.addTagHandler(
                   attributes.getValue("namespace"),
                   attributes.getValue("class")
                   );
           }
           else
               if (qName.equals("subtask")) {
  -            _module.addSubTask(
  +            module.addSubTask(
                   attributes.getValue("name"),
                   attributes.getValue("implementation-class"),
                   attributes.getValue("parent-task-class")
  
  
  

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to