Source Code Cross Referenced for LogContentHandler.java in  » Parser » chaperon-3.0 » net » sourceforge » chaperon » common » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » chaperon 3.0 » net.sourceforge.chaperon.common 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright (C) Chaperon. All rights reserved.
003:         *  -------------------------------------------------------------------------
004:         *  This software is published under the terms of the Apache Software License
005:         *  version 1.1, a copy of which has been included  with this distribution in
006:         *  the LICENSE file.
007:         */
008:
009:        package net.sourceforge.chaperon.common;
010:
011:        import org.apache.commons.logging.Log;
012:
013:        import org.xml.sax.*;
014:
015:        /**
016:         * @author <a href="mailto:stephan@apache.org">Stephan Michels</a>
017:         * @version CVS $Id: LogContentHandler.java,v 1.2 2004/01/08 11:30:52 benedikta Exp $
018:         */
019:        public class LogContentHandler implements  ContentHandler {
020:            private ContentHandler handler = null;
021:            private Log log = null;
022:
023:            public LogContentHandler(ContentHandler handler, Log log) {
024:                this .handler = handler;
025:                this .log = log;
026:            }
027:
028:            public void setLog(Log log) {
029:                this .log = log;
030:            }
031:
032:            /**
033:             * Receive an object for locating the origin of SAX document events.
034:             */
035:            public void setDocumentLocator(Locator locator) {
036:                if (log != null)
037:                    log.debug("[SAX] DocumentLocator " + locator);
038:
039:                handler.setDocumentLocator(locator);
040:            }
041:
042:            /**
043:             * Receive notification of the beginning of a document.
044:             */
045:            public void startDocument() throws SAXException {
046:                if (log != null)
047:                    log.debug("[SAX] StartDocument");
048:
049:                handler.startDocument();
050:            }
051:
052:            /**
053:             * Receive notification of the end of a document.
054:             */
055:            public void endDocument() throws SAXException {
056:                if (log != null)
057:                    log.debug("[SAX] EndDocument");
058:
059:                handler.endDocument();
060:            }
061:
062:            /**
063:             * Receive notification of character data.
064:             */
065:            public void characters(char[] c, int start, int len)
066:                    throws SAXException {
067:                if (log != null)
068:                    log.debug("[SAX] Characters \"" + new String(c, start, len)
069:                            + "\"");
070:
071:                handler.characters(c, start, len);
072:            }
073:
074:            /**
075:             * Receive notification of ignorable whitespace in element content.
076:             */
077:            public void ignorableWhitespace(char[] c, int start, int len)
078:                    throws SAXException {
079:                if (log != null)
080:                    log.debug("[SAX] Ignorable Whitespace \""
081:                            + new String(c, start, len) + "\"");
082:
083:                handler.ignorableWhitespace(c, start, len);
084:            }
085:
086:            /**
087:             * Receive notification of the beginning of an element.
088:             */
089:            public void startElement(String namespaceURI, String localName,
090:                    String qName, Attributes atts) throws SAXException {
091:                if (log != null)
092:                    log.debug("[SAX] Start Element " + localName
093:                            + " Namespace " + namespaceURI);
094:
095:                handler.startElement(namespaceURI, localName, qName, atts);
096:            }
097:
098:            /**
099:             * Receive notification of the end of an element.
100:             */
101:            public void endElement(String namespaceURI, String localName,
102:                    String raw) throws SAXException {
103:                if (log != null)
104:                    log.debug("[SAX] End Element " + localName + " Namespace "
105:                            + namespaceURI);
106:
107:                handler.endElement(namespaceURI, localName, raw);
108:            }
109:
110:            /**
111:             * Receive notification of a processing instruction.
112:             */
113:            public void processingInstruction(String target, String data)
114:                    throws SAXException {
115:                if (log != null)
116:                    log.debug("[SAX] Processing Instruction Target " + target
117:                            + " Data " + data);
118:
119:                handler.processingInstruction(target, data);
120:            }
121:
122:            /**
123:             * Begin the scope of a prefix-URI Namespace mapping.
124:             */
125:            public void startPrefixMapping(String prefix, String uri)
126:                    throws SAXException {
127:                if (log != null)
128:                    log.debug("[SAX] Start Prefix Mapping " + prefix
129:                            + " Namespace " + uri);
130:
131:                handler.startPrefixMapping(prefix, uri);
132:            }
133:
134:            /**
135:             * End the scope of a prefix-URI mapping.
136:             */
137:            public void endPrefixMapping(String prefix) throws SAXException {
138:                if (log != null)
139:                    log.debug("[SAX] Start Prefix Mapping " + prefix);
140:
141:                handler.endPrefixMapping(prefix);
142:            }
143:
144:            public void skippedEntity(String name) throws SAXException {
145:                if (log != null)
146:                    log.debug("[SAX] Skipped Entity " + name);
147:
148:                handler.skippedEntity(name);
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.