@Test public void testParse1() throws StreamingException { String parseStr = "select rid as id,rname,rtype from rdbtable where id = '${s.id}'"; DataSourceTokenCollectorHandler handler = new DataSourceTokenCollectorHandler("${", "}"); GenericTokenParser parser = new GenericTokenParser("${", "}", handler); parser.parse(parseStr); assertTrue(handler.getContents().size() == 1); assertTrue(handler.getContents().contains("s.id")); }
public Set<String> getContents() { return contents; }
DataSourceTokenCollectorHandler implements TokenHandler, Serializable { public Set<String> getContents() { return contents; } }
DataSourceTokenCollectorHandler implements TokenHandler, Serializable { public Set<String> getContents() { return contents; } DataSourceTokenCollectorHandler(String openToken, String closeToken); }
DataSourceTokenCollectorHandler implements TokenHandler, Serializable { public Set<String> getContents() { return contents; } DataSourceTokenCollectorHandler(String openToken, String closeToken); @Override String handleToken(String content); Set<String> getContents(); }
DataSourceTokenCollectorHandler implements TokenHandler, Serializable { public Set<String> getContents() { return contents; } DataSourceTokenCollectorHandler(String openToken, String closeToken); @Override String handleToken(String content); Set<String> getContents();  }