Package java.util.regex

Examples of java.util.regex.Matcher.matches()


          return false;
        }
      }
      // second step: regex search
      Matcher matcher = mPattern.matcher(value);
      return matcher.matches();
    }
  }


  /**
 
View Full Code Here


   
    for (int i = 0; i < m.length; i++) {
      if (m[i].getName().equals("getClass")) continue;
      if (m[i].getParameterTypes().length > 0) continue;
      Matcher r = p.matcher(m[i].getName());
      if (r.matches()) {
        try {
          values.put(r.group(1).toLowerCase(), m[i].invoke(bean, new Object[0]));
        } catch (IllegalArgumentException e) {
          throw e;
        } catch (IllegalAccessException e) {
View Full Code Here

        if (logger.isLoggable(Level.FINER)) {
      logger.finer("Executing: requestID " + getCurrentRequestID() + " commands: " + Arrays.toString(commands) + " expecting: " + resultsMode); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
        if (commands.length == 1) {
          Matcher match = SET_STATEMENT.matcher(commands[0]);
          if (match.matches()) {
            if (resultsMode == ResultsMode.RESULTSET) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
            }
            String key = match.group(1);
            String value = match.group(2);
View Full Code Here

            }
            this.updateCounts = new int[] {0};
            return booleanFuture(true);
          }
          match = TRANSACTION_STATEMENT.matcher(commands[0]);
          if (match.matches()) {
          logger.finer("Executing as transaction statement"); //$NON-NLS-1$
            if (resultsMode == ResultsMode.RESULTSET) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.set_result_set")); //$NON-NLS-1$
            }
            String command = match.group(1);
View Full Code Here

              return result;
            }
            return booleanFuture(false);
          }
          match = SHOW_STATEMENT.matcher(commands[0]);
          if (match.matches()) {
          logger.finer("Executing as show statement"); //$NON-NLS-1$
            if (resultsMode == ResultsMode.UPDATECOUNT) {
              throw new TeiidSQLException(JDBCPlugin.Util.getString("StatementImpl.show_update_count")); //$NON-NLS-1$
            }
            String show = match.group(1);
View Full Code Here

        return _literal;
    }

    public static XsDuration valueOf(String literal) throws XQueryException {
        final Matcher match = DURATION_PATTERN.matcher(literal);
        if(!match.matches()) {
            throw new DynamicError("err:FORG0001", "Illegal representation as xs:duration: "
                    + literal);
        }

        final String y, mo, d;
View Full Code Here

    else if (sql.equalsIgnoreCase("show max_identifier_length")){ //$NON-NLS-1$
      return "select 63"; //$NON-NLS-1$
    }
    else {
      Matcher m = setPattern.matcher(sql);
      if (m.matches()) {
        return "SET " + m.group(2) + " " + m.group(4); //$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.equalsIgnoreCase("BEGIN")) { //$NON-NLS-1$
        return "START TRANSACTION"; //$NON-NLS-1$
      }
View Full Code Here

   */
  private List matchRange( List torrents, String filter )
  {
    Matcher matcher = rangePattern.matcher(filter);
    List list = new ArrayList();
    if( matcher.matches() )
    {
      int minId = Integer.parseInt(matcher.group(1));
      if( minId == 0 )
        throw new AzureusCoreException("lower range must be greater than 0");
      if( minId > torrents.size() )
View Full Code Here

 
  private static Pattern CACHE_HINT = Pattern.compile("/\\*\\+?\\s*cache(\\(\\s*(pref_mem)?\\s*(ttl:\\d{1,19})?\\s*(updatable)?\\s*(scope:(session|vdb|user))?[^\\)]*\\))?[^\\*]*\\*\\/.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
   
  static CacheHint getQueryCacheOption(String query) {
      Matcher match = CACHE_HINT.matcher(query);
      if (match.matches()) {
        CacheHint hint = new CacheHint();
        if (match.group(2) !=null) {
          hint.setPrefersMemory(true);
        }
        String ttl = match.group(3);
View Full Code Here

            StylesheetInfo info = new StylesheetInfo();
            info = new StylesheetInfo();
            info.setOrigin(StylesheetInfo.AUTHOR);
            String pi = piNode.getData();
            Matcher m = _alternatePattern.matcher(pi);
            if (m.matches()) {
                int start = m.end();
                String alternate = pi.substring(start + 1, pi.indexOf(pi.charAt(start), start + 1));
                //TODO: handle alternate stylesheets
                if (alternate.equals("yes")) continue;//DON'T get alternate stylesheets for now
            }
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.