001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020package org.apache.isis.core.metamodel.facetapi; 021 022import java.lang.reflect.Method; 023import java.util.List; 024 025import org.apache.isis.core.metamodel.methodutils.MethodScope; 026 027/** 028 * Removes the methods from further processing by subsequent {@link Facet}s. 029 */ 030public interface MethodRemover { 031 032 /** 033 * Locate all methods (that the implementation should somehow know about) 034 * that match the criteria and remove them from the implementation's list so 035 * that they are not considered for subsequent scans. 036 * 037 * @param methodScope 038 * - whether looking for <tt>static</tt> (class) or 039 * instance-level methods. 040 * @return any methods that were removed. 041 */ 042 List<Method> removeMethods(final MethodScope methodScope, final String prefix, final Class<?> returnType, final boolean canBeVoid, final int paramCount); 043 044 /** 045 * Locate all methods (that the implementation should somehow know about) 046 * that match the criteria and remove them from the implementation's list so 047 * that they are not considered for subsequent scans. 048 * 049 * @param forClass 050 * - if <tt>true</tt>, then looking for <tt>static</tt> methods 051 * (otherwise instance methods). 052 */ 053 void removeMethod(MethodScope methodScope, String methodName, Class<?> returnType, Class<?>[] parameterTypes); 054 055 void removeMethod(Method method); 056 057 void removeMethods(List<Method> methods); 058 059}