int indexOfParams = valueTypeSpec.indexOf("<");
if (indexOfParams == -1) {
ValueTypeFactory valueTypeFactory = valueTypeFactories.get(valueTypeSpec);
if (valueTypeFactory == null) {
throw new TypeException("Unkown value type: " + valueTypeSpec);
}
valueType = valueTypeFactory.getValueType(null);
} else {
if (!valueTypeSpec.endsWith(">")) {
throw new IllegalArgumentException("Invalid value type string, no closing angle bracket: '" +
valueTypeSpec + "'");
}
String arg = valueTypeSpec.substring(indexOfParams + 1, valueTypeSpec.length() - 1);
if (arg.length() == 0) {
throw new IllegalArgumentException("Invalid value type string, type arg is zero length: '" +
valueTypeSpec + "'");
}
ValueTypeFactory valueTypeFactory = valueTypeFactories.get(valueTypeSpec.substring(0, indexOfParams));
if (valueTypeFactory == null) {
throw new TypeException("Unkown value type: " + valueTypeSpec);
}
valueType = valueTypeFactory.getValueType(arg);
}
return valueType;