1 30 31 package com.steadystate.css.parser; 32 33 import org.w3c.css.sac.*; 34 35 public class HandlerBase implements DocumentHandler, ErrorHandler { 36 37 public void startDocument(InputSource source) 38 throws CSSException { 39 } 40 41 public void endDocument(InputSource source) throws CSSException { 42 } 43 44 public void comment(String text) throws CSSException { 45 } 46 47 public void ignorableAtRule(String atRule) throws CSSException { 48 } 49 50 public void namespaceDeclaration(String prefix, String uri) 51 throws CSSException { 52 } 53 54 public void importStyle(String uri, SACMediaList media, 55 String defaultNamespaceURI) 56 throws CSSException { 57 } 58 59 public void startMedia(SACMediaList media) throws CSSException { 60 } 61 62 public void endMedia(SACMediaList media) throws CSSException { 63 } 64 65 public void startPage(String name, String pseudo_page) throws CSSException { 66 } 67 68 public void endPage(String name, String pseudo_page) throws CSSException { 69 } 70 71 public void startFontFace() throws CSSException { 72 } 73 74 public void endFontFace() throws CSSException { 75 } 76 77 public void startSelector(SelectorList selectors) throws CSSException { 78 } 79 80 public void endSelector(SelectorList selectors) throws CSSException { 81 } 82 83 public void property(String name, LexicalUnit value, boolean important) 84 throws CSSException { 85 } 86 87 public void warning(CSSParseException exception) throws CSSException { 88 StringBuffer sb = new StringBuffer (); 89 sb.append(exception.getURI()) 90 .append(" [") 91 .append(exception.getLineNumber()) 92 .append(":") 93 .append(exception.getColumnNumber()) 94 .append("] ") 95 .append(exception.getMessage()); 96 System.err.println(sb.toString()); 97 } 98 99 public void error(CSSParseException exception) throws CSSException { 100 StringBuffer sb = new StringBuffer (); 101 sb.append(exception.getURI()) 102 .append(" [") 103 .append(exception.getLineNumber()) 104 .append(":") 105 .append(exception.getColumnNumber()) 106 .append("] ") 107 .append(exception.getMessage()); 108 System.err.println(sb.toString()); 109 } 110 111 public void fatalError(CSSParseException exception) throws CSSException { 112 StringBuffer sb = new StringBuffer (); 113 sb.append(exception.getURI()) 114 .append(" [") 115 .append(exception.getLineNumber()) 116 .append(":") 117 .append(exception.getColumnNumber()) 118 .append("] ") 119 .append(exception.getMessage()); 120 System.err.println(sb.toString()); 121 } 122 } 123 | Popular Tags |