net.sf.morph.context
Interface DecoratedContext

All Superinterfaces:
Context
All Known Implementing Classes:
BaseContext, BaseHierarchicalContext, ContextDecorator, HttpServletContext, JspContext, MapContext, ReflectorHierarchicalContext

public interface DecoratedContext
extends Context

Adds the capabilities of a Language and a Converter to a Context to expose additional functionality.

You should not directly implement this interface, because additional methods may be introduced in later versions of Morph. Instead, implement the Context interface and use the ContextDecorator to expose this interface.

Since:
Dec 5, 2004
Author:
Matt Sgarlata

Method Summary
 java.lang.Object get(java.lang.String expression)
          Retrieve the property named propertyName.
 java.lang.Object get(java.lang.String expression, java.lang.Class destinationClass)
          Retrieve the information indicated by expression as the type indicated by destinationClass.
 java.lang.Object get(java.lang.String expression, java.lang.Class destinationClass, java.util.Locale locale)
          Retrieve the information indicated by expression as the type indicated by destinationClass.
 java.lang.Object get(java.lang.String expression, java.util.Locale locale, java.lang.Class destinationClass)
          Retrieve the information indicated by expression as the type indicated by destinationClass.
 void set(java.lang.String expression, java.lang.Object value)
          Sets the information indicated by expression to value, which will be automatically converted to a type appropriate for the given expression.
 void set(java.lang.String expression, java.lang.Object value, java.util.Locale locale)
          Sets the information indicated by expression on target.
 
Methods inherited from interface net.sf.morph.context.Context
getPropertyNames
 

Method Detail

get

java.lang.Object get(java.lang.String expression)
                     throws ContextException
Retrieve the property named propertyName. The property named Context#PROPERTY_NAMES_PROPERTYhas special symantics. Unless a value for this property has already been explicitly specified for the context, context.get(PROPERTY_NAMES_PROPERTY) should return the same result as Context.getPropertyNames().

Specified by:
get in interface Context
Parameters:
expression - an expression in a language that defines the property to be retrieved
Returns:
the requested value
Throws:
ContextException - if the expression is invalid or an error occurrs while attempting to retrieve the requested information

get

java.lang.Object get(java.lang.String expression,
                     java.lang.Class destinationClass)
                     throws ContextException
Retrieve the information indicated by expression as the type indicated by destinationClass.

Parameters:
expression - an expression specifying which information to retrieve
destinationClass - indicates the type that should be returned by this method
Returns:
the requested value
Throws:
ContextException - if the expression is invalid or an error occurrs while attempting to retrieve the requested information

get

java.lang.Object get(java.lang.String expression,
                     java.lang.Class destinationClass,
                     java.util.Locale locale)
                     throws ContextException
Retrieve the information indicated by expression as the type indicated by destinationClass.

Parameters:
expression - an expression specifying which information to retrieve
destinationClass - indicates the type that should be returned by this method
locale - indicates the locale in which the conversion to type destinationClass should be performed, if applicable
Returns:
the requested value
Throws:
ContextException - if the expression is invalid or an error occurrs while attempting to retrieve the requested information

get

java.lang.Object get(java.lang.String expression,
                     java.util.Locale locale,
                     java.lang.Class destinationClass)
                     throws ContextException
Retrieve the information indicated by expression as the type indicated by destinationClass.

Parameters:
expression - an expression specifying which information to retrieve
locale - indicates the locale in which the conversion to type destinationClass should be performed, if applicable
destinationClass - indicates the type that should be returned by this method
Returns:
the requested value
Throws:
ContextException - if the expression is invalid or an error occurred while attempting to retrieve the requested information

set

void set(java.lang.String expression,
         java.lang.Object value)
         throws ContextException
Sets the information indicated by expression to value, which will be automatically converted to a type appropriate for the given expression.

Specified by:
set in interface Context
Parameters:
expression - an expression specifying which information will be modified
value - the information to be changed
Throws:
ContextException - if the given expression is invalid or an error occurred while attempting to set the given value

set

void set(java.lang.String expression,
         java.lang.Object value,
         java.util.Locale locale)
         throws ContextException
Sets the information indicated by expression on target. value will be automatically converted to a type appropriate for the given expression.

Parameters:
expression - an expression specifying which information will be modified
value - the information to be changed
locale - indicates the locale in which the conversion to type destinationClass should be performed, if applicable
Throws:
ContextException - if the given expression is invalid or an error occurred while attempting to set the given value


Copyright © 2004-2008.