public abstract class XmlUtils extends Object
| Constructor and Description |
|---|
XmlUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Element |
getFirstChildElement(String name,
Element parent)
Odczytuje wartość pierwszego elementu o podanej nazwie.
|
static String |
getFirstChildElementValue(String name,
Element parent)
Odczytuje pierwszy element o podanej nazwie.
|
static Map<String,String> |
getParameterMap(String name,
String keyProperty,
Element element)
Odczytuje z podanego elementu wszystkie node'y o nazwie
name. |
static Document |
loadDocument(InputStream inputStream)
Ładuje dokument XML z podanego strumienia danych
|
static Document |
loadDocument(URL url)
Ładuje dokument XML z podanego adresu URL
|
public static Element getFirstChildElement(String name, Element parent)
name - nazwa tagaparent - element rodzicpublic static String getFirstChildElementValue(String name, Element parent)
name - nazwa tagaparent - element rodzicpublic static Map<String,String> getParameterMap(String name, String keyProperty, Element element)
name. Tworzy mapę z wartości klucza (atrybut) oraz wartości (wartość node'a)name - Nazwa elementu właściwościkeyProperty - Nazwa atrybutu zawierającego kluczelement - Element źródłowypublic static Document loadDocument(URL url) throws ParserConfigurationException, IOException, SAXException
ParserConfigurationExceptionIOExceptionSAXExceptionloadDocument(InputStream)public static Document loadDocument(InputStream inputStream) throws ParserConfigurationException, IOException, SAXException
inputStream - strumień danychParserConfigurationException - błąd konfiguracji builderaIOException - błąd odczytu pliku XMLSAXException - niepoprawny plik XMLCopyright © 2014 Suncode. All rights reserved.