Package host.anzo.commons.xml
Class XmlParser
java.lang.Object
host.anzo.commons.xml.XmlParser
- All Implemented Interfaces:
AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionchildren()voidclose()content()static @NotNull XmlParserstatic @NotNull XmlParserfromInputStream(Path filePath, InputStream inputStream) static @NotNull XmlParserfromResource(String fileName, @NotNull ClassLoader classLoader) booleanhasAttribute(@NotNull String attributeName) name()booleanreadBoolean(String name) booleanreadBoolean(String name, boolean defaultValue) intintintfinal <T extends Enum<T>>
Tfloatfloatlonglong
-
Method Details
-
fromFile
- Parameters:
fileName- file name- Returns:
- XmlParser loaded from specified file
-
fromZip
- Parameters:
fileNames- zip file names- Returns:
- list of XmlParsers loaded from specified zip files
-
fromResource
@NotNull public static @NotNull XmlParser fromResource(String fileName, @NotNull @NotNull ClassLoader classLoader) throws IOException - Parameters:
fileName- resource file nameclassLoader- class loader- Returns:
- XmlParser loaded from specified resource
- Throws:
IOException- when resource can't be read
-
fromInputStream
@NotNull public static @NotNull XmlParser fromInputStream(Path filePath, InputStream inputStream) throws IOException - Parameters:
filePath- file pathinputStream- input stream to read- Returns:
- XmlParser loaded from specified input stream
- Throws:
IOException- when input stream can't be read
-
getFileName
-
getDirectoryName
-
name
-
content
-
child
-
optChild
-
children
-
children
-
attributeNames
-
hasAttribute
-
readS
-
readS
-
readD
-
readD
-
readDx
-
readQ
-
readQ
-
readF
-
readF
-
readBoolean
-
readBoolean
-
readEnum
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-