org.drools.smf
Class SemanticsReader

java.lang.Object
  extended byorg.drools.smf.SemanticsReader

public class SemanticsReader
extends java.lang.Object

Loader of SemanticModule s from a set of properties.

The required properties are:

Instances of SemanticsReader are re-entrant and thread-safe. The singleton may be used simultaneously by multiple threads.

 

Constructor Summary
SemanticsReader()
          Construct.
 
Method Summary
static SemanticsReader getInstance()
          Retrieve the singleton instance.
protected  java.lang.String parseName(java.lang.String key)
           
protected  java.lang.String parseType(java.lang.String key)
           
 SemanticModule read(java.io.InputStream in)
          Read a semantic module descriptor from an InputStream.
 SemanticModule read(java.net.URL url)
          Read a semantic module descriptor from a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemanticsReader

public SemanticsReader()
Construct.

Method Detail

getInstance

public static SemanticsReader getInstance()
Retrieve the singleton instance.

Returns:
The singleton instance.

read

public SemanticModule read(java.net.URL url)
                    throws java.io.IOException,
                           SemanticsReaderException
Read a semantic module descriptor from a URL.

Throws:
java.io.IOException
SemanticsReaderException
Parameters:
url - The descriptor URL.
Returns:
The loaded semantic module.

read

public SemanticModule read(java.io.InputStream in)
                    throws java.io.IOException,
                           SemanticsReaderException
Read a semantic module descriptor from an InputStream.

Throws:
java.io.IOException - If an error occurs while loading the module.
SemanticsReaderException - If an error occurs while loading the module.
Parameters:
in - The descriptor input stream.
Returns:
The loaded semantic module.

parseType

protected java.lang.String parseType(java.lang.String key)

parseName

protected java.lang.String parseName(java.lang.String key)