Logo Search packages:      
Sourcecode: aspectj version File versions  Download package

String org::aspectj::weaver::loadtime::ClassLoaderWeavingAdaptor::looksLikeStartsWith ( String  typePattern  )  [inline, private]

Checks if the type pattern can be handled as a startswith check

TODO AV - enhance to support "char.sss" ie FQN direclty (match iff equals) we could also add support for "*..*charss" endsWith style?

Parameters:
typePattern 
Returns:
null if not possible, or the startWith sequence to test against

Definition at line 560 of file ClassLoaderWeavingAdaptor.java.

                                                             {
            if (typePattern.indexOf('@') >= 0 || typePattern.indexOf('+') >= 0 || typePattern.indexOf(' ') >= 0
                        || typePattern.charAt(typePattern.length() - 1) != '*') {
                  return null;
            }
            // now must looks like with "charsss..*" or "cha.rss..*" etc
            // note that "*" and "*..*" won't be fast matched
            // and that "charsss.*" will not neither
            int length = typePattern.length();
            if (typePattern.endsWith("..*") && length > 3) {
                  if (typePattern.indexOf("..") == length - 3 // no ".." before last sequence
                              && typePattern.indexOf('*') == length - 1) { // no "*" before last sequence
                        return typePattern.substring(0, length - 2).replace('$', '.');
                        // ie "charsss." or "char.rss." etc
                  }
            }
            return null;
      }


Generated by  Doxygen 1.6.0   Back to index