/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token from the String. * Equivalent to {@link #next()} except it returns null rather than * throwing {@link NoSuchElementException} when no tokens remain. * * @return the next sequential token, or null when no more tokens are found */ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; } return null; }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
/** * Gets the next token. * * @return the next String token * @throws NoSuchElementException if there are no more elements */ public Object next() { if (hasNext()) { return tokens[tokenPos++]; } throw new NoSuchElementException(); }
public UriTemplate(String pattern) { this.pattern = pattern; this.segments = new ArrayList<Segment>(); StrTokenizer tokenizer = new StrTokenizer(pattern, '/'); while (tokenizer.hasNext()) { segments.add(new Segment(tokenizer.nextToken())); } }
public UriTemplate(String pattern) { this.pattern = pattern; this.segments = new ArrayList<Segment>(); StrTokenizer tokenizer = new StrTokenizer(pattern, '/'); while (tokenizer.hasNext()) { segments.add(new Segment(tokenizer.nextToken())); } }
boolean contains(String extension, String nonExpandableExtensionsList) { notNull("extension", extension); if (!StringUtils.isBlank(extension)) { final StrTokenizer tokenizer = StrTokenizer.getCSVInstance(nonExpandableExtensionsList); while (tokenizer.hasNext()) { String nonExpandableExtension = tokenizer.nextToken(); if (nonExpandableExtension.equalsIgnoreCase(extension)) { return true; } } } return false; } }
public static String getIpFromRequest(HttpServletRequest request) { String ip; boolean found = false; if ((ip = request.getHeader("x-forwarded-for")) != null) { StrTokenizer tokenizer = new StrTokenizer(ip, ","); while (tokenizer.hasNext()) { ip = tokenizer.nextToken().trim(); if (isIPv4Valid(ip) && !isIPv4Private(ip)) { found = true; break; } } } if (!found) { ip = request.getRemoteAddr(); } return ip; } }
/** * Transform an input string into a list of identifiers. * @param input A comma, new line, or tab delimited set of identifiers, * with optional double quoting. * @return A list of identifiers. */ public List<String> tokenise(String input) { List<String> ret = new LinkedList<String>(); StrTokenizer tokeniser = new StrTokenizer(input, charSetMatcher); tokeniser.setQuoteChar('"'); tokeniser.setIgnoreEmptyTokens(true); tokeniser.setTrimmerMatcher(StrMatcher.trimMatcher()); while (tokeniser.hasNext()) { String token = tokeniser.nextToken().trim(); ret.add(token); } return ret; } }
private void includeResourcesDefinedInModules() { for (final StrTokenizer csvTokenizer = StrTokenizer.getCSVInstance(modules); csvTokenizer.hasNext();) { final String aRequiredWebResourceModule = csvTokenizer.nextToken(); getWebResourceManager().requireResource(aRequiredWebResourceModule); } }
private void includeResourcesDefinedInContexts() { for (final StrTokenizer csvTokenizer = StrTokenizer.getCSVInstance(contexts); csvTokenizer.hasNext();) { final String aRequiredWebResourceContext = csvTokenizer.nextToken(); getWebResourceManager().requireResourcesForContext(aRequiredWebResourceContext); } }
/** * Transform an input string into a list of identifiers. * @param input A comma, new line, or tab delimited set of identifiers, * with optional double quoting. * @return A list of identifiers. */ public List<String> tokenise(String input) { List<String> ret = new LinkedList<String>(); StrTokenizer tokeniser = new StrTokenizer(input, charSetMatcher); tokeniser.setQuoteChar('"'); tokeniser.setIgnoreEmptyTokens(true); tokeniser.setTrimmerMatcher(StrMatcher.trimMatcher()); while (tokeniser.hasNext()) { String token = tokeniser.nextToken().trim(); ret.add(token); } return ret; } }