1 18 package org.apache.batik.parser; 19 20 import java.io.IOException ; 21 22 29 public class LengthListParser extends LengthParser { 30 31 34 public LengthListParser() { 35 lengthHandler = DefaultLengthListHandler.INSTANCE; 36 } 37 38 49 public void setLengthListHandler(LengthListHandler handler) { 50 lengthHandler = handler; 51 } 52 53 56 public LengthListHandler getLengthListHandler() { 57 return (LengthListHandler)lengthHandler; 58 } 59 60 63 protected void doParse() throws ParseException, IOException { 64 ((LengthListHandler)lengthHandler).startLengthList(); 65 66 current = reader.read(); 67 skipSpaces(); 68 69 try { 70 for (;;) { 71 lengthHandler.startLength(); 72 parseLength(); 73 lengthHandler.endLength(); 74 skipCommaSpaces(); 75 if (current == -1) { 76 break; 77 } 78 } 79 } catch (NumberFormatException e) { 80 reportError("character.unexpected", 81 new Object [] { new Integer (current) }); 82 } 83 ((LengthListHandler)lengthHandler).endLengthList(); 84 } 85 } 86 | Popular Tags |