List<String> parseTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; skipBlankAndComma(); if (str.charAt(idx) != '<') throw new IllegalStateException(); ++idx; // skipping '<' while (skipBlankAndComma()) { if (str.charAt(idx) == '>') { ++idx; return list; } try { String name = parseTypeName(); String args = readRawTypeParameters(); list.add(name + args); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError( String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError( String.format( "Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
List<String> getTypeParameters() { if (isEOS()) { return Collections.emptyList(); } List<String> list = new ArrayList<String>(); if (str.charAt(idx) != '(') { throw new IllegalStateException(); } ++idx; // skipping '(' while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return list; } try { list.add(readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } return list; }
List<String> getCollectionTypes() { if (isEOS()) { return Collections.emptyList(); } List<String> list = new ArrayList<String>(); if (str.charAt(idx) != '<') { throw new IllegalStateException(); } ++idx; // skipping '<' while (skipBlankAndComma()) { if (str.charAt(idx) == '>') { ++idx; return list; } try { list.add(parseNextName()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } return list; }
public List<String> getTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; if (str.charAt(idx) != '(') throw new IllegalStateException(); ++idx; // skipping '(' while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return list; } try { list.add(readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
public List<String> getTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; if (str.charAt(idx) != '(') throw new IllegalStateException(); ++idx; // skipping '(' while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return list; } try { list.add(readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
public List<String> getTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; if (str.charAt(idx) != '(') throw new IllegalStateException(); ++idx; // skipping '(' while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return list; } try { list.add(readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
} catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex;
List<String> parseTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; skipBlankAndComma(); if (str.charAt(idx) != '<') throw new IllegalStateException(); ++idx; // skipping '<' while (skipBlankAndComma()) { if (str.charAt(idx) == '>') { ++idx; return list; } try { String name = parseTypeName(); String args = readRawTypeParameters(); list.add(name + args); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
List<String> parseTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; skipBlankAndComma(); if (str.charAt(idx) != '<') throw new IllegalStateException(); ++idx; // skipping '<' while (skipBlankAndComma()) { if (str.charAt(idx) == '>') { ++idx; return list; } try { String name = parseTypeName(); String args = readRawTypeParameters(); list.add(name + args); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
List<String> parseTypeParameters() { List<String> list = new ArrayList<String>(); if (isEOS()) return list; skipBlankAndComma(); if (str.charAt(idx) != '<') throw new IllegalStateException(); ++idx; // skipping '<' while (skipBlankAndComma()) { if (str.charAt(idx) == '>') { ++idx; return list; } try { String name = parseTypeName(); String args = readRawTypeParameters(); list.add(name + args); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
} catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex;
} catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex;
public Map<String, String> getNameAndTypeParameters() { // The order of the hashmap matters for UDT Map<String, String> map = new LinkedHashMap<String, String>(); while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return map; } String bbHex = readNextIdentifier(); String name = null; try { name = TypeCodec.varchar().deserialize(Bytes.fromHexString("0x" + bbHex), ProtocolVersion.NEWEST_SUPPORTED); } catch (NumberFormatException e) { throwSyntaxError(e.getMessage()); } skipBlank(); if (str.charAt(idx) != ':') throwSyntaxError("expecting ':' token"); ++idx; skipBlank(); try { map.put(name, readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
public Map<String, String> getNameAndTypeParameters() { // The order of the hashmap matters for UDT Map<String, String> map = new LinkedHashMap<String, String>(); while (skipBlankAndComma()) { if (str.charAt(idx) == ')') { ++idx; return map; } String bbHex = readNextIdentifier(); String name = null; try { name = TypeCodec.varchar().deserialize(Bytes.fromHexString("0x" + bbHex), ProtocolVersion.NEWEST_SUPPORTED); } catch (NumberFormatException e) { throwSyntaxError(e.getMessage()); } skipBlank(); if (str.charAt(idx) != ':') throwSyntaxError("expecting ':' token"); ++idx; skipBlank(); try { map.put(name, readOne()); } catch (DriverInternalError e) { DriverInternalError ex = new DriverInternalError(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new DriverInternalError(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }