public class XmlResourceProcessor extends java.lang.Object
resources using the
DescriptorParser which is used as a SAX ContentHandler. The result of
processing a resource is a ModuleDescriptor.DescriptorParser,
ModuleDescriptorProvider| Modifier and Type | Field and Description |
|---|---|
protected ErrorHandler |
_errorHandler |
protected ClassResolver |
_resolver |
| Constructor and Description |
|---|
XmlResourceProcessor(ClassResolver resolver,
ErrorHandler errorHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected ModuleDescriptor |
parseResource(Resource resource,
javax.xml.parsers.SAXParser parser,
DescriptorParser contentHandler)
Returns the ModuleDescriptor obtained by parsing the specified Resource using the given
SAXParser and DescriptorParser. |
ModuleDescriptor |
processResource(Resource resource)
Initializes the
parser,
processes the Resource, resets the parser, and finally
returns the parsed ModuleDescriptor. |
protected ClassResolver _resolver
protected ErrorHandler _errorHandler
public XmlResourceProcessor(ClassResolver resolver, ErrorHandler errorHandler)
public ModuleDescriptor processResource(Resource resource)
parser,
processes the Resource, resets the parser, and finally
returns the parsed ModuleDescriptor.ApplicationRuntimeException - Thrown if errors are encountered while parsing the resource.protected ModuleDescriptor parseResource(Resource resource, javax.xml.parsers.SAXParser parser, DescriptorParser contentHandler) throws org.xml.sax.SAXException, java.io.IOException
SAXParser and DescriptorParser. Called by processResource(Resource)
after the DescriptorParser has been
initialized. Suitable for
overriding by subclasses.org.xml.sax.SAXExceptionjava.io.IOException