Class ConfigurationHTTPAdapterParser
java.lang.Object
com.espertech.esperio.http.config.ConfigurationHTTPAdapterParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
doConfigure
(ConfigurationHTTPAdapter configuration, InputStream stream, String resourceName) Use the configuration specified in the given input stream.protected static void
doConfigure
(ConfigurationHTTPAdapter configuration, Document doc) Parse the W3C DOM document.protected static Document
getDocument
(InputStream stream, String resourceName) Returns the document.protected static InputStream
getResourceAsStream
(String resource) Returns an input stream from an application resource in the classpath.
-
Constructor Details
-
ConfigurationHTTPAdapterParser
public ConfigurationHTTPAdapterParser()
-
-
Method Details
-
doConfigure
protected static void doConfigure(ConfigurationHTTPAdapter configuration, InputStream stream, String resourceName) throws RuntimeException Use the configuration specified in the given input stream.- Parameters:
configuration
- is the configuration object to populatestream
- Inputstream to be read fromresourceName
- The name to use in warning/error messages- Throws:
RuntimeException
- is thrown when the configuration could not be parsed
-
getDocument
protected static Document getDocument(InputStream stream, String resourceName) throws RuntimeException Returns the document.- Parameters:
stream
- to readresourceName
- resource in stream- Returns:
- document
- Throws:
RuntimeException
- if the document could not be loaded or parsed
-
doConfigure
protected static void doConfigure(ConfigurationHTTPAdapter configuration, Document doc) throws RuntimeException Parse the W3C DOM document.- Parameters:
configuration
- is the configuration object to populatedoc
- to parse- Throws:
RuntimeException
- to indicate parse errors
-
getResourceAsStream
Returns an input stream from an application resource in the classpath.- Parameters:
resource
- to get input stream for- Returns:
- input stream for resource
-