public interface TransformerContext
Definition of an interface for accessing data needed by transformers.
This interface defines a set of methods for accessing system information like
the current Locale or the resource manager. A Transformer
object is passed an implementation of this interface, so it can make use of
the methods defined here to obtain the data it needs.
| Modifier and Type | Method and Description |
|---|---|
Locale |
getLocale()
Returns the current
Locale. |
ResourceManager |
getResourceManager()
Returns the current
ResourceManager. |
<T> T |
getTypedProperty(Class<T> propCls)
Returns the value of the property with the given type.
|
ValidationMessageHandler |
getValidationMessageHandler()
Returns the
ValidationMessageHandler associated with this
context. |
Map<String,Object> |
properties()
Returns a map with properties.
|
Locale getLocale()
Locale.Locale to useResourceManager getResourceManager()
ResourceManager. This object can be
used to access resources.ResourceManagerMap<String,Object> properties()
<T> T getTypedProperty(Class<T> propCls)
TransformerContext have access to a set of properties
which can impact their behavior. Using this method properties can be
queried in a type-safe way. This is in contrast to the properties
available through the properties() method. While the standard
transformer implementations shipped with this library typically use the
plain properties, this method is intended to be used by high-level custom
transformers that need access to certain application-global objects. For
instance, an application may store information about the currently edited
object in its context. A Validator implementation may then access
this data to perform specific checks. The type-safe properties available
through this method are typically disjunct to the the ones provided by
properties().An implementation should check whether a property
of the specified type is available and return it. Otherwise, the method
should return null.T - the type of the propertypropCls - the property classValidationMessageHandler getValidationMessageHandler()
ValidationMessageHandler associated with this
context. This object can be used for obtaining validation messages. It is
used for instance by concrete Validator
implementations.ValidationMessageHandler for this contextCopyright © 2016 The JGUIraffe Team. All rights reserved.