/** * Encodes a Composite in XML by looping through it's components, creating new children for each * of them (with the appropriate names) and populating them by calling encode(Type, Element) * using these children. Returns true if at least one component contains a value. */ private boolean encodeComposite(Composite datatypeObject, Element datatypeElement) throws DataTypeException { Type[] components = datatypeObject.getComponents(); boolean hasValue = false; for (int i = 0; i < components.length; i++) { String name = makeElementName(datatypeObject, i + 1); Element newNode = datatypeElement.getOwnerDocument().createElement(name); boolean componentHasValue = encode(components[i], newNode); if (componentHasValue) { try { datatypeElement.appendChild(newNode); } catch (DOMException e) { throw new DataTypeException("DOMException encoding Composite: ", e); } hasValue = true; } } return hasValue; }
/** * Encodes a Composite in XML by looping through it's components, creating new children for each * of them (with the appropriate names) and populating them by calling encode(Type, Element) * using these children. Returns true if at least one component contains a value. */ private boolean encodeComposite(Composite datatypeObject, Element datatypeElement) throws DataTypeException { Type[] components = datatypeObject.getComponents(); boolean hasValue = false; for (int i = 0; i < components.length; i++) { String name = makeElementName(datatypeObject, i + 1); Element newNode = datatypeElement.getOwnerDocument().createElement(name); boolean componentHasValue = encode(components[i], newNode); if (componentHasValue) { try { datatypeElement.appendChild(newNode); } catch (DOMException e) { throw new DataTypeException("DOMException encoding Composite: ", e); } hasValue = true; } } return hasValue; }
Type[] children = datatypeObject.getComponents(); for (int i = 0; i < children.length; i++) { NodeList matchingElements = datatypeElement.getElementsByTagNameNS(NS, makeElementName( datatypeObject, i + 1)); if (matchingElements.getLength() > 0) { do { foundExtraComponent = false; NodeList matchingElements = datatypeElement.getElementsByTagNameNS(NS, makeElementName(datatypeObject, children.length + nextExtraCmpIndex + 1)); if (matchingElements.getLength() > 0) { parse(datatypeObject.getExtraComponents().getComponent(nextExtraCmpIndex), (Element) matchingElements.item(0));
Type[] children = datatypeObject.getComponents(); for (int i = 0; i < children.length; i++) { NodeList matchingElements = datatypeElement.getElementsByTagNameNS(NS, makeElementName( datatypeObject, i + 1)); if (matchingElements.getLength() > 0) { do { foundExtraComponent = false; NodeList matchingElements = datatypeElement.getElementsByTagNameNS(NS, makeElementName(datatypeObject, children.length + nextExtraCmpIndex + 1)); if (matchingElements.getLength() > 0) { parse(datatypeObject.getExtraComponents().getComponent(nextExtraCmpIndex), (Element) matchingElements.item(0));
int n = segmentObject.numFields(); for (int i = 1; i <= n; i++) { String name = makeElementName(segmentObject, i); Type[] reps = segmentObject.getField(i); for (Type rep : reps) {
int n = segmentObject.numFields(); for (int i = 1; i <= n; i++) { String name = makeElementName(segmentObject, i); Type[] reps = segmentObject.getField(i); for (Type rep : reps) {