public class PermissiveReaderExample extends Object
| Constructor and Description |
|---|
PermissiveReaderExample() |
| Modifier and Type | Method and Description |
|---|---|
static void |
dumpErrors(PrintStream out,
ErrorHandler errorHandler)
Dumps errors from the supplied error handler to the supplied print stream.
|
static void |
main(String[] args)
This test program demonstrates the use of the MarcPermissiveStreamReader to read Marc records, with the
permissive setting turned on.
|
static void |
showDiffs(PrintStream out,
String strNorm,
String strPerm)
Normalizes strings to be able to show diffs.
|
public static void main(String[] args)
When run in verbose mode, (by passing -v as the first parameter) the program will display the entire record highlighting the lines in the record that have errors that the permissive reader was able to detect and make an attempt at correcting. Following that the program will list all of the errors that it found in the record.
When run in verbose mode as described above, the program is useful for validating records.
Shown below is the output generated when the program is run on the file error.mrc found in the resources sub-directory in the samples directory:
Fatal Exception: error parsing data field for tag: 250 with data: a1st ed.
Typo : Record terminator character not found at end of record length --- [ n/a : n/a ]
Typo : Record terminator appears after stated record length, reading extra bytes --- [ n/a : n/a ]
Minor Error : Field length found in record different from length stated in the directory. --- [ n/a : n/a ]
LEADER 00715cam a2200205 a 4500
001 12883376
005 20030616111422.0
008 020805s2002 nyu j 000 1 eng
020 $a0786808772
020 $a0786816155 (pbk.)
040 $aDLC$cDLC$dDLC
100 1 $aChabon, Michael.
245 10$aSummerland /$cMichael Chabon.
250 $a1st ed.
260 $aNew York :$bMiramax Books/Hyperion Books for Children,$cc2002.
300 $a500 p. ;$c22 cm.
520 $aEthan Feld finds himself recruited by a 100-year-old scout to help a band of fairies.
650 1$aFantasy.
650 1$aBaseball$vFiction.
650 1$aMagic$vFiction.
public static void showDiffs(PrintStream out, String strNorm, String strPerm)
out - The output diff streamstrNorm - The normalized stringstrPerm - The perm stringpublic static void dumpErrors(PrintStream out, ErrorHandler errorHandler)
out - The stream to which to write errorserrorHandler - The error handler with the errors to be written to the out streamCopyright © 2014 FreeLibrary. All Rights Reserved.