Source code: com/steadystate/css/parser/HandlerBase.java
1 /*
2 * HandlerBase.java
3 *
4 * Steady State CSS2 Parser
5 *
6 * Copyright (C) 1999, 2002 Steady State Software Ltd. All rights reserved.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * To contact the authors of the library, write to Steady State Software Ltd.,
23 * 49 Littleworth, Wing, Buckinghamshire, LU7 0JX, England
24 *
25 * http://www.steadystate.com/css/
26 * mailto:css@steadystate.co.uk
27 *
28 * $Id: HandlerBase.java,v 1.1.1.1 2003/12/28 21:23:05 davidsch Exp $
29 */
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 }