001    /*
002     * Copyright 2002-2004 The Apache Software Foundation
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.apache.commons.clazz.reflect.standard;
017    
018    import org.apache.commons.clazz.ClazzLoader;
019    import org.apache.commons.clazz.reflect.ReflectedClazz;
020    import org.apache.commons.clazz.reflect.ReflectedInstanceFactoryIntrospector;
021    import org.apache.commons.clazz.reflect.ReflectedOperationIntrospector;
022    import org.apache.commons.clazz.reflect.ReflectedPropertyIntrospector;
023    import org.apache.commons.clazz.reflect.common.*;
024    
025    /**
026     * 
027     * @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
028     * @version $Id: StandardReflectedClazz.java 155436 2005-02-26 13:17:48Z dirkv $
029     */
030    public class StandardReflectedClazz extends ReflectedClazz {
031    
032        /**
033         * The standard list of introspectors consists of Indexed and Scalar
034         * property introspectors.
035         */
036        public static final 
037                ReflectedPropertyIntrospector[] PROPERTY_INTROSPECTORS =
038            new ReflectedPropertyIntrospector[] {
039                new StandardReflectedListPropertyIntrospector(),
040                new ReflectedScalarPropertyIntrospector() };
041    
042        /**
043         * The standard list of introspectors consists just the basic method-to-
044         * operation introspector.
045         */
046        public static final
047                ReflectedOperationIntrospector[] OPERATION_INTROSPECTORS =
048            new ReflectedOperationIntrospector[] {
049                new ReflectedMethodOperationIntrospector()
050            };
051    
052        /**
053         * The standard list of introspectors consists just the basic constructor-
054         * to-factory introspector.
055         */
056        public static final
057            ReflectedInstanceFactoryIntrospector[] INSTANCE_FACTORY_INTROSPECTORS =
058            new ReflectedInstanceFactoryIntrospector[] {
059                new ReflectedConstructorInstanceFactoryIntrospector(),
060                new ReflectedMethodInstanceFactoryIntrospector()
061            };
062    
063        /**
064         * Constructor for StandardReflectedClazz.
065         */
066        public StandardReflectedClazz(ClazzLoader loader, Class instanceClass) {
067            super(loader, instanceClass);
068        }
069    
070        protected ReflectedPropertyIntrospector[] getPropertyIntrospectors() {
071            return PROPERTY_INTROSPECTORS;
072        }
073    
074        protected ReflectedOperationIntrospector[] getOperationIntrospectors() {
075            return OPERATION_INTROSPECTORS;
076        }
077    
078        protected ReflectedInstanceFactoryIntrospector[] 
079                getInstanceFactoryIntrospectors() 
080        {
081            return INSTANCE_FACTORY_INTROSPECTORS;
082        }
083    }