/** * Gets the value of a list-type attribute as a list. * * @param attribute attribute whose value will be turned into a list * * @return list of values, never null */ public static List<String> getAttributeValueAsList(Attr attribute) { if (attribute == null) { return Collections.emptyList(); } return DatatypeHelper.stringToList(attribute.getValue(), LIST_DELIMITERS); }
/** * Gets the value of a list-type attribute as a list. * * @param attribute attribute whose value will be turned into a list * * @return list of values, never null */ public static List<String> getAttributeValueAsList(Attr attribute) { if (attribute == null) { return Collections.emptyList(); } return DatatypeHelper.stringToList(attribute.getValue(), LIST_DELIMITERS); }
/** * Gets the value of a list-type element as a list. * * @param element element whose value will be turned into a list * * @return list of values, never null */ public static List<String> getElementContentAsList(Element element) { if (element == null) { return Collections.emptyList(); } return DatatypeHelper.stringToList(element.getTextContent(), LIST_DELIMITERS); }
/** * Gets the value of a list-type element as a list. * * @param element element whose value will be turned into a list * * @return list of values, never null */ public static List<String> getElementContentAsList(Element element) { if (element == null) { return Collections.emptyList(); } return DatatypeHelper.stringToList(element.getTextContent(), LIST_DELIMITERS); }
/** * Gets the list value of the <code>wsse:Usage</code> attribute from the given SOAP object. * * @param soapObject the SOAP object to add the attribute to * * @return the list of usages, or null if not present */ public static List<String> getWSSEUsages(XMLObject soapObject) { if (soapObject instanceof UsageBearing) { List<String> value = ((UsageBearing)soapObject).getWSSEUsages(); if (value != null) { return value; } } if (soapObject instanceof AttributeExtensibleXMLObject) { String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject)soapObject) .getUnknownAttributes().get(UsageBearing.WSSE_USAGE_ATTR_NAME)); if (value != null) { DatatypeHelper.stringToList(value, XMLHelper.LIST_DELIMITERS); } } return null; } }
/** * Gets the list value of the <code>soap11:encodingStyle</code> attribute from the given SOAP object. * * @param soapObject the SOAP object to add the attribute to * * @return the list of encoding styles, or null if not present */ public static List<String> getSOAP11EncodingStyles(XMLObject soapObject) { if (soapObject instanceof EncodingStyleBearing) { List<String> value = ((EncodingStyleBearing) soapObject).getSOAP11EncodingStyles(); if (value != null) { return value; } } if (soapObject instanceof AttributeExtensibleXMLObject) { String value = DatatypeHelper.safeTrimOrNullString(((AttributeExtensibleXMLObject) soapObject) .getUnknownAttributes().get(EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME)); if (value != null) { DatatypeHelper.stringToList(value, XMLHelper.LIST_DELIMITERS); } } return null; }