// tag.
if (elementName != null) {
// A VCardParser can only modify a contextObject which is a
// Creator instance.
if (contextObject instanceof Creator) {
Creator creator = (Creator) contextObject;
// Sets the familyName String of modelCreator.
if (elementName.equals("Family") && hasReadFamilyName) {
creator.setFamilyName(characters);
}
// Sets the givenName String of modelCreator.
else if (elementName.equals("Given") && hasReadGivenName) {
creator.setGivenName(characters);
}
// Sets the email String of modelCreator.
else if (elementName.equals("EMAIL") && hasReadEMAIL) {
creator.setEmail(characters);
}
// Sets the orgname String of modelCreator.
else if (elementName.equals("Orgname") && hasReadOrgName) {
creator.setOrganisation(characters);
} else if (!elementName.equals("ORG") && !elementName.equals("N")) {
// Storing additional VCard elements in a map to write them back
creator.setOtherAttribute(elementName, characters);
}
} else {
logger.warn("Lost Information: the characters '" + characters + "' on the element '" + elementName + "' might be lost"
+ " as the context object is not a Creator.");
}