String[] pair = varname.split(Modifier.PREFIX.getValue());
try
{
validateVarname(pair[0]);
Integer pos = Integer.valueOf(varname.substring(subStrPos + 1));
varspecs.add(new VarSpec(pair[0], Modifier.PREFIX, pos));
}
catch (NumberFormatException e)
{
throw new MalformedUriTemplateException("The prefix value for "+ pair[0]+ " was not a number", this.location, e);
}
}
/*
* Variable will be exploded
*/
else if (varname.lastIndexOf(Modifier.EXPLODE.getValue()) > 0)
{
validateVarname(varname.substring(0, varname.length() - 1));
varspecs.add(new VarSpec(varname, Modifier.EXPLODE));
}
/*
* Standard Value
*/
else
{
validateVarname(varname);
varspecs.add(new VarSpec(varname, Modifier.NONE));
}
}
this.replacementPattern = expressionReplacement;
this.op = operator;
this.varSpecs = varspecs;