private Pattern getMethodPattern() { if (mMethdPtr == null) throw new RuntimeException("No pattern found for: " + mEntity.getMethod().toString()); if (mEntity.getTarget() != CodeUnitType.METHOD) throw new RuntimeException("Entity is not supposed to expse method: " + mEntity.toString()); return mMethdPtr; }
public boolean matches(String component, String clazz, String method) { switch (mEntity.getTarget()) { case COMPONENT: return getComponentPattern().matcher(component).matches(); case CLASS: return getComponentPattern().matcher(component).matches() && getClazzPattern().matcher(clazz).matches(); case METHOD: return getComponentPattern().matcher(component).matches() && getClazzPattern().matcher(clazz).matches() && getMethodPattern().matcher(method).matches(); default: throw new RuntimeException("Invalid pattern matching for entity: " + mEntity.toString()); } }