org.quattor.pan.template
Class FunctionMap

java.lang.Object
  extended by org.quattor.pan.template.FunctionMap

public class FunctionMap
extends java.lang.Object


Constructor Summary
FunctionMap()
           
 
Method Summary
 FunctionDefinition get(java.lang.String name)
          Return the function definition associated with the given name or null if it doesn't exist.
 void put(java.lang.String name, Operation function, Template template, SourceRange sourceRange)
          Define the given DML block as a function with the given name in this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionMap

public FunctionMap()
Method Detail

get

public FunctionDefinition get(java.lang.String name)
Return the function definition associated with the given name or null if it doesn't exist. It will always return null if the argument is null.

Parameters:
name - name of the function to retrieve
Returns:
FunctionDefinition associated with the given name or null if it doesn't exist

put

public void put(java.lang.String name,
                Operation function,
                Template template,
                SourceRange sourceRange)
         throws EvaluationException
Define the given DML block as a function with the given name in this context. Note that functions may not be redefined; attempting to do so will throw an EvaluationException.

Parameters:
name - name for the function
function - code for the function as a DML block
template - template in which this function is defined (used for error handling)
sourceRange - location in the template where this function is defined (used for error handling)
Throws:
EvaluationException - if a function with the given name already exists


Copyright © 2011 Quattor. All Rights Reserved.