@Override public void setText(final String text) { // TODO: remove ALL children? final NodeList nodes = element.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { final Node child = nodes.item(i); if (child.getNodeType() == Node.TEXT_NODE) { element.removeChild(child); } } if (!Strings.isNullOrEmpty(text)) { element.appendChild(document.createTextNode(text)); } }
Text databaseNameText = document.createTextNode( dbConn.getDatabaseName() ); databaseName.appendChild( databaseNameText ); databaseConnection.appendChild( databaseName ); Text databasePortText = document.createTextNode( dbConn.getDatabasePort() ); databasePort.appendChild( databasePortText ); databaseConnection.appendChild( databasePort ); Text hostnameText = document.createTextNode( dbConn.getHostname() ); hostname.appendChild( hostnameText ); databaseConnection.appendChild( hostname ); Text indexTablespaceText = document.createTextNode( dbConn.getIndexTablespace() ); indexTablespace.appendChild( indexTablespaceText ); databaseConnection.appendChild( indexTablespace ); Text dataTablespaceText = document.createTextNode( dbConn.getIndexTablespace() ); dataTablespace.appendChild( dataTablespaceText ); databaseConnection.appendChild( dataTablespace ); Text informixServernameText = document.createTextNode( dbConn.getInformixServername() ); informixServername.appendChild( informixServernameText ); databaseConnection.appendChild( informixServername ); Text nameText = document.createTextNode( dbConn.getName() ); name.appendChild( nameText ); databaseConnection.appendChild( name ); Text usernameTxt = document.createTextNode( dbConn.getUsername() );