Interface XMLParser
- All Known Implementing Classes:
XMLParserImpl
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether at the current parser position there is an XML element opening tag.boolean
hasStartElement
(String tag) Determines whether at the current parser position there is an XML element opening tag with specified tag name.void
parseEndElement
(String tag) Reads XML element closing tag with specified tag name.<Type,
Bean>
voidparseEntity
(Entity<Type, Bean> entity, Bean bean) Deserializes givenEntity
from XML form.Reads XML element opening tag.void
parseStartElement
(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.
XMLException
is 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.
XMLException
is 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.
XMLException
is 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 givenEntity
from 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
-