org.drools.jsr94.rules.admin
Class RuleImpl

java.lang.Object
  extended by org.drools.jsr94.rules.admin.RuleImpl
All Implemented Interfaces:
Serializable, Rule

public class RuleImpl
extends Object
implements Rule

The Drools implementation of the Rule interface which provides access to simple metadata for a rule. Related Rule instances are assembled into RuleExecutionSets, which in turn, can be executed by a rules engine via the RuleSession interface.

Author:
N. Alex Rupp (n_alex codehaus.org), thomas diesler
See Also:
Rule, Serialized Form

Constructor Summary
RuleImpl(Rule rule)
          Creates a RuleImpl object by wrapping an org.drools.rule.Rule object.
 
Method Summary
 String getDescription()
          Get a description of the rule.
 String getName()
          Get the name of this rule.
 Object getProperty(Object key)
          Get a user-defined or Drools-defined property.
(package private)  Rule getRule()
          Returns the org.drools.rule.Rule that lies at the core of this javax.rules.admin.Rule object.
 void setProperty(Object key, Object value)
          Set a user-defined or Drools-defined property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleImpl

RuleImpl(Rule rule)
Creates a RuleImpl object by wrapping an org.drools.rule.Rule object.

Parameters:
rule - the org.drools.rule.Rule object to be wrapped.
Method Detail

getRule

Rule getRule()
Returns the org.drools.rule.Rule that lies at the core of this javax.rules.admin.Rule object. This method is package private.

Returns:
org.drools.rule.Rule at the core of this object.

getName

public String getName()
Get the name of this rule.

Specified by:
getName in interface Rule
Returns:
The name of this rule.

getDescription

public String getDescription()
Get a description of the rule.

Specified by:
getDescription in interface Rule
Returns:
A description of the rule or null of no description is specified.

getProperty

public Object getProperty(Object key)
Get a user-defined or Drools-defined property.

Specified by:
getProperty in interface Rule
Parameters:
key - the key to use to retrieve the property
Returns:
the value bound to the key or null

setProperty

public void setProperty(Object key,
                        Object value)
Set a user-defined or Drools-defined property.

Specified by:
setProperty in interface Rule
Parameters:
key - the key for the property value
value - the value to associate with the key


Copyright © 2001-2005 The Codehaus. All Rights Reserved.