Interface XMLParser
- Author:
- Mikolaj Izdebski
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether at the current parser position there is an XML element opening tag.booleanhasStartElement(String tag) Determines whether at the current parser position there is an XML element opening tag with specified tag name.voidparseEndElement(String tag) Reads XML element closing tag with specified tag name.<Type,Bean>
voidparseEntity(Entity<Type, Bean> entity, Bean bean) Deserializes givenEntityfrom XML form.Reads XML element opening tag.voidparseStartElement(String tag) Reads XML element opening tag with specified tag name.Reads XML text content.
-
Method Details
-
parseText
Reads XML text content.If there is no XML text content at given parser position, then empty String is returned.
Comments within the text are skipped.
- Returns:
- text content that was read
- Throws:
XMLException- in case exception occurs during XML deserialization
-
hasStartElement
Determines whether at the current parser position there is an XML element opening tag.Comments and whitespace text preceding the XML tag are skipped.
- Returns:
- true iff at the current parser position there is an XML element
- Throws:
XMLException- in case exception occurs during XML deserialization
-
hasStartElement
Determines whether at the current parser position there is an XML element opening tag with specified tag name.Comments and whitespace text preceding the XML tag are skipped.
- Parameters:
tag- XML element tag name- Returns:
- true iff at the current parser position there is an XML element with specified tag name
- Throws:
XMLException- in case exception occurs during XML deserialization
-
parseStartElement
Reads XML element opening tag.Comments and whitespace text preceding the XML tag are skipped.
XMLExceptionis thrown if at the current position there is no XML element (but, for example, text data or element closing tag).- Returns:
- XML element tag name
- Throws:
XMLException- in case exception occurs during XML deserialization
-
parseStartElement
Reads XML element opening tag with specified tag name.Comments and whitespace text preceding the XML tag are skipped.
XMLExceptionis thrown if at the current position there is no XML element opening tag with specified tag (but, for example, text data, element closing tag or element opening tag with a different tag name).- Parameters:
tag- XML element tag name- Throws:
XMLException- in case exception occurs during XML deserialization
-
parseEndElement
Reads XML element closing tag with specified tag name.Comments and whitespace text preceding the XML tag are skipped.
XMLExceptionis thrown if at the current position there is no XML element closing tag with specified tag (but, for example, text data, element opening tag or XML element closing tag with a different tag name).- Parameters:
tag- XML element tag name- Throws:
XMLException- in case exception occurs during XML deserialization
-
parseEntity
Deserializes givenEntityfrom XML form.- Type Parameters:
Type- data type of entityBean- type of bean associated with the entity- Parameters:
entity- the entity type to deserializebean- the entity bean to deserialize data into- Throws:
XMLException- in case exception occurs during XML deserialization
-