use of com.github.mangstadt.vinnie.io.VObjectPropertyValues.SemiStructuredValueIterator in project ez-vcard by mangstadt.
the class GenderScribe method _parseText.
@Override
protected Gender _parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context) {
SemiStructuredValueIterator it = new SemiStructuredValueIterator(value, 2);
String sex = it.next();
if (sex != null) {
sex = sex.toUpperCase();
}
String text = it.next();
Gender property = new Gender(sex);
property.setText(text);
return property;
}
use of com.github.mangstadt.vinnie.io.VObjectPropertyValues.SemiStructuredValueIterator in project ez-vcard by mangstadt.
the class ClientPidMapScribe method _parseText.
@Override
protected ClientPidMap _parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context) {
SemiStructuredValueIterator it = new SemiStructuredValueIterator(value, 2);
String pid = it.next();
String uri = it.next();
if (pid == null || uri == null) {
throw new CannotParseException(3);
}
return parse(pid, uri);
}
use of com.github.mangstadt.vinnie.io.VObjectPropertyValues.SemiStructuredValueIterator in project ez-vcard by mangstadt.
the class StructuredNameScribe method _parseText.
@Override
protected StructuredName _parseText(String value, VCardDataType dataType, VCardParameters parameters, ParseContext context) {
StructuredName property = new StructuredName();
if (context.getVersion() == VCardVersion.V2_1) {
/*
* 2.1 does not recognize multi-valued components.
*/
SemiStructuredValueIterator it = new SemiStructuredValueIterator(value);
property.setFamily(it.next());
property.setGiven(it.next());
String next = it.next();
if (next != null) {
property.getAdditionalNames().add(next);
}
next = it.next();
if (next != null) {
property.getPrefixes().add(next);
}
next = it.next();
if (next != null) {
property.getSuffixes().add(next);
}
} else {
StructuredValueIterator it = new StructuredValueIterator(value);
property.setFamily(it.nextValue());
property.setGiven(it.nextValue());
property.getAdditionalNames().addAll(it.nextComponent());
property.getPrefixes().addAll(it.nextComponent());
property.getSuffixes().addAll(it.nextComponent());
}
return property;
}
Aggregations