Package net.obvj.confectory.mapper
Class DocumentMapper
- java.lang.Object
-
- net.obvj.confectory.mapper.DocumentMapper
-
public class DocumentMapper extends Object implements Mapper<Document>
A specializedMapperthat loads the contents of a valid XMLSource(e.g.: file, URL) as a W3CDocument.This allows fetching the contents using XPath expressions.
NOTE: DOCTYPE declarations (either internal or external) are disabled for security reasons.
- Since:
- 2.4.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description DocumentMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Documentapply(InputStream inputStream)Applies thisMapperinto the given input.ConfigurationHelper<Document>configurationHelper(Document document)Creates a newConfigurationHelperinstance recommended by thisMapper.
-
-
-
Method Detail
-
apply
public Document apply(InputStream inputStream) throws IOException
Description copied from interface:MapperApplies thisMapperinto the given input.Note: The input stream must be closed by the caller after the mapping operation.
- Specified by:
applyin interfaceMapper<Document>- Parameters:
inputStream- the input stream to be mapped- Returns:
- the mapped object
- Throws:
IOException- if a low-level I/O problem (such and unexpected end-of-input, or network error) occurs
-
configurationHelper
public ConfigurationHelper<Document> configurationHelper(Document document)
Description copied from interface:MapperCreates a newConfigurationHelperinstance recommended by thisMapper.- Specified by:
configurationHelperin interfaceMapper<Document>- Parameters:
document- the configuration object to be used by the helper- Returns:
- a new
ConfigurationHelperinstance
-
-