ModelField modelField = (ModelField) modelFields.next(); String name = modelField.getName(); String value = this.getString(name);
ModelField modelField = (ModelField) modelFields.next(); String name = modelField.getName(); String value = this.getString(name);
/** * Makes an XML Element object with an attribute for each field of the entity * * @param document The XML Document that the new Element will be part of * @param prefix A prefix to put in front of the entity name in the tag name * @return org.w3c.dom.Element object representing this generic entity */ public Element makeXmlElement(Document document, String prefix) { Element element = null; if (prefix == null) prefix = ""; if (document != null) element = document.createElement(prefix + entityName); // else element = new ElementImpl(null, this.getEntityName()); if (element == null) return null; ModelEntity modelEntity = this.getModelEntity(); Iterator<ModelField> modelFields = modelEntity.getFieldsIterator(); while (modelFields.hasNext()) { ModelField modelField = modelFields.next(); String name = modelField.getName(); String value = this.getString(name); if (value != null) { if (value.indexOf('\n') >= 0 || value.indexOf('\r') >= 0) { // Atlassian FIX: Escape the CDATA sections (if any) in the value of the string UtilXml.addChildElementCDATAValue(element, name, escapeCData(value), document); } else { element.setAttribute(name, value); } } } return element; }
/** Makes an XML Element object with an attribute for each field of the entity *@param document The XML Document that the new Element will be part of *@param prefix A prefix to put in front of the entity name in the tag name *@return org.w3c.dom.Element object representing this generic entity */ public Element makeXmlElement(Document document, String prefix) { Element element = null; if (prefix == null) prefix = ""; if (document != null) element = document.createElement(prefix + this.getEntityName()); // else element = new ElementImpl(null, this.getEntityName()); if (element == null) return null; ModelEntity modelEntity = this.getModelEntity(); Iterator modelFields = modelEntity.getFieldsIterator(); while (modelFields.hasNext()) { ModelField modelField = (ModelField) modelFields.next(); String name = modelField.getName(); String value = this.getString(name); if (value != null) { if (value.indexOf('\n') >= 0 || value.indexOf('\r') >= 0) { // Atlassian FIX: Escape the CDATA sections (if any) in the value of the string UtilXml.addChildElementCDATAValue(element, name, escapeCDATA(value), document); } else { element.setAttribute(name, value); } } else {// do nothing will null values } } return element; }
/** Makes an XML Element object with an attribute for each field of the entity *@param document The XML Document that the new Element will be part of *@param prefix A prefix to put in front of the entity name in the tag name *@return org.w3c.dom.Element object representing this generic entity */ public Element makeXmlElement(Document document, String prefix) { Element element = null; if (prefix == null) prefix = ""; if (document != null) element = document.createElement(prefix + this.getEntityName()); // else element = new ElementImpl(null, this.getEntityName()); if (element == null) return null; ModelEntity modelEntity = this.getModelEntity(); Iterator modelFields = modelEntity.getFieldsIterator(); while (modelFields.hasNext()) { ModelField modelField = (ModelField) modelFields.next(); String name = modelField.getName(); String value = this.getString(name); if (value != null) { if (value.indexOf('\n') >= 0 || value.indexOf('\r') >= 0) { // Atlassian FIX: Escape the CDATA sections (if any) in the value of the string UtilXml.addChildElementCDATAValue(element, name, escapeCDATA(value), document); } else { element.setAttribute(name, value); } } else {// do nothing will null values } } return element; }
value = getString(name); if (value != null) { if (value.indexOf('\n') >= 0 || value.indexOf('\r') >= 0) {