站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

XmlPackageReader (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.xml
Class XmlPackageReader

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.drools.xml.XmlPackageReader
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class XmlPackageReader
extends DefaultHandler

RuleSet loader. Note you can override the default entity resolver by setting the System property of: org.drools.io.EntityResolve to your own custom entity resolver. This can be done using -Dorg.drools.io.EntityResolver=YourClassHere on the command line, for instance.

Author:
bob mcwhirter

Field Summary
static String ENTITY_RESOLVER_PROPERTY_NAME
           
static String RULES_NAMESPACE_URI
          Namespace URI for the general tags.
 
Constructor Summary
XmlPackageReader()
          Construct.
XmlPackageReader(SAXParser parser)
          Construct.
 
Method Summary
 void characters(char[] chars, int start, int len)
           
protected  Configuration endConfiguration()
          End a configuration node.
 void endElement(String uri, String localName, String qname)
           
 void endPrefixMapping(String prefix)
           
 void error(SAXParseException x)
           
 void fatalError(SAXParseException x)
           
 Locator getLocator()
          Get the Locator.
 PackageDescr getPackageDescr()
           
 PackageDescr read(InputSource in)
          Read a RuleSet from an InputSource.
 PackageDescr read(InputStream inputStream)
          Read a RuleSet from an InputStream.
 PackageDescr read(Reader reader)
          Read a RuleSet from a Reader.
 InputSource resolveEntity(String publicId, String systemId)
           
 void setDocumentLocator(Locator locator)
           
protected  void startConfiguration(String name, Attributes attrs)
          Start a configuration node.
 void startDocument()
           
 void startElement(String uri, String localName, String qname, Attributes attrs)
           
 void startPrefixMapping(String prefix, String uri)
           
 void warning(SAXParseException x)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY_RESOLVER_PROPERTY_NAME

public static final String ENTITY_RESOLVER_PROPERTY_NAME
See Also:
Constant Field Values

RULES_NAMESPACE_URI

public static final String RULES_NAMESPACE_URI
Namespace URI for the general tags.

See Also:
Constant Field Values
Constructor Detail

XmlPackageReader

public XmlPackageReader()
Construct.

Uses the default JAXP SAX parser and the default classpath-based DefaultSemanticModule.


XmlPackageReader

public XmlPackageReader(SAXParser parser)
Construct.

Uses the default classpath-based DefaultSemanticModule.

Parameters:
parser - The SAX parser.
Method Detail

read

public PackageDescr read(Reader reader)
                  throws SAXException,
                         IOException
Read a RuleSet from a Reader.

Parameters:
reader - The reader containing the rule-set.
Returns:
The rule-set.
Throws:
SAXException
IOException

read

public PackageDescr read(InputStream inputStream)
                  throws SAXException,
                         IOException
Read a RuleSet from an InputStream.

Parameters:
inputStream - The input-stream containing the rule-set.
Returns:
The rule-set.
Throws:
SAXException
IOException

read

public PackageDescr read(InputSource in)
                  throws SAXException,
                         IOException
Read a RuleSet from an InputSource.

Parameters:
in - The rule-set input-source.
Returns:
The rule-set.
Throws:
SAXException
IOException

getPackageDescr

public PackageDescr getPackageDescr()

setDocumentLocator

public void setDocumentLocator(Locator locator)
Specified by:
setDocumentLocator in interface ContentHandler
Overrides:
setDocumentLocator in class DefaultHandler
See Also:
ContentHandler

getLocator

public Locator getLocator()
Get the Locator.

Returns:
The locator.

startDocument

public void startDocument()
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler

startElement

public void startElement(String uri,
                         String localName,
                         String qname,
                         Attributes attrs)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri -
localName -
qname -
attrs -
Throws:
SAXException
See Also:
ContentHandler

endElement

public void endElement(String uri,
                       String localName,
                       String qname)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
uri -
localName -
qname -
Throws:
SAXException
See Also:
ContentHandler

startConfiguration

protected void startConfiguration(String name,
                                  Attributes attrs)
Start a configuration node.

Parameters:
name - Tag name.
attrs - Tag attributes.

characters

public void characters(char[] chars,
                       int start,
                       int len)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
chars -
start -
len -
See Also:
ContentHandler

endConfiguration

protected Configuration endConfiguration()
End a configuration node.

Returns:
The configuration.

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException
Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class DefaultHandler
Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class DefaultHandler
Throws:
SAXException

warning

public void warning(SAXParseException x)
Specified by:
warning in interface ErrorHandler
Overrides:
warning in class DefaultHandler

error

public void error(SAXParseException x)
Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler

fatalError

public void fatalError(SAXParseException x)
                throws SAXParseException
Specified by:
fatalError in interface ErrorHandler
Overrides:
fatalError in class DefaultHandler
Throws:
SAXParseException


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.