public class ExtensibleXmlParser extends org.xml.sax.helpers.DefaultHandler
RuleSet
loader.
Note you can override the default entity resolver by setting the System property of:
org.kie.api.io.EntityResolve
to your own custom entity resolver.
This can be done using -Dorg.drools.io.EntityResolver=YourClassHere on the command line, for instance.Modifier and Type | Class and Description |
---|---|
static class |
ExtensibleXmlParser.Null |
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_RESOLVER_PROPERTY_NAME |
protected static org.slf4j.Logger |
logger |
static String |
RULES_NAMESPACE_URI
Namespace URI for the general tags.
|
Constructor and Description |
---|
ExtensibleXmlParser()
Construct.
|
ExtensibleXmlParser(SAXParser parser)
Construct.
|
endDocument, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, unparsedEntityDecl
protected static final transient org.slf4j.Logger logger
public static final String ENTITY_RESOLVER_PROPERTY_NAME
public static final String RULES_NAMESPACE_URI
public ExtensibleXmlParser()
Uses the default JAXP SAX parser and the default classpath-based
DefaultSemanticModule
.
public ExtensibleXmlParser(SAXParser parser)
Uses the default classpath-based DefaultSemanticModule
.
parser
- The SAX parser.public void setSemanticModules(SemanticModules modules)
public Object read(Reader reader) throws SAXException, IOException
RuleSet
from a Reader
.reader
- The reader containing the rule-set.ParserConfigurationException
SAXException
IOException
public Object read(InputStream inputStream) throws SAXException, IOException
RuleSet
from an InputStream
.inputStream
- The input-stream containing the rule-set.ParserConfigurationException
SAXException
IOException
public Object read(InputSource in) throws SAXException, IOException
RuleSet
from an InputSource
.in
- The rule-set input-source.ParserConfigurationException
SAXException
IOException
public void setData(Object data)
public Object getData()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
public Map getMetaData()
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
ContentHandler
public Locator getLocator()
Locator
.public void startDocument()
startDocument
in interface ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(String uri, String localName, String qname, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- localName
- qname
- attrs
- SAXException
ContentHandler
public void endElement(String uri, String localName, String qname) throws SAXException
endElement
in interface ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- localName
- qname
- SAXException
ContentHandler
public void startElementBuilder(String tagName, Attributes attrs)
tagName
- Tag name.attrs
- Tag attributes.public void characters(char[] chars, int start, int len)
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
chars
- start
- len
- ContentHandler
public Element endElementBuilder()
public Object getParent()
public SAXParser getParser()
public Object getParent(int index)
public Object removeParent()
public LinkedList getParents()
public Object getPeer()
public Object getCurrent()
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
SAXException
protected String buildPrintMessage(SAXParseException x)
public void warning(SAXParseException x)
warning
in interface ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
public void error(SAXParseException x)
error
in interface ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
public void fatalError(SAXParseException x) throws SAXParseException
fatalError
in interface ErrorHandler
fatalError
in class org.xml.sax.helpers.DefaultHandler
SAXParseException
public int getTimeout()
public void setTimeout(int timeout)
timeout
- public Attributes getAttrs()
public void setParser(SAXParser parser)
Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.