net.sourceforge.nrl.parser.operators
Interface IOperator

All Known Implementing Classes:
Operator

public interface IOperator

An IOperator is a scripted, programmed or otherwise externally defined extension that can be dynamically referred to in rules.

As a minimum, an operator needs to have a name. It does not necessarily have to have an implementation associated with it.


Method Summary
 String getDocumentation()
          Get the documentation string attached to this operator, if any.
 String getImplementationDetail(String label)
          Get an implementation detail associated with the operator, given its label.
 Collection<IImplementationDetail> getImplementationDetails()
          Return all implementation details associated with the operator.
 String getName()
          Return the operator name.
 NRLDataType getNRLReturnType()
          Returns the return type of the operator.
 IParameter getParameter(String name)
          Return a parameter by name
 List<IParameter> getParameters()
          Return a list of IParameter objects.
 String getPurpose()
          Return the purpose of this operator.
 IModelElement getReturnType()
          Return the return type of the operator.
 String getReturnTypeName()
          Return the name of the return type as found in the definition
 List<NRLError> resolveModelReferences(IModelCollection models)
          Resolve all parameter type and return type references against models.
 void setNRLReturnType(NRLDataType type)
          Set the NRL type of the return type
 void setReturnType(IModelElement returnType)
          Set the type this operator will return.
 void setReturnTypeName(String name)
          Set the raw name of the return type.
 

Method Detail

getDocumentation

String getDocumentation()
Get the documentation string attached to this operator, if any.

Returns:
the documentation or null

getImplementationDetail

String getImplementationDetail(String label)
Get an implementation detail associated with the operator, given its label. This is used by mappings to targets like Java or rule engines to obtain supplementary mapping information.

See IImplementationDetail for more information.

Parameters:
label - the label
Returns:
the detail value or null if not found

getImplementationDetails

Collection<IImplementationDetail> getImplementationDetails()
Return all implementation details associated with the operator. This is used for mappings, see IImplementationDetail for more information.

Note that this does not return the implementation details associated with parameters of the operators - those have to be read off the individual parameters.

Returns:
a collection of IImplementationDetail objects

getName

String getName()
Return the operator name.

Returns:
the operator name

getParameter

IParameter getParameter(String name)
Return a parameter by name

Parameters:
name - parameter name
Returns:
the parameter or null if not found

getParameters

List<IParameter> getParameters()
Return a list of IParameter objects.

Returns:
the parameters expected by the operator

getPurpose

String getPurpose()
Return the purpose of this operator. The use of this is entirely implementation-dependent.

Returns:
the purpose

getReturnTypeName

String getReturnTypeName()
Return the name of the return type as found in the definition

Returns:
the name

getReturnType

IModelElement getReturnType()
Return the return type of the operator. You must call resolveModelReferences(IModelCollection) before this.

Returns:
the return type or null if not specified.

getNRLReturnType

NRLDataType getNRLReturnType()
Returns the return type of the operator. If it is not defined, this returns NRLDataType.UNKNOWN.

Returns:
the return type

resolveModelReferences

List<NRLError> resolveModelReferences(IModelCollection models)
Resolve all parameter type and return type references against models.

Parameters:
models - the models
Returns:
any errors encountered

setReturnType

void setReturnType(IModelElement returnType)
Set the type this operator will return.

Parameters:
returnType - the type

setReturnTypeName

void setReturnTypeName(String name)
Set the raw name of the return type.

Parameters:
name - the name

setNRLReturnType

void setNRLReturnType(NRLDataType type)
Set the NRL type of the return type

Parameters:
type - the type


Copyright © 2006-2010 Christian Nentwich and others