01: /*
02: * Copyright (C) The DNA Group. All rights reserved.
03: *
04: * This software is published under the terms of the DNA
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna.impl;
09:
10: import java.lang.reflect.Method;
11: import org.xml.sax.Attributes;
12: import org.xml.sax.ContentHandler;
13:
14: class SAXMethods {
15: static final Method START_DOCUMENT;
16: static final Method END_DOCUMENT;
17: static final Method START_ELEMENT;
18: static final Method END_ELEMENT;
19: static final Method CHARACTERS;
20:
21: static {
22: try {
23: START_DOCUMENT = ContentHandler.class.getMethod(
24: "startDocument", new Class[0]);
25: END_DOCUMENT = ContentHandler.class.getMethod(
26: "endDocument", new Class[0]);
27: START_ELEMENT = ContentHandler.class.getMethod(
28: "startElement", new Class[] { String.class,
29: String.class, String.class,
30: Attributes.class });
31: END_ELEMENT = ContentHandler.class.getMethod("endElement",
32: new Class[] { String.class, String.class,
33: String.class });
34: CHARACTERS = ContentHandler.class.getMethod("characters",
35: new Class[] { char[].class, Integer.TYPE,
36: Integer.TYPE });
37: } catch (Exception e) {
38: e.printStackTrace();
39: throw new IllegalStateException(
40: "Problem getting sax methods: " + e);
41: }
42: }
43: }
|