Examples of FieldPattern


Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertTrue(fieldPattern.matchFieldType("java.lang.StringBuffer"));
        assertTrue(fieldPattern.matchFieldType("java.lang.String"));
    }

    public void testMatchFieldType6() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("java.lang.String[] m_field");

        assertFalse(fieldPattern.matchFieldType(""));
        assertFalse(fieldPattern.matchFieldType("java.util.List[]"));
        assertFalse(fieldPattern.matchFieldType("java.lang.StringBuffer[]"));
        assertTrue(fieldPattern.matchFieldType("java.lang.String[]"));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertFalse(fieldPattern.matchFieldType("java.lang.StringBuffer[]"));
        assertTrue(fieldPattern.matchFieldType("java.lang.String[]"));
    }

    public void testMatchFieldType7() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("java.lang.String m_field");

        assertFalse(fieldPattern.matchFieldType(""));
        assertTrue(fieldPattern.matchFieldType("java.lang.String"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[]"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[][]"));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertFalse(fieldPattern.matchFieldType("java.lang.String[]"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[][]"));
    }

    public void testMatchFieldType8() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("java.lang.String[][] m_field");

        assertFalse(fieldPattern.matchFieldType(""));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[]"));
        assertTrue(fieldPattern.matchFieldType("java.lang.String[][]"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[][][]"));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertTrue(fieldPattern.matchFieldType("java.lang.String[][]"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String[][][]"));
    }

    public void testMatchFieldType9() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("String* m_field");

        assertFalse(fieldPattern.matchFieldType(""));
        // note: abbreviation not compatible with pattern matching
        assertFalse(fieldPattern.matchFieldType("java.lang.StringBuffer"));
        assertFalse(fieldPattern.matchFieldType("java.lang.String"));
        assertTrue(fieldPattern.matchFieldType("String"));
        assertTrue(fieldPattern.matchFieldType("StringBuffer"));

    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

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

    public void testMatchFieldName1() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("int m_field");

        assertFalse(fieldPattern.matchFieldName(""));
        assertTrue(fieldPattern.matchFieldName("m_field"));
        assertFalse(fieldPattern.matchFieldName("m_"));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertTrue(fieldPattern.matchFieldName("m_field"));
        assertFalse(fieldPattern.matchFieldName("m_"));
    }

    public void testMatchFieldName2() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("int m_*");

        assertFalse(fieldPattern.matchFieldName(""));
        assertTrue(fieldPattern.matchFieldName("m_field"));
        assertTrue(fieldPattern.matchFieldName("m_"));
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.regexp.FieldPattern

        assertTrue(fieldPattern.matchFieldName("m_field"));
        assertTrue(fieldPattern.matchFieldName("m_"));
    }

    public void testMatchFieldName3() {
        FieldPattern fieldPattern = Pattern.compileFieldPattern("int *");

        assertFalse(fieldPattern.matchFieldName(""));
        assertTrue(fieldPattern.matchFieldName("m_field"));
        assertTrue(fieldPattern.matchFieldName("m_"));
    }
View Full Code Here

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

  @SuppressWarnings("restriction")
  protected SearchPattern createStringPattern(String patternStr, int searchFor, int limitTo, int matchRule) {
    IDLTKLanguageToolkit toolkit = DeeLanguageToolkit.getDefault();
    SearchPattern pattern = SearchPattern.createPattern(patternStr, searchFor, limitTo, matchRule, toolkit);
    if(pattern instanceof FieldPattern) {
      FieldPattern fieldPattern = (FieldPattern) pattern;
      // we may have to work arround a DLTK bug here
      // -- we are still going to test this codepath, even though it's not accessible because of DLTK bug
      char[] name = ((FieldPattern) pattern).name;
      int lastIx = CharOperation.lastIndexOf('.', name);
      if(lastIx != -1) {
        // assume a problem occurred in DLTK where qualifiedName has not been split
        char[] qualification = CharOperation.subarray(fieldPattern.name, 0, lastIx);
        CharOperation.replace(qualification, '.', '$');
        char[] simpleName = CharOperation.subarray(fieldPattern.name, lastIx+1, -1);
       
        return new FieldPattern(fieldPattern.findDeclarations,
            fieldPattern.findReferences, fieldPattern.findReferences,
            simpleName, qualification, null,
            null, null, matchRule, toolkit);
       
      }
View Full Code Here

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

      //TypeDeclarationPattern only occurs if it is a focus element... at least as of current DLTK 3.0 version
//      TypeDeclarationPattern typeDeclPatter = (TypeDeclarationPattern) pattern;
      assertFail();
    }
    case IIndexConstants.FIELD_PATTERN: {
      FieldPattern fieldPattern = (FieldPattern) pattern;
      char[] simpleName = fieldPattern.name;
      @UsesReflectionToAccessInternalAPI
      char[] qualification = readInternalField(fieldPattern, "declaringQualification", null);
      return new DeeNameNodeMatcher(deeMatchLocator, pattern,
          fieldPattern.findDeclarations, simpleName, qualification);
View Full Code Here

Examples of org.openquark.cal.compiler.SourceModel.FieldPattern

        if(argBindings instanceof ArgBindings.Matching) {
           
            ArgBindings.Matching matchingArgBindings = (ArgBindings.Matching)argBindings;
           
            for (int i = 0; i < matchingArgBindings.getNFieldPatterns(); i++) {
                FieldPattern fieldPattern = matchingArgBindings.getNthFieldPattern(i);
                Pattern pattern = fieldPattern.getPattern();
               
                if (pattern == null) {
                    // punning.
                   
                    // Textual field names become Vars of the same name.
                    // Ordinal field names become wildcards ("_").
                    FieldName fieldName = fieldPattern.getFieldName().getName();
                    if (fieldName instanceof FieldName.Textual) {
                        pattern = Pattern.Var.make(fieldName.getCalSourceForm());
                    }
                }
               
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.