001 /*
002 * Licensed under the Apache License, Version 2.0 (the "License");
003 * you may not use this file except in compliance with the License.
004 * You may obtain a copy of the License at
005 *
006 * http://www.apache.org/licenses/LICENSE-2.0
007 *
008 * Unless required by applicable law or agreed to in writing, software
009 * distributed under the License is distributed on an "AS IS" BASIS,
010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
011 * See the License for the specific language governing permissions and
012 * limitations under the License.
013 */
014 package org.apache.commons.classscan.model;
015
016 import java.util.Set;
017
018 import org.apache.commons.classscan.HasName;
019
020 /**
021 * Metadata about a class method or constructor
022 */
023 public interface MetaMethod extends HasName {
024 /**
025 * Get the name of the method or constructor
026 */
027 String getName();
028
029 /**
030 * Get metadata about the annotations on the method or constructor.
031 *
032 * @return A read-only set of annotations
033 */
034 Set<? extends MetaAnnotation> getAnnotations();
035
036 /**
037 * Get metadata about a particular annotation on the corresponding method.
038 *
039 * @param annotationName
040 * The name of the annotation desired
041 *
042 * @return The annotation information, or null if not specified on the
043 * corresponding method
044 */
045 MetaAnnotation getAnnotation(String annotationName);
046
047 /**
048 * Get whether the corresponding method or constructor is a static method or
049 * static class initializer
050 */
051 boolean isStatic();
052
053 /**
054 * Get metadata about the return type of the method or constructor
055 *
056 * @return null, if the type is void return; otherwise, metadata about the
057 * type
058 */
059 MetaType getType();
060
061 /**
062 * Get metadata about the parameters of the method or constructor
063 *
064 * @return A read-only set of parameter information
065 */
066 Set<? extends MetaParameter> getParameters();
067 }