Class XmlParserHelper
- java.lang.Object
-
- org.hibernate.jpamodelgen.util.xml.XmlParserHelper
-
public class XmlParserHelper extends Object
Provides common functionality used for XML parsing.
-
-
Constructor Summary
Constructors Constructor Description XmlParserHelper(Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetInputStreamForResource(String resource)Returns an input stream for the specified resource.<T> TgetJaxbRoot(InputStream stream, Class<T> clazz, Schema schema)SchemagetSchema(String schemaResource)
-
-
-
Constructor Detail
-
XmlParserHelper
public XmlParserHelper(Context context)
-
-
Method Detail
-
getInputStreamForResource
public InputStream getInputStreamForResource(String resource)
Returns an input stream for the specified resource. First an attempt is made to load the resource via theFilerAPI 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
nullin case resource cannot be loaded
-
getSchema
public Schema getSchema(String schemaResource) throws XmlParsingException
- Throws:
XmlParsingException
-
getJaxbRoot
public <T> T getJaxbRoot(InputStream stream, Class<T> clazz, Schema schema) throws XmlParsingException
- Throws:
XmlParsingException
-
-