Clover coverage report - Clover results for XOM 1.2d1
Coverage timestamp: Wed Feb 8 2006 08:31:33 EST
file stats: LOC: 138   Methods: 2
NCLOC: 74   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ISOHebrewWriter.java 100% 100% 100% 100%
coverage
 1    /* Copyright 2002, 2003 Elliotte Rusty Harold
 2   
 3    This library is free software; you can redistribute it and/or modify
 4    it under the terms of version 2.1 of the GNU Lesser General Public
 5    License as published by the Free Software Foundation.
 6   
 7    This library is distributed in the hope that it will be useful,
 8    but WITHOUT ANY WARRANTY; without even the implied warranty of
 9    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 10    GNU Lesser General Public License for more details.
 11   
 12    You should have received a copy of the GNU Lesser General Public
 13    License along with this library; if not, write to the
 14    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 15    Boston, MA 02111-1307 USA
 16   
 17    You can contact Elliotte Rusty Harold by sending e-mail to
 18    elharo@metalab.unc.edu. Please include the word "XOM" in the
 19    subject line. The XOM home page is located at http://www.xom.nu/
 20    */
 21   
 22    package nu.xom;
 23   
 24    import java.io.Writer;
 25   
 26    /**
 27    * <p>
 28    * ISO 8859-8, ASCII plus Hebrew
 29    * </p>
 30    *
 31    * @author Elliotte Rusty Harold
 32    * @version 1.0
 33    *
 34    */
 35    class ISOHebrewWriter extends TextWriter {
 36   
 37  1 ISOHebrewWriter(Writer out, String encoding) {
 38  1 super(out, encoding);
 39    }
 40   
 41    /**
 42    * @see nu.xom.TextWriter#needsEscaping(char)
 43    */
 44  255083 boolean needsEscaping(char c) {
 45  191246 if (c <= 0xA0) return false;
 46  63837 switch (c) { // characters shared with Latin-1
 47  1 case 0x00A2: return false; // CENT SIGN
 48  1 case 0x00A3: return false; // POUND SIGN
 49  1 case 0x00A4: return false; // CURRENCY SIGN
 50  1 case 0x00A5: return false; // YEN SIGN
 51  1 case 0x00A6: return false; // BROKEN BAR
 52  1 case 0x00A7: return false; // SECTION SIGN
 53  1 case 0x00A8: return false; // DIAERESIS
 54  1 case 0x00A9: return false; // COPYRIGHT SIGN
 55  1 case 0x00AB: return false; // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
 56  1 case 0x00AC: return false; // NOT SIGN
 57  1 case 0x00AD: return false; // SOFT HYPHEN
 58  1 case 0x00AE: return false; // REGISTERED SIGN
 59    // A bug in Java prevents a macron from being correctly
 60    // output as the actual character in this encoding even
 61    // though it does exist in the ISO-8859-8 character set.
 62    // See JDC bug 4760496
 63    // http://developer.java.sun.com/developer/bugParade/bugs/4760496.html
 64    // They have marked this as fixed in Tiger (i.e. Java 1.5)
 65    // I'm not going to fix it here yet though, because I'd
 66    // prefer XOM to work correctly with earlier versions of
 67    // of Java; and it's not incorrect to output a character
 68    // reference even if you don't have to. It is an issue if a
 69    // macron is used in a a comment or a processing
 70    // instruction though. The macron is not a name character
 71    // so that's not an issue though.
 72  1 case 0x00AF: return true; // MACRON
 73  1 case 0x00B0: return false; // DEGREE SIGN
 74  1 case 0x00B1: return false; // PLUS-MINUS SIGN
 75  1 case 0x00B2: return false; // SUPERSCRIPT TWO
 76  1 case 0x00B3: return false; // SUPERSCRIPT THREE
 77  1 case 0x00B4: return false; // ACUTE ACCENT
 78  1 case 0x00B5: return false; // MICRO SIGN
 79  1 case 0x00B6: return false; // PILCROW SIGN
 80  1 case 0x00B7: return false; // MIDDLE DOT
 81  1 case 0x00B8: return false; // CEDILLA
 82  1 case 0x00B9: return false; // SUPERSCRIPT ONE
 83  1 case 0x00BA: return true; // place holder to allow optimization of switch statement
 84  1 case 0x00BB: return false; // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
 85  1 case 0x00BC: return false; // VULGAR FRACTION ONE QUARTER
 86  1 case 0x00BD: return false; // VULGAR FRACTION ONE HALF
 87  1 case 0x00BE: return false; // VULGAR FRACTION THREE QUARTERS
 88    }
 89  63809 switch (c) { // Unicode Hebrew block
 90  1 case 0x05D0: return false; // HEBREW LETTER ALEF
 91  1 case 0x05D1: return false; // HEBREW LETTER BET
 92  1 case 0x05D2: return false; // HEBREW LETTER GIMEL
 93  1 case 0x05D3: return false; // HEBREW LETTER DALET
 94  1 case 0x05D4: return false; // HEBREW LETTER HE
 95  1 case 0x05D5: return false; // HEBREW LETTER VAV
 96  1 case 0x05D6: return false; // HEBREW LETTER ZAYIN
 97  1 case 0x05D7: return false; // HEBREW LETTER HET
 98  1 case 0x05D8: return false; // HEBREW LETTER TET
 99  1 case 0x05D9: return false; // HEBREW LETTER YOD
 100  1 case 0x05DA: return false; // HEBREW LETTER FINAL KAF
 101  1 case 0x05DB: return false; // HEBREW LETTER KAF
 102  1 case 0x05DC: return false; // HEBREW LETTER LAMED
 103  1 case 0x05DD: return false; // HEBREW LETTER FINAL MEM
 104  1 case 0x05DE: return false; // HEBREW LETTER MEM
 105  1 case 0x05DF: return false; // HEBREW LETTER FINAL NUN
 106  1 case 0x05E0: return false; // HEBREW LETTER NUN
 107  1 case 0x05E1: return false; // HEBREW LETTER SAMEKH
 108  1 case 0x05E2: return false; // HEBREW LETTER AYIN
 109  1 case 0x05E3: return false; // HEBREW LETTER FINAL PE
 110  1 case 0x05E4: return false; // HEBREW LETTER PE
 111  1 case 0x05E5: return false; // HEBREW LETTER FINAL TSADI
 112  1 case 0x05E6: return false; // HEBREW LETTER TSADI
 113  1 case 0x05E7: return false; // HEBREW LETTER QOF
 114  1 case 0x05E8: return false; // HEBREW LETTER RESH
 115  1 case 0x05E9: return false; // HEBREW LETTER SHIN
 116  1 case 0x05EA: return false; // HEBREW LETTER TAV
 117    }
 118   
 119  63782 switch (c) { // a few random, out of order characters
 120  1 case 0x00D7: return false; // MULTIPLICATION SIGN
 121  1 case 0x00F7: return false; // DIVISION SIGN
 122    // A bug in Java prevents a LEFT-TO-RIGHT MARK
 123    // and RIGHT-TO-LEFT MARK from being correctly output
 124    // as the actual character in this encoding even
 125    // though it does exist in the ISO-8859-8 character set.
 126    // See JDC bug 4758951
 127    // http://developer.java.sun.com/developer/bugParade/bugs/4758951.html
 128    // They have marked this as fixed in Tiger (i.e. Java 1.5)
 129    // case 0x200E: return false; // LEFT-TO-RIGHT MARK
 130    // case 0x200F: return false; // RIGHT-TO-LEFT MARK
 131  1 case 0x2017: return false; // DOUBLE LOW LINE
 132    }
 133   
 134  63779 return true;
 135   
 136    }
 137   
 138    }