Package java.util.regex

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


    }

    private static String resolveMethodArgs(GroovyRootDoc rootDoc, SimpleGroovyClassDoc classDoc, String type) {
        if (type.indexOf("(") < 0) return type;
        Matcher m = NAME_ARGS_REGEX.matcher(type);
        if (m.matches()) {
            String name = m.group(1);
            String args = m.group(2);
            StringBuilder sb = new StringBuilder();
            sb.append(name);
            sb.append("(");
View Full Code Here


    public static boolean isCase(Pattern caseValue, Object switchValue) {
        if (switchValue == null) {
            return caseValue == null;
        }
        final Matcher matcher = caseValue.matcher(switchValue.toString());
        if (matcher.matches()) {
            RegexSupport.setLastMatcher(matcher);
            return true;
        } else {
            return false;
        }
View Full Code Here

    public HttpRequestParser(ByteBuffer buf)
    {
        super( buf );
        uri = extractURI();
        Matcher matcher = pAcceptEncoding.matcher( getCharHeader() );
        setCompression( (matcher.matches() && (matcher.group( 1 ).indexOf( "gzip" ) > -1)) );
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here

    protected String extractURI()
    {
        try
        {
            Matcher m = pUri.matcher( getCharHeader() );
            if ( m.matches() )
            {
                return m.group( 1 ).trim();
            }
        }
        catch ( Exception e )
View Full Code Here

    public HttpResponseParser(ByteBuffer buf)
    {
        super( buf );
        code = extractCode();
        Matcher matcher = pEncoding.matcher( getCharHeader() );
        setCompression( (matcher.matches() && (matcher.group( 1 ).indexOf( "gzip" ) > -1)) );
    }

    /**
     * Returns the response status code, eg. 200 OK
     *
 
View Full Code Here

    protected int extractContentLength()
    {
        try
        {
            Matcher matcher = pContentLength.matcher( getCharHeader() );
            if ( matcher.matches() )
            {
                return Integer.parseInt( matcher.group( 1 ).trim() );
            }

        }
View Full Code Here

    protected boolean isConnectionPersistent()
    {
        try
        {
            Matcher matcher = pConnection.matcher( getCharHeader() );
            if ( matcher.matches() )
            {
                return matcher.group( 1 ).trim().equalsIgnoreCase( "keep-alive" );
            }
        }
        catch ( Exception e )
View Full Code Here

    String retVal = arg0;
    if(fileNumber!=null){
      String numberPatter = "";
      String startingValue = "";
      Matcher m = Pattern.compile(FILE_NUMBER_REGX).matcher(arg0);
      if(m.matches()){
        numberPatter = m.group(3);
        startingValue = m.group(4);
      }
      int fileNum = 0;
      //user entered a starting number
View Full Code Here

  private String applyPagenumber(String arg0, Integer pageNumber){
    String retVal = arg0;
    if(pageNumber!=null){
      String numberPatter = "";
      Matcher m = Pattern.compile(CURRENT_PAGE_REGX).matcher(arg0);
      if(m.matches()){
        numberPatter = m.group(3);
      }
      String replacement = "";
      if(numberPatter!=null && numberPatter.length()>0){
        replacement = getFileNumberFormatter(numberPatter).format(pageNumber.intValue());
View Full Code Here

    theQuery.add(tq, BooleanClause.Occur.SHOULD);
  }
  */
  wt = WT_TRANSFORM;
  Matcher matcher = whatPattern.matcher(question);
  if ( (matcher.matches()) && (nouns.size() > 0) )
  {  String qTransform = "\"" + nouns.get(0) + "_is" + "\"";
     queryString.append("contents:" + qTransform + "^" + nf.format(wt) + " ");
     TermQuery tq = new TermQuery( new Term("contents", qTransform)); tq.setBoost(wt);
     theQuery.add(tq, BooleanClause.Occur.SHOULD);
     qTransform = "\"" + nouns.get(0) + "_was" + "\"";
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.