private void throwSyntaxError(String msg) throws SyntaxException { throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: %s", str, idx, msg)); }
public List<AbstractType<?>> getTypeParameters() throws SyntaxException, ConfigurationException { List<AbstractType<?>> list = new ArrayList<>(); 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(parse()); } catch (SyntaxException e) { SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
private AbstractType<?> parseType(String type) throws ConfigurationException { try { // always treat counters like longs, specifically CCT.serialize is not what we need if (type != null && type.equals("org.apache.cassandra.db.marshal.CounterColumnType")) return LongType.instance; return TypeParser.parse(type); } catch (SyntaxException e) { throw new ConfigurationException(e.getMessage(), e); } }
private List<ColumnDefinition> getColumns(CFMetaData cfm) throws InvalidRequestException { List<ColumnDefinition> columnDefs = new ArrayList<>(columns.size()); for (Map.Entry<Term, String> col : columns.entrySet()) { try { ByteBuffer columnName = cfm.comparator.asAbstractType().fromStringCQL2(col.getKey().getText()); String validatorClassName = CFPropDefs.comparators.containsKey(col.getValue()) ? CFPropDefs.comparators.get(col.getValue()) : col.getValue(); AbstractType<?> validator = TypeParser.parse(validatorClassName); columnDefs.add(ColumnDefinition.regularDef(cfm, columnName, validator, null)); } catch (ConfigurationException e) { InvalidRequestException ex = new InvalidRequestException(e.toString()); ex.initCause(e); throw ex; } catch (SyntaxException e) { InvalidRequestException ex = new InvalidRequestException(e.toString()); ex.initCause(e); throw ex; } } return columnDefs; }
public List<AbstractType<?>> getTypeParameters() throws SyntaxException, ConfigurationException { List<AbstractType<?>> list = new ArrayList<AbstractType<?>>(); 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(parse()); } catch (SyntaxException e) { SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
private AbstractType<?> parseType(String type) throws ConfigurationException { try { // always treat counters like longs, specifically CCT.serialize is not what we need if (type != null && type.equals("org.apache.cassandra.db.marshal.CounterColumnType")) return LongType.instance; return TypeParser.parse(type); } catch (SyntaxException e) { throw new ConfigurationException(e.getMessage(), e); } }
throw new InvalidRequestException(e.toString());
public List<AbstractType<?>> getTypeParameters() throws SyntaxException, ConfigurationException { List<AbstractType<?>> list = new ArrayList<>(); 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(parse()); } catch (SyntaxException e) { SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
private void throwSyntaxError(String msg) throws SyntaxException { throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: %s", str, idx, msg)); }
state._fsp--; try { props.addProperty(k.toString(), simple); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); } state._fsp--; try { props.addProperty(k.toString(), convertPropertyMap(map)); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); }
public List<AbstractType<?>> getTypeParameters() throws SyntaxException, ConfigurationException { List<AbstractType<?>> list = new ArrayList<>(); 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(parse()); } catch (SyntaxException e) { SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
private void throwSyntaxError(String msg) throws SyntaxException { throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: %s", str, idx, msg)); }
t = CQL3Type.Raw.from(new CQL3Type.Custom((s!=null?s.getText():null))); } catch (SyntaxException e) { addRecognitionError("Cannot parse type " + (s!=null?s.getText():null) + ": " + e.getMessage()); } catch (ConfigurationException e) { addRecognitionError("Error setting type " + (s!=null?s.getText():null) + ": " + e.getMessage());
public List<AbstractType<?>> getTypeParameters() throws SyntaxException, ConfigurationException { List<AbstractType<?>> list = new ArrayList<>(); 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(parse()); } catch (SyntaxException e) { SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; } } throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx)); }
private void throwSyntaxError(String msg) throws SyntaxException { throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: %s", str, idx, msg)); }
state._fsp--; try { props.addProperty(k.toString(), simple); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); } state._fsp--; try { props.addProperty(k.toString(), convertPropertyMap(map)); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); }
throw new SyntaxException(type + " is not a collection type"); map.put(bb, (CollectionType)type); SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx));
private void throwSyntaxError(String msg) throws SyntaxException { throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: %s", str, idx, msg)); }
state._fsp--; try { props.addProperty(k.toString(), simple); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); } state._fsp--; try { props.addProperty(k.toString(), convertPropertyMap(map)); } catch (SyntaxException e) { addRecognitionError(e.getMessage()); }
throw new SyntaxException(type + " is not a collection type"); map.put(bb, (CollectionType)type); SyntaxException ex = new SyntaxException(String.format("Exception while parsing '%s' around char %d", str, idx)); ex.initCause(e); throw ex; throw new SyntaxException(String.format("Syntax error parsing '%s' at char %d: unexpected end of string", str, idx));