1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 /* 19 * $Id$ 20 */ 21 22 package org.apache.xalan.trace; 23 24 import java.lang.reflect.Constructor; 25 import java.lang.reflect.Method; 26 27 import org.apache.xalan.transformer.TransformerImpl; 28 29 /** 30 * An event representing an extension call. 31 */ 32 public class ExtensionEvent { 33 34 public static final int DEFAULT_CONSTRUCTOR = 0; 35 public static final int METHOD = 1; 36 public static final int CONSTRUCTOR = 2; 37 38 public final int m_callType; 39 public final TransformerImpl m_transformer; 40 public final Object m_method; 41 public final Object m_instance; 42 public final Object[] m_arguments; 43 44 ExtensionEvent(TransformerImpl transformer, Method method, Object instance, Object[] arguments)45 public ExtensionEvent(TransformerImpl transformer, Method method, Object instance, Object[] arguments) { 46 m_transformer = transformer; 47 m_method = method; 48 m_instance = instance; 49 m_arguments = arguments; 50 m_callType = METHOD; 51 } 52 ExtensionEvent(TransformerImpl transformer, Constructor constructor, Object[] arguments)53 public ExtensionEvent(TransformerImpl transformer, Constructor constructor, Object[] arguments) { 54 m_transformer = transformer; 55 m_instance = null; 56 m_arguments = arguments; 57 m_method = constructor; 58 m_callType = CONSTRUCTOR; 59 } 60 ExtensionEvent(TransformerImpl transformer, Class clazz)61 public ExtensionEvent(TransformerImpl transformer, Class clazz) { 62 m_transformer = transformer; 63 m_instance = null; 64 m_arguments = null; 65 m_method = clazz; 66 m_callType = DEFAULT_CONSTRUCTOR; 67 } 68 69 } 70 71