throw new QueryInvalidParametersException("Query is using named parameters yet also has \"" + id + "\"");
}
String paramName = id.substring(1);
try
{
Node expr = new ParameterNode(Node.PARAMETER, new Integer(paramName), parameterPosition);
parameterPosition++;
stack.push(expr);
return true;
}
catch (NumberFormatException nfe)
{
throw new NucleusUserException("Numbered parameter syntax starting ? but isnt followed by numeric!");
}
}
else if (first == ':')
{
// Named parameter - stored as String
if (paramType == null)
{
paramType = ParameterType.NAMED;
}
else if (paramType == ParameterType.NUMBERED)
{
throw new QueryInvalidParametersException("Query is using numbered parameters yet also has \"" + id + "\"");
}
Node expr = new ParameterNode(Node.PARAMETER, id.substring(1), parameterPosition);
parameterPosition++;
stack.push(expr);
return true;
}
else
{
Node expr = new Node(Node.IDENTIFIER, id);
stack.push(expr);
return true;
}
}