@Override public char peek() { if (!hasNext()) { throw new NoSuchElementException(); } return s.charAt(pos); }
/** * Parse a template. * * @param template the template. * @throws IllegalArgumentException if the template is null, an empty string * or does not conform to a JAX-RS URI template. */ public UriTemplateParser(final String template) throws IllegalArgumentException { if (template == null || template.length() == 0) { throw new IllegalArgumentException(); } this.template = template; parse(new StringCharacterIterator(template)); try { pattern = Pattern.compile(regex.toString()); } catch (PatternSyntaxException ex) { throw new IllegalArgumentException("Invalid syntax for the template expression '" + regex + "'", ex); } }
/** * Parse a template. * * @param template the template. * @throws IllegalArgumentException if the template is null, an empty string * or does not conform to a JAX-RS URI template. */ public UriTemplateParser(final String template) throws IllegalArgumentException { if (template == null || template.length() == 0) { throw new IllegalArgumentException(); } this.template = template; parse(new StringCharacterIterator(template)); try { pattern = Pattern.compile(regex.toString()); } catch (PatternSyntaxException ex) { throw new IllegalArgumentException("Invalid syntax for the template expression '" + regex + "'", ex); } }
@Override public char next() { if (!hasNext()) { throw new NoSuchElementException(); } return s.charAt(pos++); }
@Override public char peek() { if (!hasNext()) { throw new NoSuchElementException(); } return s.charAt(pos); }
@Override public char next() { if (!hasNext()) { throw new NoSuchElementException(); } return s.charAt(pos++); }