/** * Marshall an attribute name and value to a DOM Element. This is particularly useful for attributes whose names * appear in namespace-qualified form. * * @param attributeName the attribute name in QName form * @param attributeValues the attribute values * @param domElement the target element to which to marshall * @param isIDAttribute flag indicating whether the attribute being marshalled should be handled as an ID-typed * attribute */ public static void marshallAttribute(QName attributeName, List<String> attributeValues, Element domElement, boolean isIDAttribute) { marshallAttribute(attributeName, DatatypeHelper.listToStringValue(attributeValues, " "), domElement, isIDAttribute); }
/** * Marshall an attribute name and value to a DOM Element. This is particularly useful for attributes whose names * appear in namespace-qualified form. * * @param attributeName the attribute name in QName form * @param attributeValues the attribute values * @param domElement the target element to which to marshall * @param isIDAttribute flag indicating whether the attribute being marshalled should be handled as an ID-typed * attribute */ public static void marshallAttribute(QName attributeName, List<String> attributeValues, Element domElement, boolean isIDAttribute) { marshallAttribute(attributeName, DatatypeHelper.listToStringValue(attributeValues, " "), domElement, isIDAttribute); }
/** * Adds a <code>wsse:Usage</code> attribute to the given SOAP object. * * @param soapObject the SOAP object to add the attribute to * @param usages the list of usages to add */ public static void addWSSEUsages(XMLObject soapObject, List<String> usages) { if (soapObject instanceof UsageBearing) { ((UsageBearing)soapObject).setWSSEUsages(usages); } else if (soapObject instanceof AttributeExtensibleXMLObject) { ((AttributeExtensibleXMLObject)soapObject).getUnknownAttributes() .put(UsageBearing.WSSE_USAGE_ATTR_NAME, DatatypeHelper.listToStringValue(usages, " ")); } else { throw new IllegalArgumentException("Specified object was neither UsageBearing nor AttributeExtensible"); } }
/** * Adds a <code>soap11:encodingStyle</code> attribute to the given SOAP object. * * @param soapObject the SOAP object to add the attribute to * @param encodingStyles the list of encoding styles to add */ public static void addSOAP11EncodingStyles(XMLObject soapObject, List<String> encodingStyles) { if (soapObject instanceof EncodingStyleBearing) { ((EncodingStyleBearing) soapObject).setSOAP11EncodingStyles(encodingStyles); } else if (soapObject instanceof AttributeExtensibleXMLObject) { ((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put( EncodingStyleBearing.SOAP11_ENCODING_STYLE_ATTR_NAME, DatatypeHelper.listToStringValue(encodingStyles, " ")); } else { throw new IllegalArgumentException( "Specified object was neither EncodingStyleBearing nor AttributeExtensible"); } }