diff options
Diffstat (limited to 'plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java')
-rw-r--r-- | plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java b/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java deleted file mode 100644 index 1c740c67..00000000 --- a/plugins/org.eclipse.epp.packaging.core/src/org/eclipse/epp/packaging/core/configuration/xml/XmlElement.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Innoopract Informationssysteme GmbH - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Innoopract - initial API and implementation - *******************************************************************************/ -package org.eclipse.epp.packaging.core.configuration.xml; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - -/** XML Element implementation using an underlying W3C DOM Element. */ -public class XmlElement implements IXmlElement { - - private final Element node; - - /** - * Creates a new XmlElement by providing a new node. - * - * @param node - */ - public XmlElement( final Element node ) { - this.node = node; - } - - public IXmlElement getElement( final String tagName ) { - NodeList elementsByTagName = this.node.getElementsByTagName( tagName ); - IXmlElement result; - if( elementsByTagName.getLength() == 0 ) { - result = null; - } else { - result = new XmlElement( ( Element )elementsByTagName.item( 0 ) ); - } - return result; - } - - public IXmlElement[] getElements( final String tagName ) { - NodeList elementsByTagName = this.node.getElementsByTagName( tagName ); - List<IXmlElement> result = new ArrayList<IXmlElement>(); - for( int index = 0; index < elementsByTagName.getLength(); index++ ) { - result.add( new XmlElement( ( Element )elementsByTagName.item( index ) ) ); - } - return result.toArray( new IXmlElement[ result.size() ] ); - } - - public String getAttributeValue( final String attributeName ) { - return this.node.getAttribute( attributeName ); - } - - public String getText() { - return this.node.getTextContent(); - } -}
\ No newline at end of file |