public static CommonValue convert(client.model.parser.dom.Value value) { if (value instanceof client.model.parser.dom.BibTeXString) { client.model.parser.dom.BibTeXString stringValue = (client.model.parser.dom.BibTeXString) value; if ( stringValue.isInteger() ) { return new IntegerValue(Long.parseLong(stringValue.getContent())); } else { return new StringValue(stringValue.getContent()); } } else { return null; } } public static CommonRecord convert(client.model.parser.dom.Record record) { CommonRecord result = new CommonRecord(record.getType(), record.getKey()); for ( String name : record ) { client.model.parser.dom.Value value = record.get(name); if ( value instanceof client.model.parser.dom.MultipleValues ) { client.model.parser.dom.MultipleValues multiValue = (client.model.parser.dom.MultipleValues) value; for ( client.model.parser.dom.Value singleValue : multiValue ) { CommonValue converted = convert(singleValue); if ( converted == null ) continue; result.add(name, converted); } } else { CommonValue converted = convert(value); if ( converted == null ) continue; result.add(name, converted); } } return result; }