TableAddressParser { public TableRef parse(final String tableAddress) throws ParseException, UnsupportedEncodingException { final int hashIndex = tableAddress.indexOf(HASH); final String filename; final String escapedTableName; if (hashIndex == -1) { filename = null; escapedTableName = tableAddress; } else { final String escapedFilename = tableAddress.substring(0, hashIndex); filename = this.tableNameUtil.unescapeFilename(escapedFilename); escapedTableName = tableAddress.substring(hashIndex + 1); } String tableName = this.tableNameUtil.unescapeQuotes(escapedTableName); if (tableName.charAt(0) == '$') { this.status = TableRef.ABSOLUTE_TABLE; tableName = tableName.substring(1); } return new TableRef(this.tableNameUtil, filename, tableName, this.status); } TableAddressParser(final TableNameUtil tableNameUtil); TableRef parse(final String tableAddress); static final int SINGLE_QUOTE; }
@Test public void test() throws ParseException, IOException { Assert.assertEquals(new TableRef(this.tableNameUtil, "f'", "t't", 4), new TableAddressParser(this.tableNameUtil).parse("'f'''#'$t''t'")); }