org.drools.spring.metadata
Class NameMatchMethodMetadataSource

java.lang.Object
  extended by org.drools.spring.metadata.NameMatchMethodMetadataSource
All Implemented Interfaces:
MethodMetadataSource

public class NameMatchMethodMetadataSource
extends java.lang.Object
implements MethodMetadataSource


Constructor Summary
NameMatchMethodMetadataSource()
           
 
Method Summary
 MethodMetadata getMethodMetadata(java.lang.reflect.Method method)
           
 void setNameMap(java.util.Map nameMap)
          Set the map of name to RuleMethodAttributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameMatchMethodMetadataSource

public NameMatchMethodMetadataSource()
Method Detail

getMethodMetadata

public MethodMetadata getMethodMetadata(java.lang.reflect.Method method)
Specified by:
getMethodMetadata in interface MethodMetadataSource

setNameMap

public void setNameMap(java.util.Map nameMap)
Set the map of name to RuleMethodAttributes. The methodName keys must match the value returned by Method.getName(). Overloaded methods are not explicity supported. eg: public class PojoRule { public boolean conditionOne(..) {...} public boolean conditionTwo(..) {...} public void consequence(..) {...} } Map nameMap = new HashMap(); nameMap.put("conditionOne", new RuleMethodAttributes(RuleMethodAttributes.CONDITION)); nameMap.put("conditionTwo", new RuleMethodAttributes(RuleMethodAttributes.CONDITION)); nameMap.put("consequence", new RuleMethodAttributes(RuleMethodAttributes.CONSEQUENCE)); source.setNameMap(nameMap);

Parameters:
nameMap - Map