Exemplo n.º 1
0
 public static String getClassName(final Extension.Instrumentation.Pointcut cut) {
   if (cut.getClassName() != null) {
     return cut.getClassName().getValue().trim();
   }
   if (cut.getInterfaceName() != null) {
     return cut.getInterfaceName().trim();
   }
   return null;
 }
Exemplo n.º 2
0
 static ClassMatcher createClassMatcher(
     final Extension.Instrumentation.Pointcut pointcut, final String pExtName)
     throws XmlException {
   final Extension.Instrumentation.Pointcut.ClassName className = pointcut.getClassName();
   if (className != null) {
     if (className.getValue() == null || className.getValue().isEmpty()) {
       throw new XmlException("");
     }
     if (className.isIncludeSubclasses()) {
       return new ChildClassMatcher(className.getValue(), false);
     }
     return new ExactClassMatcher(className.getValue());
   } else {
     if (pointcut.getInterfaceName() != null) {
       return new InterfaceMatcher(pointcut.getInterfaceName());
     }
     throw new XmlException(
         MessageFormat.format(
             "A class name, interface name, or super class name needs to be specified for every point cut in the extension {0}",
             pExtName));
   }
 }