code: public static Criteria parse(final String string,
              @Nullable final Map<String, String> namespaces) throws ParseException {
  
          Preconditions.checkNotNull(string);
  
          final List<Criteria> criteria = Lists.newArrayList();
          final List<URI> uris = Lists.newArrayList();
          String name = null;
  
          try {
              for (final String token : string.split("[\\s\\,]+")) {
                  if ("*".equals(token)) {
                      criteria.add(create(name, uris.toArray(new URI[uris.size()])));
                      name = null;
                      uris.clear();
  
                  } else if (token.startsWith("<") && token.endsWith(">") //
                          || token.indexOf(':') >= 0) {
                      uris.add((URI) Data.parseValue(token, namespaces));
  
                  } else if (name != null || !uris.isEmpty()) {
                      criteria.add(create(name, uris.toArray(new URI[uris.size()])));
                      name = token;
                      uris.clear();
  
                  } else {
                      name = token;
                  }
              }
  
              if (!uris.isEmpty()) {
                  criteria.add(create(name, uris.toArray(new URI[uris.size()])));
              }
  
              return criteria.size() == 1 ? criteria.get(0) : compose(criteria
                      .toArray(new Criteria[criteria.size()]));
  
          } catch (final Exception ex) {
              throw new ParseException(string, "Invalid criteria string - " + ex.getMessage(), ex);
          }
      }
docs: Parses the supplied string specification of a merge criteria, returning the parsed
  {@code Criteria} object. The string must adhere to the format specified in the main Javadoc
  comment.
  
  @param string
  the specification of the merge criteria
  @param namespaces
  the namespace map to be used for parsing the string, null if no mapping should
  be used
  @return the parsed {@code Criteria}, on success
  @throws ParseException
  in case the specification string is not valid