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.PackageMemberInfo; 19 20 /** 21 * {@code PackageMemberInfo} filters the result of searches for package members, 22 * that are types and packages. 23 * 24 * <p>You can pass it for example to the {@link PackageInfo#getMemberClasses} or 25 * {@link PackageInfo#getMemberPackages} methods to receive only classes or packages 26 * that match your criteria. 27 * 28 * <p>Using this filter can mean a performance boost. Refer to the specific filter 29 * and search methods for more information. 30 * 31 * @author Simon Wacker 32 */ 33 interface org.as2lib.env.reflect.PackageMemberFilter extends BasicInterface { 34 35 /** 36 * Returns {@code true} if the passed-in {@code packageMember} shall be filtered, 37 * that means excluded from the result. 38 * 39 * <p>This method slows the whole algorithm down because it is invoked for every 40 * found package member that is not excluded by any of the other filter methods. So 41 * if you use it try to keep the checks simple. 42 * 43 * @param packageMember the package member to exclude from or to include in the result 44 * @return {@code true} if the {@code packageMember} shall be excluded else {@code false} 45 */ 46 public function filter(packageMember:PackageMemberInfo):Boolean; 47 48 /** 49 * Returns {@code true} if package members of sub-packages shall be filtered, that 50 * means excluded from the result. 51 * 52 * <p>Returning {@code true} can mean a performance boost because the algorithm does 53 * then not search for package members of sub-packages. 54 * 55 * @return {@code true} if sub-packages' package members shall be excluded else {@code false} 56 */ 57 public function filterSubPackages(Void):Boolean; 58 59 }