Griffon 1.2.0

griffon.core.resources
[Java] Interface ResourceResolver


public interface ResourceResolver

Interface for resolving resources, with support for the parameterization and internationalization of such resources.

Authors:
Andres Almiray
Alexander Klein
Since:
1.1.0


Method Summary
Object resolveResource(String key)

Try to resolve the resource.

Object resolveResource(String key, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, Object[] args)

Try to resolve the resource.

Object resolveResource(String key, Object[] args, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, List args)

Try to resolve the resource.

Object resolveResource(String key, List args, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, Object defaultValue)

Try to resolve the resource.

Object resolveResource(String key, Object defaultValue, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, Object[] args, Object defaultValue)

Try to resolve the resource.

Object resolveResource(String key, Object[] args, Object defaultValue, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, List args, Object defaultValue)

Try to resolve the resource.

Object resolveResource(String key, List args, Object defaultValue, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, Map args)

Try to resolve the resource.

Object resolveResource(String key, Map args, Locale locale)

Try to resolve the resource.

Object resolveResource(String key, Map args, Object defaultValue)

Try to resolve the resource.

Object resolveResource(String key, Map args, Object defaultValue, Locale locale)

Try to resolve the resource.

 

Method Detail

resolveResource

public Object resolveResource(String key)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Locale locale)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, Object[] args)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Object[] args, Locale locale)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, List args)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, List args, Locale locale)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, Object defaultValue)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
defaultValue - Message to return if the lookup fails
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Object defaultValue, Locale locale)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
defaultValue - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, Object[] args, Object defaultValue)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Object[] args, Object defaultValue, Locale locale)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, List args, Object defaultValue)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, List args, Object defaultValue, Locale locale)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{0}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, Map args)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{:key}" within a resource, but this might differ between implementations), or null if none.
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Map args, Locale locale)
Try to resolve the resource.
throws:
NoSuchResourceException if no resource is found
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{:key}" within a resource, but this might differ between implementations), or null if none.
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


resolveResource

public Object resolveResource(String key, Map args, Object defaultValue)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{:key}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
Returns:
The resolved resource at the given key for the default locale


resolveResource

public Object resolveResource(String key, Map args, Object defaultValue, Locale locale)
Try to resolve the resource. Return default resource if no resource was found.
Parameters:
key - Key to lookup, such as 'sample.SampleModel.icon'
args - Arguments that will be filled in for params within the resource (params look like "{:key}" within a resource, but this might differ between implementations), or null if none.
defaultValue - Message to return if the lookup fails
locale - Locale in which to lookup
Returns:
The resolved resource at the given key for the given locale


 

Groovy Documentation