Class XmlParserHelper
java.lang.Object
org.hibernate.validator.internal.xml.XmlParserHelper
Provides common functionality used within the different XML descriptor
parsers.
- Author:
- Gunnar Morling
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateXmlEventReader
(String resourceName, InputStream xmlStream) Returns the XML schema identified by the given resource name.getSchemaVersion
(String resourceName, XMLEventReader xmlEventReader) Retrieves the schema version applying for the given XML input stream as represented by the "version" attribute of the root element of the stream.
-
Constructor Details
-
XmlParserHelper
public XmlParserHelper()
-
-
Method Details
-
getSchemaVersion
Retrieves the schema version applying for the given XML input stream as represented by the "version" attribute of the root element of the stream.The given reader will be advanced to the root element of the given XML structure. It can be used for unmarshalling from there.
- Parameters:
resourceName
- The name of the represented XML resource.xmlEventReader
- An STAX event reader- Returns:
- The value of the "version" attribute. For compatibility with BV 1.0, "1.0" will be returned if the given stream doesn't have a "version" attribute.
-
createXmlEventReader
-
getSchema
Returns the XML schema identified by the given resource name.- Parameters:
schemaResource
- the resource name identifying the schema.- Returns:
- the schema identified by the given resource name or
null
if the resource was not found or could not be loaded.
-