public class XmlParserHelper extends Object
Provides common functionality used for XML parsing.
Constructor and Description |
---|
XmlParserHelper(Context context) |
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStreamForResource(String resource)
Returns an input stream for the specified resource.
|
<T> T |
getJaxbRoot(InputStream stream,
Class<T> clazz,
Schema schema) |
Schema |
getSchema(String schemaResource) |
public XmlParserHelper(Context context)
public InputStream getInputStreamForResource(String resource)
Returns an input stream for the specified resource. First an attempt is made to load the resource
via the Filer
API and if that fails Class.getResourceAsStream(java.lang.String)
is used.
resource
- the resource to loadnull
in case resource cannot be loadedpublic Schema getSchema(String schemaResource) throws XmlParsingException
XmlParsingException
public <T> T getJaxbRoot(InputStream stream, Class<T> clazz, Schema schema) throws XmlParsingException
XmlParsingException
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.