Search in sources :

Example 1 with EnumEntry

use of org.openecard.addon.manifest.EnumEntry in project open-ecard by ecsec.

the class AndroidMarshaller method parseEnumEntry.

private EnumEntry parseEnumEntry(XmlPullParser parser) throws XmlPullParserException, IOException {
    EnumEntry entry = new EnumEntry();
    int eventType;
    do {
        parser.next();
        eventType = parser.getEventType();
        if (eventType == XmlPullParser.START_TAG) {
            if (parser.getName().equals("Key")) {
                entry.setKey(parser.nextText());
            } else if (parser.getName().equals("LocalizedName")) {
                LocalizedString localizedString = new LocalizedString();
                localizedString.setLang(parser.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang"));
                localizedString.setValue(parser.nextText());
                entry.getLocalizedName().add(localizedString);
            } else if (parser.getName().equals("LocalizedDescription")) {
                LocalizedString localizedString = new LocalizedString();
                localizedString.setLang(parser.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang"));
                localizedString.setValue(parser.nextText());
                entry.getLocalizedDescription().add(localizedString);
            }
        }
    } while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("EnumEntry")));
    return entry;
}
Also used : LocalizedString(org.openecard.addon.manifest.LocalizedString) EnumEntry(org.openecard.addon.manifest.EnumEntry)

Aggregations

EnumEntry (org.openecard.addon.manifest.EnumEntry)1 LocalizedString (org.openecard.addon.manifest.LocalizedString)1