String name = verifier.attributePresent("name") ? itemElement.getAttribute("name").getValue() : null;
if (name != null && name.length() > RosterConfiguration.ROSTER_ITEM_NAME_MAX_LENGTH) {
throw new RosterNotAcceptableException("roster name too long: " + name.length());
}
SubscriptionType subscription = verifier.attributePresent("subscription") ? SubscriptionType.valueOf(itemElement.getAttribute("subscription").getValue().toUpperCase()) : SubscriptionType.NONE;
if (!parseSubscriptionTypes && subscription != SubscriptionType.REMOVE) subscription = SubscriptionType.NONE; // roster remove is always tolerated
AskSubscriptionType askSubscriptionType = AskSubscriptionType.NOT_SET;
if (parseSubscriptionTypes) {
askSubscriptionType = verifier.attributePresent("ask") ? AskSubscriptionType.valueOf("ASK_" + itemElement.getAttribute("ask").getValue().toUpperCase()) : AskSubscriptionType.NOT_SET;