/** First adopts the new child, then appends it. * * I do this so that we can insert elements that were created with a * different owner document or no owner document, such as from * "new Image()" in javascript. * * @param newChild the new child * @see org.apache.xerces.dom.NodeImpl#appendChild(org.w3c.dom.Node) */ @Override public Node appendChild(Node newChild) throws DOMException { //We don't need adoptChild(newChild) because super.appendChild() calls insertBefore(n,r)? //adoptNode(newChild); return super.appendChild(newChild); }
public void ignorableWhitespace( char[] text, int start, int length ) throws SAXException { Node node; if ( ! _ignoreWhitespace ) _current.appendChild( new TextImpl( _document, new String( text, start, length ) ) ); }
public void characters( char[] text, int start, int length ) throws SAXException { if ( _current == null ) throw new SAXException( "HTM010 State error: character data found outside of root element." ); _current.appendChild( new TextImpl( _document, new String( text, start, length ) ) ); }
/** * Transforms the <code>Journal</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "journal" ); // events for ( Iterator eventIterator = this.getEvents().iterator(); eventIterator.hasNext(); ) { Event event = (Event) eventIterator.next(); element.appendChild( event.toDOMElement( document ) ); } return element; }
/** * Transforms the <code>JEEApplicationServers</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "jeeapplicationservers" ); element.setAttribute( "cluster", new Boolean( this.isCluster() ).toString() ); // add JEE application server child nodes for ( Iterator applicationServerIterator = this.getJEEApplicationServers().iterator(); applicationServerIterator.hasNext(); ) { JEEApplicationServer jeeApplicationServer = (JEEApplicationServer) applicationServerIterator.next(); element.appendChild(jeeApplicationServer.toDOMElement(document)); } return element; }
/** * Transform the <code>Notifiers</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "notifiers" ); element.setAttribute( "countdown", new Integer( this.getCountdown() ).toString() ); // email notifier child nodes for ( Iterator notifierIterator = this.getNotifiers().iterator(); notifierIterator.hasNext(); ) { Email email = (Email) notifierIterator.next(); element.appendChild( email.toDOMElement( document ) ); } return element; }
/** * Transforms the <code>Access</code> POJO into a DOM element. * * @param document the core DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "access" ); element.setAttribute( "group", this.getGroup() ); // properties ElementImpl properties = new ElementImpl( document, "properties" ); for ( Iterator propertyIterator = this.getProperties().iterator(); propertyIterator.hasNext(); ) { Property property = (Property) propertyIterator.next(); properties.appendChild( property.toDOMElement( document ) ); } element.appendChild( properties ); return element; }
public void processingInstruction( String target, String instruction ) throws SAXException { Node node; // Processing instruction may appear before the document element (in fact, before the // document has been created, or after the document element has been closed. if ( _current == null && _document == null ) { if ( _preRootNodes == null ) _preRootNodes = new Vector(); _preRootNodes.addElement( new ProcessingInstructionImpl( null, target, instruction ) ); } else if ( _current == null && _document != null ) _document.appendChild( new ProcessingInstructionImpl( _document, target, instruction ) ); else _current.appendChild( new ProcessingInstructionImpl( _document, target, instruction ) ); }
/** * Transform the <code>JMSServer</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "jmsserver" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); // jmsqueues ElementImpl jmsqueues = new ElementImpl( document, "jmsqueues" ); for ( Iterator jmsQueueIterator = this.getJMSQueues().iterator(); jmsQueueIterator.hasNext(); ) { JMSQueue jmsQueue = (JMSQueue) jmsQueueIterator.next(); jmsqueues.appendChild( jmsQueue.toDOMElement( document ) ); } element.appendChild( jmsqueues ); // jmstopics ElementImpl jmstopics = new ElementImpl( document, "jmstopics" ); for ( Iterator jmsTopicIterator = this.getJMSTopics().iterator(); jmsTopicIterator.hasNext(); ) { JMSTopic jmsTopic = (JMSTopic) jmsTopicIterator.next(); jmstopics.appendChild( jmsTopic.toDOMElement( document ) ); } element.appendChild( jmstopics ); return element; }
/** * Transform the <code>Email</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "email" ); element.setAttribute( "mailhost", this.getMailhost() ); element.setAttribute( "from", this.getFrom() ); // destinations ElementImpl destinations = new ElementImpl( document, "destinations" ); for ( Iterator destinationIterator = this.getDestinations().iterator(); destinationIterator.hasNext(); ) { Destination destination = (Destination) destinationIterator.next(); destinations.appendChild( destination.toDOMElement( document ) ); } element.appendChild( destinations ); return element; }
/** * Transform the <code>Group</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "group" ); element.setAttribute( "id", this.getId() ); element.setAttribute( "name", this.getName() ); // users element ElementImpl users = new ElementImpl( document, "users" ); // add user in the users element for ( Iterator userIterator = this.getUsers().iterator(); userIterator.hasNext(); ) { User user = (User) userIterator.next(); users.appendChild( user.toDOMElement( document ) ); } // add users to group element element.appendChild( users ); return element; }
/** * Transform the <code>SqlScript</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "sqlscript" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "uri", this.getUri() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); element.setAttribute( "force", new Boolean( this.isForce() ).toString() ); // mappings ElementImpl mappings = new ElementImpl( document, "mappings" ); for ( Iterator mappingIterator = this.getMappings().iterator(); mappingIterator.hasNext(); ) { Mapping mapping = (Mapping) mappingIterator.next(); mappings.appendChild( mapping.toDOMElement( document ) ); } element.appendChild( mappings ); return element; }
/** * Transform the <code>ContentManager</code> POJO to a DOM element. * * @param document the core XML document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "contentmanager" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "classname", this.getClassname() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); element.setAttribute( "agent", this.getAgent() ); // properties ElementImpl properties = new ElementImpl( document, "properties" ); for ( Iterator propertyIterator = this.getProperties().iterator(); propertyIterator.hasNext(); ) { Property property = (Property) propertyIterator.next(); properties.appendChild( property.toDOMElement( document ) ); } element.appendChild( properties ); return element; }
/** * Transforms a <code>command</code> into a XML DOM element. * * @param document the DOM document. * @return the <code>command</code> DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "command" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); element.setAttribute( "agent", this.getAgent() ); CDATASectionImpl content = new CDATASectionImpl( document, this.getCommand() ); element.appendChild( content ); return element; }
/** * Transform the <code>ConfigurationFile</code> POJO to a DOM element. * * @param document the core XML document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "configurationfile" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "uri", this.getUri() ); element.setAttribute( "path", this.getPath() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); element.setAttribute( "agent", this.getAgent() ); // mappings ElementImpl mappings = new ElementImpl( document, "mappings" ); for ( Iterator mappingIterator = this.getMappings().iterator(); mappingIterator.hasNext(); ) { Mapping mapping = (Mapping) mappingIterator.next(); mappings.appendChild( mapping.toDOMElement( document ) ); } element.appendChild( mappings ); return element; }
/** * Transforms the <code>UpdateLog</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "updatelog" ); element.setAttribute( "status", this.getStatus() ); element.setAttribute( "time", this.getTime() ); element.setAttribute( "title", this.getTitle() ); element.setAttribute( "updated", new Boolean( this.isUpdated() ).toString() ); // add update message child nodes for ( Iterator updateMessageIterator = this.getUpdateMessages().iterator(); updateMessageIterator.hasNext(); ) { UpdateMessage updateMessage = (UpdateMessage) updateMessageIterator.next(); element.appendChild( updateMessage.toDOMElement( document ) ); } return element; }
/** * Transforms the <code>UpdateMessage</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "updatemessage" ); element.setAttribute( "priority", this.getPriority() ); CDATASectionImpl message = new CDATASectionImpl( document, this.getMessage() ); element.appendChild( message ); return element; }
/** * Transform the <code>FreeField</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "freefield" ); element.setAttribute( "name", this.getName() ); CDATASectionImpl content = new CDATASectionImpl( document, this.getContent() ); element.appendChild( content ); return element; }
/** * Transform the <code>Database</code> POJO to a DOM element. * * @param document the core XML document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "database" ); element.setAttribute( "name", this.getName() ); element.setAttribute( "driver", this.getDriver() ); element.setAttribute( "user", this.getUser() ); element.setAttribute( "password", this.getPassword() ); element.setAttribute( "jdbcurl", this.getJdbcurl() ); element.setAttribute( "connectionPool", this.getConnectionPool() ); element.setAttribute( "sqlCommand", this.getSqlCommand() ); element.setAttribute( "agent", this.getAgent() ); element.setAttribute( "active", new Boolean( this.isActive() ).toString() ); element.setAttribute( "blocker", new Boolean( this.isBlocker() ).toString() ); // sqlscripts ElementImpl sqlscripts = new ElementImpl( document, "sqlscripts" ); for ( Iterator sqlScriptIterator = this.getSqlScripts().iterator(); sqlScriptIterator.hasNext(); ) { SqlScript sqlScript = (SqlScript) sqlScriptIterator.next(); sqlscripts.appendChild( sqlScript.toDOMElement( document ) ); } element.appendChild( sqlscripts ); return element; }
/** * Transforms the <code>Event</code> POJO to a DOM element. * * @param document the DOM document. * @return the DOM element. */ protected Element toDOMElement( CoreDocumentImpl document ) { ElementImpl element = new ElementImpl( document, "event" ); element.setAttribute( "date", this.getDate() ); element.setAttribute( "severity", this.getSeverity() ); element.setAttribute( "author", this.getAuthor() ); CDATASectionImpl content = new CDATASectionImpl( document, this.getContent() ); element.appendChild( content ); return element; }