Examples of MethodPattern


Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

        assertFalse(methodPattern.matchParameterTypes(new String[]{"java.lang.Integer"}));
        assertFalse(methodPattern.matchParameterTypes(new String[]{"java.lang.Integer[]"}));
    }

    public void testMatchReturnType1() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("* method()");
        assertTrue(methodPattern.matchReturnType("int"));
        assertTrue(methodPattern.matchReturnType("java.lang.String"));
        assertTrue(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

        assertTrue(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }

    public void testMatchReturnType2() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("String method()");
        assertFalse(methodPattern.matchReturnType("int"));
        assertTrue(methodPattern.matchReturnType("java.lang.String"));
        assertFalse(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

        assertFalse(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }

    public void testMatchReturnType3() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("java.lang.String method()");

        assertFalse(methodPattern.matchReturnType("int"));
        assertTrue(methodPattern.matchReturnType("java.lang.String"));
        assertFalse(methodPattern.matchReturnType("java.foo.String"));
        assertFalse(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

        assertFalse(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }

    public void testMatchReturnType4() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("java.lang.* method()");

        assertFalse(methodPattern.matchReturnType("int"));
        assertTrue(methodPattern.matchReturnType("java.lang.String"));
        assertTrue(methodPattern.matchReturnType("java.lang.StringBuffer"));
        assertTrue(methodPattern.matchReturnType("java.lang.Bar"));
        assertFalse(methodPattern.matchReturnType("java.foo.String"));
        assertFalse(methodPattern.matchReturnType("String"));
        assertFalse(methodPattern.matchReturnType(""));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

* @author <a href="mailto:jboner@codehaus.org">Jonas Bon�r</a>
*/
public class MethodPatternTest extends TestCase {

    public void testMatchMethodName1() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("* method(String, int)");
        assertTrue(methodPattern.matchMethodName("method"));
        assertFalse(methodPattern.matchMethodName("methods"));
        assertFalse(methodPattern.matchMethodName("meth"));
        assertFalse(methodPattern.matchMethodName(""));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.MethodPattern

        assertFalse(methodPattern.matchMethodName("meth"));
        assertFalse(methodPattern.matchMethodName(""));
    }

    public void testMatchMethodName2() {
        MethodPattern methodPattern = Pattern.compileMethodPattern("* meth*(..)");
        assertTrue(methodPattern.matchMethodName("method"));
        assertTrue(methodPattern.matchMethodName("methods"));
        assertTrue(methodPattern.matchMethodName("meth"));
        assertFalse(methodPattern.matchMethodName("m"));
        assertFalse(methodPattern.matchMethodName(""));
    }
View Full Code Here

Examples of org.eclipse.dltk.internal.core.search.matching.MethodPattern

//    case IIndexConstants.LOCAL_VAR_PATTERN: {
//      LocalVariablePattern varPattern = (LocalVariablePattern) pattern;
//      return new DeeNodePatternMatcher2Extension(deeMatchLocator, pattern, varPattern.name, null, null);
//    }
    case IIndexConstants.METHOD_PATTERN: {
      MethodPattern methodPattern = (MethodPattern) pattern;
      char[] simpleName = methodPattern.selector;
      char[] qualification = CharOperation.concat(methodPattern.declaringQualificationName,
          methodPattern.declaringSimpleName, '$');
      return new DeeNameNodeMatcher(deeMatchLocator, pattern, methodPattern.findDeclarations,
          simpleName, qualification);
View Full Code Here

Examples of org.eclipse.dltk.internal.core.search.matching.MethodPattern

      PHPCallExpression pce = (PHPCallExpression) reference;
      ISourceModule module = (ISourceModule) enclosingElement
          .getAncestor(IModelElement.SOURCE_MODULE);
      if (module != null) {
        try {
          MethodPattern methodPattern = (MethodPattern) pattern;
          IModelElement[] elements = module.codeSelect(pce
              .getCallName().sourceStart(), 0);
          if (elements == null || elements.length == 0) {
            return super.newMethodReferenceMatch(enclosingElement,
                accuracy, offset, length, isConstructor,
View Full Code Here

Examples of org.eclipse.jdt.internal.core.search.matching.MethodPattern

private static IJavaElement[] getFocusedElementsAndTypes(SearchPattern pattern, IJavaElement focusElement, ObjectVector superTypes) throws JavaModelException {
  if (pattern instanceof MethodPattern) {
    // For method pattern, it needs to walk along the focus type super hierarchy
    // and add jars/projects of all the encountered types.
    IType type = (IType) pattern.focus.getAncestor(IJavaElement.TYPE);
    MethodPattern methodPattern = (MethodPattern) pattern;
    String selector = new String(methodPattern.selector);
    int parameterCount = methodPattern.parameterCount;
    ITypeHierarchy superHierarchy = type.newSupertypeHierarchy(null);
    IType[] allTypes = superHierarchy.getAllSupertypes(type);
    int length = allTypes.length;
View Full Code Here

Examples of org.eclipse.jdt.internal.core.search.matching.MethodPattern

private static IJavaElement[] getFocusedElementsAndTypes(SearchPattern pattern, IJavaElement focusElement, ObjectVector superTypes) throws JavaModelException {
  if (pattern instanceof MethodPattern) {
    // For method pattern, it needs to walk along the focus type super hierarchy
    // and add jars/projects of all the encountered types.
    IType type = (IType) pattern.focus.getAncestor(IJavaElement.TYPE);
    MethodPattern methodPattern = (MethodPattern) pattern;
    String selector = new String(methodPattern.selector);
    int parameterCount = methodPattern.parameterCount;
    ITypeHierarchy superHierarchy = type.newSupertypeHierarchy(null);
    IType[] allTypes = superHierarchy.getAllSupertypes(type);
    int length = allTypes.length;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.