KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > trace > ExtensionEvent


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 /*
17  * $Id: ExtensionEvent.java,v 1.2 2004/02/16 23:00:27 minchau Exp $
18  */

19  
20 package org.apache.xalan.trace;
21
22 import java.lang.reflect.Constructor JavaDoc;
23 import java.lang.reflect.Method JavaDoc;
24
25 import org.apache.xalan.transformer.TransformerImpl;
26
27 /**
28  * An event representing an extension call.
29  */

30 public class ExtensionEvent {
31
32     public static final int DEFAULT_CONSTRUCTOR = 0;
33     public static final int METHOD = 1;
34     public static final int CONSTRUCTOR = 2;
35     
36     public final int m_callType;
37     public final TransformerImpl m_transformer;
38     public final Object JavaDoc m_method;
39     public final Object JavaDoc m_instance;
40     public final Object JavaDoc[] m_arguments;
41     
42     
43     public ExtensionEvent(TransformerImpl transformer, Method JavaDoc method, Object JavaDoc instance, Object JavaDoc[] arguments) {
44         m_transformer = transformer;
45         m_method = method;
46         m_instance = instance;
47         m_arguments = arguments;
48         m_callType = METHOD;
49     }
50
51     public ExtensionEvent(TransformerImpl transformer, Constructor JavaDoc constructor, Object JavaDoc[] arguments) {
52         m_transformer = transformer;
53         m_instance = null;
54         m_arguments = arguments;
55         m_method = constructor;
56         m_callType = CONSTRUCTOR;
57     }
58
59     public ExtensionEvent(TransformerImpl transformer, Class JavaDoc clazz) {
60         m_transformer = transformer;
61         m_instance = null;
62         m_arguments = null;
63         m_method = clazz;
64         m_callType = DEFAULT_CONSTRUCTOR;
65     }
66
67 }
68
69
Popular Tags