Package org.hibernate.processor.util.xml
Class XmlParserHelper
java.lang.Object
org.hibernate.processor.util.xml.XmlParserHelper
Provides common functionality used for XML parsing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable InputStream
getInputStreamForResource
(String resource) Returns an input stream for the specified resource.<T> T
getJaxbRoot
(InputStream stream, Class<T> clazz, Schema schema)
-
Constructor Details
-
XmlParserHelper
-
-
Method Details
-
getInputStreamForResource
Returns an input stream for the specified resource. First an attempt is made to load the resource via theFiler
API and if that failsClass.getResourceAsStream(java.lang.String)
is used.- Parameters:
resource
- the resource to load- Returns:
- an input stream for the specified resource or
null
in case resource cannot be loaded
-
getSchema
- Throws:
XmlParsingException
-
getJaxbRoot
public <T> T getJaxbRoot(InputStream stream, Class<T> clazz, Schema schema) throws XmlParsingException - Throws:
XmlParsingException
-