[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Sun Feb 13 13:03:04 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book
In directory www.crosswire.org:/tmp/cvs-serv16088/java/jsword/org/crosswire/jsword/book

Modified Files:
	StudyTool.java BookData.java 
Log Message:
tidying up a few interfaces

Index: BookData.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/BookData.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** BookData.java	27 Jan 2005 02:18:35 -0000	1.8
--- BookData.java	13 Feb 2005 20:03:02 -0000	1.9
***************
*** 2,5 ****
--- 2,6 ----
  
  import java.util.Iterator;
+ import java.util.List;
  
  import org.crosswire.common.xml.JDOMSAXEventProvider;
***************
*** 50,61 ****
       * Create a BibleData from a SAXEventProvider
       */
!     public BookData(SAXEventProvider provider) throws SAXException
      {
          provider.provideSAXEvents(handler);
!         osis = handler.getDocument().getRootElement();
      }
  
-     private SAXHandler handler = new SAXHandler();
- 
      /**
       * Accessor for the root OSIS element
--- 51,63 ----
       * Create a BibleData from a SAXEventProvider
       */
!     public BookData(SAXEventProvider provider, Book book, Key key) throws SAXException
      {
+         SAXHandler handler = new SAXHandler();
          provider.provideSAXEvents(handler);
!         this.osis = handler.getDocument().getRootElement();
!         this.book = book;
!         this.key = key;
      }
  
      /**
       * Accessor for the root OSIS element
***************
*** 75,80 ****
          StringBuffer buffer = new StringBuffer();
  
!         Iterator oit = getOsis().getChild(OSISUtil.OSIS_ELEMENT_OSISTEXT).getChildren(OSISUtil.OSIS_ELEMENT_DIV).iterator();
!         while (oit.hasNext())
          {
              Element div = (Element) oit.next();
--- 77,84 ----
          StringBuffer buffer = new StringBuffer();
  
!         Element osisText = getOsis().getChild(OSISUtil.OSIS_ELEMENT_OSISTEXT);
!         List divs = osisText.getChildren(OSISUtil.OSIS_ELEMENT_DIV);
! 
!         for (Iterator oit = divs.iterator(); oit.hasNext();)
          {
              Element div = (Element) oit.next();

Index: StudyTool.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/StudyTool.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** StudyTool.java	25 Jan 2005 00:02:32 -0000	1.10
--- StudyTool.java	13 Feb 2005 20:03:02 -0000	1.11
***************
*** 6,10 ****
--- 6,12 ----
  import java.util.Map;
  
+ import org.crosswire.common.util.Logger;
  import org.crosswire.jsword.passage.Key;
+ import org.crosswire.jsword.passage.NoSuchKeyException;
  import org.jdom.Element;
  
***************
*** 72,76 ****
                      if (trans == null)
                      {
!                         trans = new Translation(word, strongs, key);
                          reply.put(strongs, trans);
                      }
--- 74,86 ----
                      if (trans == null)
                      {
!                         try
!                         {
! 							trans = new Translation(word, strongs, bible.getKey(null));
! 						}
!                         catch (NoSuchKeyException ex)
!                         {
!                             log.warn("Failed to create key", ex); //$NON-NLS-1$
! 						}
! 
                          reply.put(strongs, trans);
                      }
***************
*** 121,125 ****
                      if (trans == null)
                      {
!                         trans = new Translation(translated, number, key);
                          reply.put(translated, trans);
                      }
--- 131,143 ----
                      if (trans == null)
                      {
!                         try
!                         {
!                             trans = new Translation(translated, number, bible.getKey(null));
!                         }
!                         catch (NoSuchKeyException ex)
!                         {
!                             log.warn("Failed to create key", ex); //$NON-NLS-1$
!                         }
! 
                          reply.put(translated, trans);
                      }
***************
*** 132,134 ****
--- 150,157 ----
          return reply.values();
      }
+ 
+     /**
+      * The log stream
+      */
+     protected static final Logger log = Logger.getLogger(StudyTool.class);
  }



More information about the jsword-svn mailing list