Package com.google.common.base

Examples of com.google.common.base.Splitter


    return createPrefix(groupId, relevantArtifactId);
  }

  @Nonnull
  private static String createPrefix(@Nonnull String relevantGroupId, @Nonnull String relevantArtifactId) {
    Splitter splitter = Splitter.on(new PackageSeparatorCharMatcher());

    List<String> partsList = Lists.newArrayList(splitter.split(relevantGroupId));
    partsList.addAll(Lists.<String>newArrayList(splitter.split(relevantArtifactId)));


    return Joiner.on(File.separator).join(partsList);
  }
View Full Code Here


    }

    @Inject(value = "struts.freeroute.controllerSuffixes", required = true)
    private void setControllerSuffixes(String controllerSuffixes) {

        Splitter splitter = Splitter.on(",").trimResults().omitEmptyStrings();
        this.controllerSuffixes = Sets.newHashSet(splitter.split(controllerSuffixes));
    }
View Full Code Here

        if (getName().getLocalName().equals(NodeOperationType.NODE_LOCAL_NAME)) {
            return;
        }

        // everything else should be merged, duplicates should be eliminated.
        Splitter splitter = Splitter.on(',');
        ImmutableSet.Builder<String> targetValues = ImmutableSet.builder();
        targetValues.addAll(splitter.split(higherPriority.getValue()));
        targetValues.addAll(splitter.split(getValue()));
        higherPriority.getXml().setValue(Joiner.on(',').join(targetValues.build()));
    }
View Full Code Here

                    qualifiers.add(item.getQualifiers());
                }
            }
        }

        Splitter splitter = Splitter.on('-');
        for (String s : qualifiers) {
            for (String qualifier : splitter.split(s)) {
                if (qualifier.length() == 2 && Character.isLetter(qualifier.charAt(0))
                        && Character.isLetter(qualifier.charAt(1))) {
                    set.add(qualifier);
                }
            }
View Full Code Here

                    qualifiers.add(item.getQualifiers());
                }
            }
        }

        Splitter splitter = Splitter.on('-');
        for (String s : qualifiers) {
            boolean rightLanguage = false;
            for (String qualifier : splitter.split(s)) {
                if (currentLanguage.equals(qualifier)) {
                    rightLanguage = true;
                } else if (rightLanguage
                        && qualifier.length() == 3
                        && qualifier.charAt(0) == 'r'
View Full Code Here

    return createPrefix(groupId, relevantArtifactId);
  }

  @Nonnull
  private static String createPrefix(@Nonnull String relevantGroupId, @Nonnull String relevantArtifactId) {
    Splitter splitter = Splitter.on(new PackageSeparatorCharMatcher());

    List<String> partsList = Lists.newArrayList(splitter.split(relevantGroupId));
    partsList.addAll(Lists.<String>newArrayList(splitter.split(relevantArtifactId)));


    return Joiner.on(File.separator).join(partsList);
  }
View Full Code Here

        if (comment != null && !comment.isEmpty())
        {
            write(out, pad0, COMMENT_SEPARATOR);
            write(out, pad0, "# ", name);
            write(out, pad0, "#--------------------------------------------------------------------------------------------------------#");
            Splitter splitter = Splitter.onPattern("\r?\n");

            for (String line : splitter.split(comment))
            {
                write(out, pad0, "# ", line);
            }

            write(out, pad0, COMMENT_SEPARATOR, NEW_LINE);
        }

        String displayName = name;

        if (!allowedProperties.matchesAllOf(name))
        {
            displayName = '"' + name + '"';
        }

        write(out, pad0, displayName, " {");

        Property[] props = getOrderedValues().toArray(new Property[] {});

        for (int x = 0; x < props.length; x++)
        {
            Property prop = props[x];

            if (prop.comment != null && !prop.comment.isEmpty())
            {
                if (x != 0)
                {
                    out.newLine();
                }

                Splitter splitter = Splitter.onPattern("\r?\n");
                for (String commentLine : splitter.split(prop.comment))
                {
                    write(out, pad1, "# ", commentLine);
                }
            }
View Full Code Here

    this.testCasePropertyName = testCasePropertyName;
    this.sourceDirectory = sourceDirectory;
    this.logger = logger;
  }
  private List<TestBatch> parseTests() {
    Splitter splitter = Splitter.on(" ").trimResults().omitEmptyStrings();
    Context unitContext = new Context(context.getSubProperties(
        Joiner.on(".").join("unitTests", "")));
    Set<String> excluded = Sets.newHashSet(splitter.split(unitContext.getString("exclude", "")));
    Set<String> isolated = Sets.newHashSet(splitter.split(unitContext.getString("isolate", "")));
    Set<String> included = Sets.newHashSet(splitter.split(unitContext.getString("include", "")));
    if(!included.isEmpty() && !excluded.isEmpty()) {
      throw new IllegalArgumentException(String.format("Included and excluded mutally exclusive." +
          " Included = %s, excluded = %s", included.toString(), excluded.toString()));
    }
    List<File> unitTestsDirs = Lists.newArrayList();
View Full Code Here

      }
    }
    return result;
  }
  private List<QFileTestBatch> parseQFileTests() {
    Splitter splitter = Splitter.on(" ").trimResults().omitEmptyStrings();
    List<QFileTestBatch> result = Lists.newArrayList();
    for(String alias : context.getString("qFileTests", "").split(" ")) {
      Context testContext = new Context(context.getSubProperties(
          Joiner.on(".").join("qFileTest", alias, "")));
      String driver = checkNotNull(testContext.getString("driver"), "driver").trim();
      // execute the driver locally?
      boolean isParallel = !testContext.getBoolean("isolateDriver", false);
      File directory = new File(sourceDirectory,
          checkNotNull(testContext.getString("directory"), "directory").trim());
      Set<String> excludedTests = Sets.newHashSet();
      for(String excludedTestGroup : splitter.split(testContext.getString("exclude", ""))) {
        excludedTests.addAll(Arrays.asList(testContext.
            getString(Joiner.on(".").join("groups", excludedTestGroup), "").trim().split(" ")));
      }
      Set<String> isolatedTests = Sets.newHashSet();
      for(String ioslatedTestGroup : splitter.split(testContext.getString("isolate", ""))) {
        isolatedTests.addAll(Arrays.asList(testContext.
            getString(Joiner.on(".").join("groups", ioslatedTestGroup), "").trim().split(" ")));
      }

      Set<String> includedTests = Sets.newHashSet();
      for(String includedTestGroup : splitter.split(testContext.getString("include", ""))) {
        includedTests.addAll(Arrays.asList(testContext.
            getString(Joiner.on(".").join("groups", includedTestGroup), "").trim().split(" ")));
      }
      if(!includedTests.isEmpty() && !excludedTests.isEmpty()) {
        throw new IllegalArgumentException(String.format("Included and excluded mutally exclusive." +
View Full Code Here

        System.out.println(sink1);
        return sink1 != null && sink1 == 20 && defaultV != null && defaultV == 30;
    }

    private Map<String, Object> makeMessage(String path, Object value) {
        Splitter splitter = Splitter.on("/").omitEmptyStrings().trimResults();

        List<String> keys = Lists.newArrayList(splitter.split(path));
        Map<String, Object> result = Maps.newHashMap();
        Map<String, Object> current = result;
        for(int i = 0; i < keys.size() - 1; ++i) {
            Map<String, Object> map = Maps.newHashMap();
            current.put(keys.get(i), map);
View Full Code Here

TOP

Related Classes of com.google.common.base.Splitter

Copyright © 2018 www.massapicom. 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.