Code example for Pattern

Methods: pattern

0
      this.pattern = pattern;
    } 
 
    @Override 
    public final String getDomain() {
      return pattern == null ? "<String>" : pattern.pattern();
    } 
 
    @Override 
    final String parse(final String str) {
      if (pattern != null) {
        if (!pattern.matcher(str).matches()) {
          throw new IllegalArgumentException("Invalid value: \"" + str
              + "\" does not belong to the domain " + getDomain()); 
        } 
      } 
      return str;
    } 
  } 
}