KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > dna > impl > SAXMethods


1 /*
2  * Copyright (C) The DNA Group. All rights reserved.
3  *
4  * This software is published under the terms of the DNA
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.dna.impl;
9
10 import java.lang.reflect.Method JavaDoc;
11 import org.xml.sax.Attributes JavaDoc;
12 import org.xml.sax.ContentHandler JavaDoc;
13
14 class SAXMethods
15 {
16     static final Method JavaDoc START_DOCUMENT;
17     static final Method JavaDoc END_DOCUMENT;
18     static final Method JavaDoc START_ELEMENT;
19     static final Method JavaDoc END_ELEMENT;
20     static final Method JavaDoc CHARACTERS;
21
22     static
23     {
24         try
25         {
26             START_DOCUMENT =
27                 ContentHandler JavaDoc.class.getMethod( "startDocument", new Class JavaDoc[ 0 ] );
28             END_DOCUMENT =
29                 ContentHandler JavaDoc.class.getMethod( "endDocument", new Class JavaDoc[ 0 ] );
30             START_ELEMENT =
31                 ContentHandler JavaDoc.class.getMethod( "startElement",
32                                                 new Class JavaDoc[]{String JavaDoc.class, String JavaDoc.class, String JavaDoc.class, Attributes JavaDoc.class} );
33             END_ELEMENT =
34                 ContentHandler JavaDoc.class.getMethod( "endElement",
35                                                 new Class JavaDoc[]{String JavaDoc.class, String JavaDoc.class, String JavaDoc.class} );
36             CHARACTERS =
37                 ContentHandler JavaDoc.class.getMethod( "characters",
38                                                 new Class JavaDoc[]{char[].class, Integer.TYPE, Integer.TYPE} );
39         }
40         catch( Exception JavaDoc e )
41         {
42             e.printStackTrace();
43             throw new IllegalStateException JavaDoc( "Problem getting sax methods: " + e );
44         }
45     }
46 }
47
Popular Tags