[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/sword s
jswordcvs at crosswire.org
jswordcvs at crosswire.org
Sun Mar 6 13:21:49 MST 2005
Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword
In directory www.crosswire.org:/tmp/cvs-serv26524/java/jsword/org/crosswire/jsword/book/sword
Modified Files:
ConfigEntryType.java RawLDBackend.java ConfigEntryTable.java
Backend.java SwordBookMetaData.java ConfigEntry.java
RawBackend.java
Log Message:
Changes to satisfy CheckStyle
Index: SwordBookMetaData.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/SwordBookMetaData.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** SwordBookMetaData.java 28 Feb 2005 02:21:40 -0000 1.36
--- SwordBookMetaData.java 6 Mar 2005 20:21:47 -0000 1.37
***************
*** 147,151 ****
return getModuleType().getBookType();
}
!
public Document toOSIS()
{
--- 147,151 ----
return getModuleType().getBookType();
}
!
public Document toOSIS()
{
***************
*** 170,175 ****
{
Object obj = cet.getValue(entry);
!
! return obj != null ? obj.toString() : null;
}
--- 170,175 ----
{
Object obj = cet.getValue(entry);
!
! return obj != null ? obj.toString() : null;
}
***************
*** 186,193 ****
{
// merge entries into properties file
! for (Iterator kit = cet.getKeys(); kit.hasNext();)
{
ConfigEntryType key = (ConfigEntryType) kit.next();
!
Object value = cet.getValue(key);
// value is null if the config entry was rejected.
--- 186,193 ----
{
// merge entries into properties file
! for (Iterator kit = cet.getKeys(); kit.hasNext(); )
{
ConfigEntryType key = (ConfigEntryType) kit.next();
!
Object value = cet.getValue(key);
// value is null if the config entry was rejected.
***************
*** 201,205 ****
StringBuffer combined = new StringBuffer();
boolean appendSeparator = false;
! for (Iterator vit = list.iterator(); vit.hasNext();)
{
String element = (String) vit.next();
--- 201,205 ----
StringBuffer combined = new StringBuffer();
boolean appendSeparator = false;
! for (Iterator vit = list.iterator(); vit.hasNext(); )
{
String element = (String) vit.next();
***************
*** 211,222 ****
appendSeparator = true;
}
!
value = combined.toString();
}
!
putProperty(key.toString(), value.toString());
}
}
!
/**
* The language strings need to be converted to Java charsets
--- 211,222 ----
appendSeparator = true;
}
!
value = combined.toString();
}
!
putProperty(key.toString(), value.toString());
}
}
!
/**
* The language strings need to be converted to Java charsets
***************
*** 226,230 ****
{
ENCODING_JAVA.put("Latin-1", "ISO-8859-1"); //$NON-NLS-1$ //$NON-NLS-2$
! ENCODING_JAVA.put("UTF-8","UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
}
--- 226,230 ----
{
ENCODING_JAVA.put("Latin-1", "ISO-8859-1"); //$NON-NLS-1$ //$NON-NLS-2$
! ENCODING_JAVA.put("UTF-8", "UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$
}
Index: RawBackend.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/RawBackend.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** RawBackend.java 5 Mar 2005 17:53:10 -0000 1.21
--- RawBackend.java 6 Mar 2005 20:21:47 -0000 1.22
***************
*** 18,22 ****
* Both Books and Commentaries seem to use the same format so this class
* abstracts out the similarities.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 18,22 ----
* Both Books and Commentaries seem to use the same format so this class
* abstracts out the similarities.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 51,55 ****
File baseurl = new File(rootPath, dataPath);
String path = baseurl.getAbsolutePath();
!
idxFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT + SwordConstants.EXTENSION_VSS);
txtFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT);
--- 51,55 ----
File baseurl = new File(rootPath, dataPath);
String path = baseurl.getAbsolutePath();
!
idxFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT + SwordConstants.EXTENSION_VSS);
txtFile[SwordConstants.TESTAMENT_OLD] = new File(path + File.separator + SwordConstants.FILE_OT);
***************
*** 156,160 ****
// Probably be safer not to risk it since we know how long it is.
byte[] data = SwordUtil.readRAF(txtRaf[testament], start, size);
!
decipher(data);
--- 156,160 ----
// Probably be safer not to risk it since we know how long it is.
byte[] data = SwordUtil.readRAF(txtRaf[testament], start, size);
!
decipher(data);
Index: ConfigEntryTable.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/ConfigEntryTable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConfigEntryTable.java 4 Mar 2005 04:04:47 -0000 1.2
--- ConfigEntryTable.java 6 Mar 2005 20:21:47 -0000 1.3
***************
*** 158,162 ****
continue;
}
!
String key = line.substring(0, eqpos).trim();
String value = line.substring(eqpos + 1).trim();
--- 158,162 ----
continue;
}
!
String key = line.substring(0, eqpos).trim();
String value = line.substring(eqpos + 1).trim();
***************
*** 170,174 ****
// Create a configEntry so that the name is normalized.
ConfigEntry configEntry = new ConfigEntry(internal, key);
!
ConfigEntry e = (ConfigEntry) table.get(configEntry.getType());
--- 170,174 ----
// Create a configEntry so that the name is normalized.
ConfigEntry configEntry = new ConfigEntry(internal, key);
!
ConfigEntry e = (ConfigEntry) table.get(configEntry.getType());
***************
*** 273,277 ****
if (!configEntry.allowsContinuation())
{
! log.warn("Ignoring unexpected additional line for " + configEntry.getName() + " in " + internal + ": " + line); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
--- 273,277 ----
if (!configEntry.allowsContinuation())
{
! log.warn("Ignoring unexpected additional line for " + configEntry.getName() + " in " + internal + ": " + line); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
***************
*** 369,373 ****
String langFromEntry = (String) getValue(ConfigEntryType.GLOSSARY_FROM);
String langToEntry = (String) getValue(ConfigEntryType.GLOSSARY_TO);
!
if (langFromEntry != null || langToEntry != null)
{
--- 369,373 ----
String langFromEntry = (String) getValue(ConfigEntryType.GLOSSARY_FROM);
String langToEntry = (String) getValue(ConfigEntryType.GLOSSARY_TO);
!
if (langFromEntry != null || langToEntry != null)
{
***************
*** 378,382 ****
boolean fromLeftToRight = true;
boolean toLeftToRight = true;
!
if (langFromEntry == null)
{
--- 378,382 ----
boolean fromLeftToRight = true;
boolean toLeftToRight = true;
!
if (langFromEntry == null)
{
***************
*** 396,400 ****
toLeftToRight = ComponentOrientation.getOrientation(new Locale(langToEntry)).isLeftToRight();
}
!
// At least one of the two languages should match the lang entry
if (!langFrom.equals(lang) && !langTo.equals(lang))
--- 396,400 ----
toLeftToRight = ComponentOrientation.getOrientation(new Locale(langToEntry)).isLeftToRight();
}
!
// At least one of the two languages should match the lang entry
if (!langFrom.equals(lang) && !langTo.equals(lang))
***************
*** 402,406 ****
log.error("Data error in " + internal + ". Neither " + ConfigEntryType.GLOSSARY_FROM.getName() + " or " + ConfigEntryType.GLOSSARY_FROM.getName() + " match " + ConfigEntryType.LANG.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
!
if (fromLeftToRight != toLeftToRight)
{
--- 402,406 ----
log.error("Data error in " + internal + ". Neither " + ConfigEntryType.GLOSSARY_FROM.getName() + " or " + ConfigEntryType.GLOSSARY_FROM.getName() + " match " + ConfigEntryType.LANG.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
!
if (fromLeftToRight != toLeftToRight)
{
***************
*** 443,451 ****
if (dir == null)
{
! log.warn("Fixing data for " + internal + ". Adding " + ConfigEntryType.DIRECTION.getName() + "=" + newDir); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
{
! log.warn("Fixing data for " + internal + ". Changing " + ConfigEntryType.DIRECTION.getName() + "=" + dir + " to " + newDir); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
add(ConfigEntryType.DIRECTION, newDir);
--- 443,451 ----
if (dir == null)
{
! log.warn("Fixing data for " + internal + ". Adding " + ConfigEntryType.DIRECTION.getName() + "=" + newDir); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
{
! log.warn("Fixing data for " + internal + ". Changing " + ConfigEntryType.DIRECTION.getName() + "=" + dir + " to " + newDir); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
add(ConfigEntryType.DIRECTION, newDir);
***************
*** 523,527 ****
ConfigEntry entry = (ConfigEntry) table.get(category[i]);
Element configElement = null;
!
if (entry != null)
{
--- 523,527 ----
ConfigEntry entry = (ConfigEntry) table.get(category[i]);
Element configElement = null;
!
if (entry != null)
{
***************
*** 531,537 ****
if (title == null && configElement != null)
{
! // I18N(DMS): use aTitle to lookup translation.
title = factory.createHeader();
! title.addContent(aTitle);
ele.addContent(title);
}
--- 531,537 ----
if (title == null && configElement != null)
{
! // I18N(DMS): use aTitle to lookup translation.
title = factory.createHeader();
! title.addContent(aTitle);
ele.addContent(title);
}
Index: Backend.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/Backend.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Backend.java 4 Mar 2005 04:04:47 -0000 1.12
--- Backend.java 6 Mar 2005 20:21:47 -0000 1.13
***************
*** 32,36 ****
* @version $Id$
*/
! abstract public class Backend implements Activatable
{
/**
--- 32,36 ----
* @version $Id$
*/
! public abstract class Backend implements Activatable
{
/**
***************
*** 83,87 ****
* number of times on SwordDictionary
*/
! abstract public Key readIndex();
/**
--- 83,87 ----
* number of times on SwordDictionary
*/
! public abstract Key readIndex();
/**
***************
*** 91,95 ****
* @throws BookException If the data can not be read.
*/
! abstract public String getRawText(Key key) throws BookException;
/**
--- 91,95 ----
* @throws BookException If the data can not be read.
*/
! public abstract String getRawText(Key key) throws BookException;
/**
***************
*** 97,102 ****
* @return true if this Backend is implemented.
*/
! abstract public boolean isSupported();
!
private SwordBookMetaData bmd;
private File rootPath;
--- 97,102 ----
* @return true if this Backend is implemented.
*/
! public abstract boolean isSupported();
!
private SwordBookMetaData bmd;
private File rootPath;
Index: ConfigEntryType.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/ConfigEntryType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConfigEntryType.java 4 Mar 2005 04:04:47 -0000 1.2
--- ConfigEntryType.java 6 Mar 2005 20:21:47 -0000 1.3
***************
*** 17,21 ****
* now located at
* http://www.crosswire.org/ucgi-bin/twiki/view/Swordapi/ConfFileLayout
! *
* <p>Keys that might be available that we are ignoring for now:
* <li>DistributionLicense: single value coded string, a ';' separated string of license attributes
--- 17,21 ----
* now located at
* http://www.crosswire.org/ucgi-bin/twiki/view/Swordapi/ConfFileLayout
! *
* <p>Keys that might be available that we are ignoring for now:
* <li>DistributionLicense: single value coded string, a ';' separated string of license attributes
***************
*** 54,58 ****
* }
* </pre>
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 54,58 ----
* }
* </pre>
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 90,95 ****
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
--- 90,95 ----
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
***************
*** 98,102 ****
{
return true;
! }
/**
--- 98,102 ----
{
return true;
! }
/**
***************
*** 289,293 ****
{
return true;
! }
/**
--- 289,293 ----
{
return true;
! }
/**
***************
*** 308,313 ****
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
--- 308,313 ----
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
***************
*** 316,320 ****
{
return true;
! }
/**
--- 316,320 ----
{
return true;
! }
/**
***************
*** 340,344 ****
{
return true;
! }
/* (non-Javadoc)
--- 340,344 ----
{
return true;
! }
/* (non-Javadoc)
***************
*** 348,352 ****
{
return true;
! }
/**
--- 348,352 ----
{
return true;
! }
/**
***************
*** 369,373 ****
}
! Pattern validDatePattern = Pattern.compile("\\d{4}(\\s*-\\s*\\d{4})?(\\s*,\\s*\\d{4}(\\s*-\\s*\\d{4})?)*"); //$NON-NLS-1$
/**
--- 369,373 ----
}
! private Pattern validDatePattern = Pattern.compile("\\d{4}(\\s*-\\s*\\d{4})?(\\s*,\\s*\\d{4}(\\s*-\\s*\\d{4})?)*"); //$NON-NLS-1$
/**
***************
*** 393,398 ****
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
--- 393,398 ----
{
return true;
! }
!
/* (non-Javadoc)
* @see org.crosswire.jsword.book.sword.ConfigEntryType#allowsRTF()
***************
*** 401,405 ****
{
return true;
! }
/**
--- 401,405 ----
{
return true;
! }
/**
***************
*** 420,424 ****
{
return true;
! }
/**
--- 420,424 ----
{
return true;
! }
/**
***************
*** 498,502 ****
return false;
}
! }
/**
--- 498,502 ----
return false;
}
! }
/**
***************
*** 517,521 ****
{
return choices.contains(value);
! }
/* (non-Javadoc)
--- 517,521 ----
{
return choices.contains(value);
! }
/* (non-Javadoc)
***************
*** 563,567 ****
{
return true;
! }
/**
--- 563,567 ----
{
return true;
! }
/**
***************
*** 583,587 ****
{
return true;
! }
/**
--- 583,587 ----
{
return true;
! }
/**
***************
*** 602,606 ****
{
return choices.contains(value);
! }
/* (non-Javadoc)
--- 602,606 ----
{
return choices.contains(value);
! }
/* (non-Javadoc)
***************
*** 647,651 ****
{
return choices.contains(value);
! }
/* (non-Javadoc)
--- 647,651 ----
{
return choices.contains(value);
! }
/* (non-Javadoc)
***************
*** 759,763 ****
return false;
}
! }
/**
--- 759,763 ----
return false;
}
! }
/**
***************
*** 780,784 ****
{
return choices.contains(value);
! }
/* (non-Javadoc)
--- 780,784 ----
{
return choices.contains(value);
! }
/* (non-Javadoc)
***************
*** 954,958 ****
{
return choices.contains(value);
! }
/* (non-Javadoc)
--- 954,958 ----
{
return choices.contains(value);
! }
/* (non-Javadoc)
***************
*** 1000,1006 ****
{
return validDatePattern.matcher(value).matches();
! }
! Pattern validDatePattern = Pattern.compile("\\d{4}-\\d{2}-\\d{2}"); //$NON-NLS-1$
/**
--- 1000,1006 ----
{
return validDatePattern.matcher(value).matches();
! }
! private Pattern validDatePattern = Pattern.compile("\\d{4}-\\d{2}-\\d{2}"); //$NON-NLS-1$
/**
***************
*** 1021,1025 ****
{
return true;
! }
/**
--- 1021,1025 ----
{
return true;
! }
/**
***************
*** 1072,1078 ****
public boolean isAllowed(String aValue)
{
! return aValue != null &&
! aValue.equalsIgnoreCase("true") && //$NON-NLS-1$
! aValue.equalsIgnoreCase("false"); //$NON-NLS-1$
}
--- 1072,1078 ----
public boolean isAllowed(String aValue)
{
! return aValue != null
! && aValue.equalsIgnoreCase("true") //$NON-NLS-1$
! && aValue.equalsIgnoreCase("false"); //$NON-NLS-1$
}
***************
*** 1215,1219 ****
this.name = name;
}
!
/**
* Returns the normalized name of this ConfigEntry.
--- 1215,1219 ----
this.name = name;
}
!
/**
* Returns the normalized name of this ConfigEntry.
***************
*** 1226,1232 ****
/**
! * Determines whether the string is allowed. For some config entries,
* the value is expected to be one of a group, for others the format is defined.
! *
* @param value the string to be checked
* @return true if the string is allowed
--- 1226,1232 ----
/**
! * Determines whether the string is allowed. For some config entries,
* the value is expected to be one of a group, for others the format is defined.
! *
* @param value the string to be checked
* @return true if the string is allowed
***************
*** 1245,1249 ****
return false;
}
!
/**
* While most fields are single line or single value, some allow continuation.
--- 1245,1249 ----
return false;
}
!
/**
* While most fields are single line or single value, some allow continuation.
***************
*** 1267,1271 ****
/**
* Determines the level of detail stored in the histogram.
! *
* @return true if the ConfigEntry should report histogram for repetitions
*/
--- 1267,1271 ----
/**
* Determines the level of detail stored in the histogram.
! *
* @return true if the ConfigEntry should report histogram for repetitions
*/
***************
*** 1294,1298 ****
return false;
}
!
/**
* Some ConfigEntryTypes have defaults.
--- 1294,1298 ----
return false;
}
!
/**
* Some ConfigEntryTypes have defaults.
Index: RawLDBackend.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/RawLDBackend.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** RawLDBackend.java 5 Mar 2005 17:53:10 -0000 1.14
--- RawLDBackend.java 6 Mar 2005 20:21:47 -0000 1.15
***************
*** 161,165 ****
// Now read the data file for this key using the offset and size
byte[] data = SwordUtil.readRAF(datRaf, offset, size);
!
decipher(data);
--- 161,165 ----
// Now read the data file for this key using the offset and size
byte[] data = SwordUtil.readRAF(datRaf, offset, size);
!
decipher(data);
Index: ConfigEntry.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/sword/ConfigEntry.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ConfigEntry.java 28 Feb 2005 02:21:40 -0000 1.9
--- ConfigEntry.java 6 Mar 2005 20:21:47 -0000 1.10
***************
*** 14,18 ****
/**
* A ConfigEntry holds the value(s) for an entry of ConfigEntryType.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
--- 14,18 ----
/**
* A ConfigEntry holds the value(s) for an entry of ConfigEntryType.
! *
* <p><table border='1' cellPadding='3' cellSpacing='0'>
* <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
***************
*** 87,93 ****
/**
! * Determines whether the string is allowed. For some config entries,
* the value is expected to be one of a group, for others the format is defined.
! *
* @param aValue
* @return true if the string is allowed
--- 87,93 ----
/**
! * Determines whether the string is allowed. For some config entries,
* the value is expected to be one of a group, for others the format is defined.
! *
* @param aValue
* @return true if the string is allowed
***************
*** 114,118 ****
return true;
}
!
/**
* While most fields are single line or single value, some allow continuation.
--- 114,118 ----
return true;
}
!
/**
* While most fields are single line or single value, some allow continuation.
***************
*** 141,147 ****
return true;
}
!
/**
! *
*/
public boolean reportDetails()
--- 141,147 ----
return true;
}
!
/**
! *
*/
public boolean reportDetails()
***************
*** 210,214 ****
if (value != null)
{
! log.info("Ignoring unexpected additional entry for " + confEntryName + " in " + internal + ": " + aValue); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
--- 210,214 ----
if (value != null)
{
! log.info("Ignoring unexpected additional entry for " + confEntryName + " in " + internal + ": " + aValue); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
else
***************
*** 228,236 ****
}
}
!
public Element toOSIS()
{
OSISUtil.ObjectFactory factory = OSISUtil.factory();
!
Element rowEle = factory.createRow();
--- 228,236 ----
}
}
!
public Element toOSIS()
{
OSISUtil.ObjectFactory factory = OSISUtil.factory();
!
Element rowEle = factory.createRow();
***************
*** 242,247 ****
rowEle.addContent(nameEle);
rowEle.addContent(valueElement);
!
! // I18N(DMS): use name to lookup translation.
hiEle.addContent(getName());
--- 242,247 ----
rowEle.addContent(nameEle);
rowEle.addContent(valueElement);
!
! // I18N(DMS): use name to lookup translation.
hiEle.addContent(getName());
***************
*** 360,364 ****
return copy;
}
!
private List processLines(OSISUtil.ObjectFactory factory, String aValue)
{
--- 360,364 ----
return copy;
}
!
private List processLines(OSISUtil.ObjectFactory factory, String aValue)
{
More information about the jsword-svn
mailing list