Package java.util.regex

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


    if ((line == null) || ((filter != null) && !filter.isValid(line)))
      return null;
   
    Matcher m = lineMatch.matcher(line);
    if (!m.matches()) {
      System.out.println("Line " + line + " doesn't match " + m.pattern().pattern());
      return null;
    }
   
    String[] lineParts = line.split(delimiter);
    CDR cdr = new CDR();
View Full Code Here


        }
      } else if ( StringUtils.equals( fileExtension, "properties" ) ) {
        for ( final Pattern propertyBundlePattern : propertyBundlePatternsNoPostfix ) {
          final Matcher propertyBundleMatcher = propertyBundlePattern.matcher( internalPath );
          if ( propertyBundleMatcher.matches() ) {
            log.trace( "MATCH: [" + internalPath + "] by [" + propertyBundleMatcher.pattern() + "] - group(s)=["
                + propertyBundleMatcher.group( 1 ) + " : " + propertyBundleMatcher.group( 2 ) + "]" );
            initialize( FileType.PROPERTIES, propertyBundleMatcher.group( 1 ), propertyBundleMatcher.group( 2 ) );
            break;
          }
        }
View Full Code Here

          }
        }
        for ( final Pattern propertyBundlePattern : propertyBundlePatternsWithPostfix ) {
          final Matcher propertyBundleMatcher = propertyBundlePattern.matcher( internalPath );
          if ( propertyBundleMatcher.matches() ) {
            log.trace( "MATCH: [" + internalPath + "] by [" + propertyBundleMatcher.pattern() + "] - group(s)=["
                + propertyBundleMatcher.group( 1 ) + " : " + propertyBundleMatcher.group( 2 ) + "]" );
            initialize( FileType.PROPERTIES, propertyBundleMatcher.group( 1 ) + PROPERTY_BUNDLE_DOMAIN_POSTFIX,
                propertyBundleMatcher.group( 2 ) );
            break;
          }
View Full Code Here

    private Sequence match(String string, String pattern, int flags) throws XPathException {
        try {
          Matcher matcher;
      if(cachedRegexp == null || (!cachedRegexp.equals(pattern)) || flags != cachedPattern.flags()) {
        matcher = Pattern.compile(pattern, flags).matcher(string);
        cachedPattern = matcher.pattern();
        cachedRegexp = string;
            } else {
              matcher = cachedPattern.matcher(string);
            }
           
View Full Code Here

   @Override
   public void reviseParsedImage(org.jclouds.ec2.domain.Image from, ImageBuilder builder, OsFamily family,
            OperatingSystem.Builder osBuilder) {
      try {
         Matcher matcher = getMatcherAndFind(from.getImageLocation());
         if (matcher.pattern() == AMZN_PATTERN) {
            osBuilder.family(OsFamily.AMZN_LINUX);
            osBuilder.version(matcher.group(2));
            builder.version(matcher.group(2));
         } else if (matcher.pattern() == AMAZON_PATTERN) {
            family = OsFamily.fromValue(matcher.group(1));
View Full Code Here

         Matcher matcher = getMatcherAndFind(from.getImageLocation());
         if (matcher.pattern() == AMZN_PATTERN) {
            osBuilder.family(OsFamily.AMZN_LINUX);
            osBuilder.version(matcher.group(2));
            builder.version(matcher.group(2));
         } else if (matcher.pattern() == AMAZON_PATTERN) {
            family = OsFamily.fromValue(matcher.group(1));
            osBuilder.family(family);
            osBuilder.version(ComputeServiceUtils.parseVersionOrReturnEmptyString(family, matcher.group(2),
                     osVersionMap));
         } else {
View Full Code Here

                // set security context
                resource.setSecurityContext(securityContext);

                if (resource.checkAndConfigure(part, securityContext, request)) {

                  logger.log(Level.FINE, "{0} matched, adding resource of type {1} for part {2}", new Object[] { matcher.pattern(), type.getName(),
                    part });

                  // allow constraint to modify context
                  resource.configurePropertyView(propertyView);
                  resource.configureIdProperty(defaultIdProperty);
View Full Code Here

   @Override
   public void reviseParsedImage(org.jclouds.ec2.domain.Image from, ImageBuilder builder, OsFamily family,
            OperatingSystem.Builder osBuilder) {
      try {
         Matcher matcher = getMatcherAndFind(from.getImageLocation());
         if (matcher.pattern() == AMZN_PATTERN) {
            osBuilder.family(OsFamily.AMZN_LINUX);
            osBuilder.version(matcher.group(2));
            builder.version(matcher.group(2));
         } else if (matcher.pattern() == AMAZON_PATTERN) {
            family = OsFamily.fromValue(matcher.group(1));
View Full Code Here

         Matcher matcher = getMatcherAndFind(from.getImageLocation());
         if (matcher.pattern() == AMZN_PATTERN) {
            osBuilder.family(OsFamily.AMZN_LINUX);
            osBuilder.version(matcher.group(2));
            builder.version(matcher.group(2));
         } else if (matcher.pattern() == AMAZON_PATTERN) {
            family = OsFamily.fromValue(matcher.group(1));
            osBuilder.family(family);
            osBuilder.version(ComputeServiceUtils.parseVersionOrReturnEmptyString(family, matcher.group(2),
                     osVersionMap));
         } else {
View Full Code Here

      } else {
        logger.error("{} does not match any know IRtrans command",command);
      }

    } else {
      logger.error("{} does not match the IRtrans message formet ({})",message,matcher.pattern());
    }
  }


  protected void parseIRDBMessage(String itemName,String message, Command ohCommand){
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.