public boolean attributePresent(String name) { return attributePresent("", name); }
/** * Checks whether all given attributes are present on the element. * * @param names * the attributes to check * @return true iff all attributes are present, false otherwise */ public boolean allAttributesPresent(String... names) { if (names == null) { return false; } for (String name : names) { if (!attributePresent(name)) { return false; } } return true; }
/** * Checks whether any of the given attributes are present on the element. * * @param names * the attributes to check * @return true iff at least one of the given attributes is present, false * otherwise */ public boolean anyAttributePresent(String... names) { if (names == null) { return false; } for (String name : names) { if (attributePresent(name)) { return true; } } return false; }
public boolean attributeEquals(String namespaceUri, String name, String value) { return attributePresent(namespaceUri, name) && element.getAttributeValue(namespaceUri, name).equals(value); }
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) askSubscriptionType = verifier.attributePresent("ask") ? AskSubscriptionType.valueOf("ASK_" + itemElement.getAttribute("ask").getValue().toUpperCase()) : AskSubscriptionType.NOT_SET;
if (xmlElementVerifier.attributePresent("id")) {
if (xmlElementVerifier.attributePresent("id")) {