*/
CdsData data = new CdsData();
StringBuilder sb = new StringBuilder().append(location);
- line = parseFeatureQualifier(sb, LOCATION);
+ line = parseFeatureQualifier(sb, false);
data.cdsLocation = sb.toString();
while (line != null)
String value = line.substring(eqPos + 1);
value = removeQuotes(value);
sb = new StringBuilder().append(value);
- line = parseFeatureQualifier(sb, qualifier);
+ boolean asText = !"translation".equals(qualifier);
+ line = parseFeatureQualifier(sb, asText);
String featureValue = sb.toString();
if ("protein_id".equals(qualifier))
*
* @param sb
* a string buffer primed with the first line of the value
- * @param qualifierName
+ * @param asText
* @return
* @throws IOException
*/
- String parseFeatureQualifier(StringBuilder sb, String qualifierName)
+ String parseFeatureQualifier(StringBuilder sb, boolean asText)
throws IOException
{
String line;
}
/*
- * heuristic rule: most multi-line value (e.g. /product) are text,
- * so add a space for word boundary at a new line; not for translation
+ * if text (e.g. /product), add a word separator for a new line,
+ * else (e.g. /translation) don't
*/
- if (!"translation".equals(qualifierName)
- && !LOCATION.equals(qualifierName))
+ if (asText)
{
sb.append(" ");
}