Copyright © 2009, 2010 Nu Echo Inc. All Rights Reserved.

com.nuecho.application.grammarserver.servlets
Class SingleJsonContextInitializer

java.lang.Object
  extended by com.nuecho.application.grammarserver.servlets.SingleJsonContextInitializer
All Implemented Interfaces:
ContextInitializer

public final class SingleJsonContextInitializer
extends java.lang.Object
implements ContextInitializer

Implementation of ContextInitializer that expects the "context" key, in the parameterMap, to be a JSON string. That single string is converted to a JSON value representing the whole instantiation context map, from which keys and values are extracted to get the actual instantiation context.

Version:
2.0.0
See Also:
ContextInitializer

Constructor Summary
SingleJsonContextInitializer()
           
 
Method Summary
 java.util.Map getContext(java.util.Map parameteters, GrammarFragmentFactory factory, CacheControl control)
          Computes an instantiation context from a map of parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleJsonContextInitializer

public SingleJsonContextInitializer()
Method Detail

getContext

public java.util.Map getContext(java.util.Map parameteters,
                                GrammarFragmentFactory factory,
                                CacheControl control)
                         throws ContextInitializationException
Description copied from interface: ContextInitializer
Computes an instantiation context from a map of parameters. Each parameter name (a string) is bound to an array of values (an array of Java strings).

Specified by:
getContext in interface ContextInitializer
Parameters:
parameteters - the input parameters
factory - a grammar fragment factory object
control - a cache control object
Returns:
the instantiation context that maps strings to objects.
Throws:
ContextInitializationException - when an error occurs during the building of the instantiation context

Copyright © 2009, 2010 Nu Echo Inc. All Rights Reserved.