com.atlassian.jira.util
Class I18nHelperComponentAdapter

java.lang.Object
  extended by com.atlassian.jira.config.component.AbstractComponentAdaptor<I18nHelper>
      extended by com.atlassian.jira.util.I18nHelperComponentAdapter
All Implemented Interfaces:
org.picocontainer.ComponentAdapter

public class I18nHelperComponentAdapter
extends AbstractComponentAdaptor<I18nHelper>

A component adapter that creates I18nHelper proxies. Whenever a method is called on the proxy, it will call I18nHelper.BeanFactory.getInstance(com.atlassian.crowd.embedded.api.User) to obtain a real I18nHelper for the user that is currently logged in, and will delegate the call to the real implementation.

Since:
v6.0
See Also:
DateTimeFormatterFactory.formatter()

Field Summary
 
Fields inherited from class com.atlassian.jira.config.component.AbstractComponentAdaptor
container, interfaceClass
 
Constructor Summary
I18nHelperComponentAdapter()
           
 
Method Summary
 Class<?> getComponentImplementation()
           
 Object getComponentInstance()
           
protected  I18nHelper.BeanFactory getFactoryFromContainer()
          Returns an I18nHelper instance from the container.
protected
<T> T
getInstanceFromContainer(Class<T> cls)
          Returns an instance from the PICO container.
 void verify()
           
 
Methods inherited from class com.atlassian.jira.config.component.AbstractComponentAdaptor
getComponentKey, getContainer, setContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18nHelperComponentAdapter

public I18nHelperComponentAdapter()
Method Detail

getComponentImplementation

public Class<?> getComponentImplementation()
Specified by:
getComponentImplementation in interface org.picocontainer.ComponentAdapter
Specified by:
getComponentImplementation in class AbstractComponentAdaptor<I18nHelper>

getComponentInstance

public Object getComponentInstance()
                            throws org.picocontainer.PicoInitializationException,
                                   org.picocontainer.PicoIntrospectionException
Specified by:
getComponentInstance in interface org.picocontainer.ComponentAdapter
Specified by:
getComponentInstance in class AbstractComponentAdaptor<I18nHelper>
Throws:
org.picocontainer.PicoInitializationException
org.picocontainer.PicoIntrospectionException

verify

public void verify()
            throws org.picocontainer.defaults.UnsatisfiableDependenciesException
Specified by:
verify in interface org.picocontainer.ComponentAdapter
Overrides:
verify in class AbstractComponentAdaptor<I18nHelper>
Throws:
org.picocontainer.defaults.UnsatisfiableDependenciesException

getFactoryFromContainer

protected I18nHelper.BeanFactory getFactoryFromContainer()
Returns an I18nHelper instance from the container.

Returns:
an I18nHelper

getInstanceFromContainer

protected <T> T getInstanceFromContainer(Class<T> cls)
Returns an instance from the PICO container.

Parameters:
cls - the Class to look for
Returns:
an instance of cls


Copyright © 2002-2013 Atlassian. All Rights Reserved.