org.drools.smf
Class SimpleSemanticModule

java.lang.Object
  |
  +--org.drools.smf.SimpleSemanticModule
All Implemented Interfaces:
SemanticModule

public class SimpleSemanticModule
extends java.lang.Object
implements SemanticModule

Simple implementation of a Semantic Module.

Author:
bob mcwhirter
See Also:
org.drools.spi

Constructor Summary
SimpleSemanticModule(java.lang.String uri)
          Construct with a URI.
 
Method Summary
 void addCondition(java.lang.String name, java.lang.Class condition)
          Add a semantic condition.
 void addConsequence(java.lang.String name, java.lang.Class consequence)
          Add a semantic consequence.
 void addExtractor(java.lang.String name, java.lang.Class extractor)
          Add a semantic extractor.
 void addObjectType(java.lang.String name, java.lang.Class objectType)
          Add a semantic object type.
 java.lang.Class getCondition(java.lang.String name)
          Retrieve a semantic condition by name.
 java.util.Set getConditionNames()
          Retrieve the set of all condition names.
 java.lang.Class getConsequence(java.lang.String name)
          Retrieve a semantic consequence by name.
 java.util.Set getConsequenceNames()
          Retrieve the set of all object type names.
 java.lang.Class getExtractor(java.lang.String name)
          Retrieve a semantic extractor by name.
 java.util.Set getExtractorNames()
          Retrieve the set of all object type names.
 java.lang.Class getObjectType(java.lang.String name)
          Retrieve a semantic object type by name.
 java.util.Set getObjectTypeNames()
          Retrieve the set of all object type names.
 java.lang.String getUri()
          Retrieve the URI that identifies this semantic module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSemanticModule

public SimpleSemanticModule(java.lang.String uri)
Construct with a URI.
Parameters:
uri - The URI the identifies this semantic module.
Method Detail

getUri

public java.lang.String getUri()
Retrieve the URI that identifies this semantic module.
Specified by:
getUri in interface SemanticModule
Returns:
The URI.

addObjectType

public void addObjectType(java.lang.String name,
                          java.lang.Class objectType)
                   throws InvalidObjectTypeException
Add a semantic object type.
Parameters:
name - The object type name.
objectType - The object type implementation.
Throws:
InvalidObjectTypeException - If a class that is not a object type is added.

getObjectType

public java.lang.Class getObjectType(java.lang.String name)
Retrieve a semantic object type by name.
Specified by:
getObjectType in interface SemanticModule
Parameters:
name - the name.
Returns:
The object type implementation or null if none is bound to the name.

getObjectTypeNames

public java.util.Set getObjectTypeNames()
Retrieve the set of all object type names.
Specified by:
getObjectTypeNames in interface SemanticModule
Returns:
The set of names.

addCondition

public void addCondition(java.lang.String name,
                         java.lang.Class condition)
                  throws InvalidConditionException
Add a semantic condition.
Parameters:
name - The condition name.
condition - The condition implementation.
Throws:
InvalidConditionException - If a class that is not a condition is added.

getCondition

public java.lang.Class getCondition(java.lang.String name)
Retrieve a semantic condition by name.
Specified by:
getCondition in interface SemanticModule
Parameters:
name - the name.
Returns:
The condition implementation or null if none is bound to the name.

getConditionNames

public java.util.Set getConditionNames()
Retrieve the set of all condition names.
Specified by:
getConditionNames in interface SemanticModule
Returns:
The set of names.

addExtractor

public void addExtractor(java.lang.String name,
                         java.lang.Class extractor)
                  throws InvalidExtractorException
Add a semantic extractor.
Parameters:
name - The extractor name.
extractor - The extractor implementation.
Throws:
InvalidExtractorException - If a class that is not a extractor is added.

getExtractor

public java.lang.Class getExtractor(java.lang.String name)
Retrieve a semantic extractor by name.
Specified by:
getExtractor in interface SemanticModule
Parameters:
name - the name.
Returns:
The extractor implementation or null if none is bound to the name.

getExtractorNames

public java.util.Set getExtractorNames()
Retrieve the set of all object type names.
Specified by:
getExtractorNames in interface SemanticModule
Returns:
The set of names.

addConsequence

public void addConsequence(java.lang.String name,
                           java.lang.Class consequence)
                    throws InvalidConsequenceException
Add a semantic consequence.
Parameters:
name - The consequence name.
consequence - The consequence implementation.
Throws:
InvalidConsequenceException - If a class that is not a consequence is added.

getConsequence

public java.lang.Class getConsequence(java.lang.String name)
Retrieve a semantic consequence by name.
Specified by:
getConsequence in interface SemanticModule
Parameters:
name - the name.
Returns:
The consequence implementation or null if none is bound to the name.

getConsequenceNames

public java.util.Set getConsequenceNames()
Retrieve the set of all object type names.
Specified by:
getConsequenceNames in interface SemanticModule
Returns:
The set of names.


Copyright © 2001-2002 The Werken Company. All Rights Reserved.