// Default to no change
ProxyElementDetails.ChangeReason change = null;
// Get the target element
final ODOMElement targetElement =
sourceTargetPairs.getTarget(pairIndex);
// Does the attribute NOT exist in the target?
if (targetElement == null
|| targetElement.getAttribute(attribName) == null) {
// If there is an attribute value passed in, need to create the
// attribute to receive it (otherwise there is nothing to do and
// the default return of null applies)
if (attribValue != null && attribValue.length() != 0) {
// Create the attrib and note whether an element was created
final boolean elementCreated =
propagateCreateAttribute(
attribName, attribValue, pairIndex);
// Convert the result accordingly
change = (elementCreated
? ProxyElementDetails.ELEMENTS
: ProxyElementDetails.ATTRIBUTES);
}
} else {
// Target attribute DOES exist in the target: get it
final ODOMAttribute existingAttribute =
(ODOMAttribute) targetElement.getAttribute(attribName);
// If there is an attribute value passed in...
if (attribValue != null && attribValue.length() != 0) {
// Just update the existing attribute with the new value