001 package org.shiftone.jrat.core.criteria;
002
003
004 import org.shiftone.jrat.util.log.Logger;
005
006
007 /**
008 * @author jeff@shiftone.org (Jeff Drost)
009 */
010 public class ConstantMethodCriteria implements MethodCriteria {
011
012 private static final Logger LOG = Logger.getLogger(ConstantMethodCriteria.class);
013 public static final MethodCriteria ALL = new ConstantMethodCriteria(true);
014 public static final MethodCriteria NONE = new ConstantMethodCriteria(false);
015 private boolean match;
016
017 private ConstantMethodCriteria(boolean match) {
018 this.match = match;
019 }
020
021
022 public boolean isMatch(String className, long modifier) {
023 return match;
024 }
025
026
027 public boolean isMatch(String className, String methodName, String signature, long modifier) {
028 return match;
029 }
030
031
032 public String toString() {
033
034 return match
035 ? "ALL"
036 : "NONE";
037 }
038 }