1 /* 2 * Copyright the original author or authors. 3 * 4 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (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.mozilla.org/MPL/MPL-1.1.html 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 import org.as2lib.core.BasicInterface; 18 import org.as2lib.env.reflect.TypeMemberInfo; 19 20 /** 21 * {@code TypeMemberFilter} filters the result of searches for type members. 22 * 23 * <p>You can pass it for example to the {@link ClassInfo#getMethodsByFilter} method 24 * to receive only methods that match your criteria. 25 * 26 * <p>Using this filter can mean a performance boost. Refer to the specific filter 27 * and search methods for more information. 28 * 29 * @author Simon Wacker 30 */ 31 interface org.as2lib.env.reflect.TypeMemberFilter extends BasicInterface { 32 33 /** 34 * Returns {@code true} if the passed-in {@code typeMember} shall be filtered, that 35 * means excluded from the result. 36 * 37 * <p>This method slows the whole algorithm down because it is invoked for every 38 * found type member that is not excluded by any of the other filter methods. So if 39 * you use it try to keep the checks simple. 40 * 41 * @param typeMember the type member to exclude from or to include in the result 42 * @return {@code true} if the {@code typeMember} shall be excluded else {@code false} 43 */ 44 public function filter(typeMember:TypeMemberInfo):Boolean; 45 46 /** 47 * Returns {@code true} if type members of super-types shall be filtered, that means 48 * excluded from the result. 49 * 50 * <p>Returning {@code true} can mean a performance boost because the algorithm does 51 * then not search for type members of super types. 52 * 53 * @return {@code true} if super types' type members shall be excluded else {@code false} 54 */ 55 public function filterSuperTypes(Void):Boolean; 56 57 /** 58 * Returns true if all static type members shall be filtered, that means 59 * excluded from the result. 60 * 61 * <p>Returning true can mean a performance boost because the algorithm 62 * does then not search for static type members. 63 * 64 * @return true if static type members shall be excluded else false 65 */ 66 //public function filterStatic(Void):Boolean; 67 68 /** 69 * Returns true if all non-static type members shall be filtered, that 70 * means excluded from the result. 71 * 72 * <p>Returning true can mean a performance boost because the algorithm 73 * does then not search for non-static type members. 74 * 75 * @return true if non-static type members shall be excluded else false 76 */ 77 //public function filterNonStatic(Void):Boolean; 78 79 }