public final Document load(String source) {
SourceResolver resolver = null;
SAXParser parser = null;
Source assertionsource = null;
Document assertiondocument = null;
try {
resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
assertNotNull("Test lookup of source resolver", resolver);
parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
assertNotNull("Test lookup of parser", parser);
assertNotNull("Test if assertion document is not null",
source);
assertionsource = resolver.resolveURI(source);
assertNotNull("Test lookup of assertion source",
assertionsource);
assertTrue("Test if source exist", assertionsource.exists());
DOMBuilder builder = new DOMBuilder();
assertNotNull("Test if inputstream of the assertion source is not null",
assertionsource.getInputStream());
parser.parse(new InputSource(assertionsource.getInputStream()),
new WhitespaceFilter(builder),
builder);
assertiondocument = builder.getDocument();
assertNotNull("Test if assertion document exists", assertiondocument);