com.cafesoft.cams.attr.func
Class FunctionFactory

java.lang.Object
  extended by com.cafesoft.cams.attr.func.FunctionFactory

public class FunctionFactory
extends Object

FunctionFactory is used to create all attribute-related functions. Three singleton factories are defined:

  1. general factory - provides functions that can be used anywhere.
  2. condition factory - provides functions that may be used only in a conditions root.
  3. target factory - provides functions that can be used only within an attribute target

Please note that all functions are singletons, so any instance that is added to the factory will be the same one returned from the create methods. Most functions don't have state, so there is no need to have more than one.

Since:
05/25/2004

Method Summary
 Function createFunction(String functionId)
          Tries to get an instance of the specified function.
 Function createFunction(URI functionId)
          Tries to get an instance of the specified function.
static FunctionFactory getConditionInstance()
          Returns a FuntionFactory that will only provide those functions that are usable in the root of the Condition.
static FunctionFactory getGeneralInstance()
          Returns a FunctionFactory that provides access to all the functions.
static FunctionFactory getTargetInstance()
          Returns a FunctionFactory that will only provide those functions that are usable in Target matching.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTargetInstance

public static FunctionFactory getTargetInstance()
Returns a FunctionFactory that will only provide those functions that are usable in Target matching.

Returns:
a FunctionFactory for target functions.

getConditionInstance

public static FunctionFactory getConditionInstance()
Returns a FuntionFactory that will only provide those functions that are usable in the root of the Condition. These Functions are a superset of the Target functions.

Returns:
a FunctionFactory for condition functions

getGeneralInstance

public static FunctionFactory getGeneralInstance()
Returns a FunctionFactory that provides access to all the functions. These Functions are a superset of the Condition functions.

Returns:
a FunctionFactory for all functions

createFunction

public Function createFunction(URI functionId)
                        throws UnknownFunctionException
Tries to get an instance of the specified function.

Parameters:
functionId - the name of the function
Returns:
the Function
Throws:
UnknownIdentifierException - if the name isn't known
UnknownFunctionException

createFunction

public Function createFunction(String functionId)
                        throws UnknownFunctionException
Tries to get an instance of the specified function.

Parameters:
functionId - the name of the function
Returns:
the Function
Throws:
UnknownFunctionException - if the Function is unknown.


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.