Class AtlassianMethodTranslator

java.lang.Object
org.apache.velocity.util.introspection.MethodTranslatorImpl
com.atlassian.velocity.allowlist.uberspect.AtlassianMethodTranslator
All Implemented Interfaces:
org.apache.velocity.util.introspection.MethodTranslator

public class AtlassianMethodTranslator extends org.apache.velocity.util.introspection.MethodTranslatorImpl
For use with Velocity configuration property introspector.method.translator in products where any of the following proxies are present:
  • HibernateProxy
  • Spring InfrastructureProxy
  • Spring TargetClassAware based proxy
  • ContextClassLoaderSettingInvocationHandler backed OSGi service dynamic proxy
  • AnnotationPreservingInvocationHandler backed HtmlSafe dynamic proxy
  • HostComponentFactoryBean$DynamicServiceInvocationHandler backed OSGi component dynamic proxy
It additionally rectifies cases where the method resolved from the engine is an interface method, by finding the most specific method in the target class.
Since:
6.0.0
  • Field Details

  • Constructor Details

    • AtlassianMethodTranslator

      public AtlassianMethodTranslator() throws Exception
      Throws:
      Exception
  • Method Details

    • getTranslatedMethod

      public Method getTranslatedMethod(Object target, Method method)
      Specified by:
      getTranslatedMethod in interface org.apache.velocity.util.introspection.MethodTranslator
      Overrides:
      getTranslatedMethod in class org.apache.velocity.util.introspection.MethodTranslatorImpl
    • getUnproxiedSpecificMethodCached

      protected Method getUnproxiedSpecificMethodCached(Object target, Method method)
    • getUnproxiedSpecificMethod

      protected Method getUnproxiedSpecificMethod(Object target, Method method)
    • unproxyingFunctions

      protected List<Function<Object,?>> unproxyingFunctions()
      Can be overridden to add more unproxying functions, perhaps product-specific.
    • classUnproxyingFunction

      protected Class<?> classUnproxyingFunction(Object target)
      An unproxying function that can only resolve the target class rather than the instance.
    • getHibernateProxyTarget

      protected Object getHibernateProxyTarget(Object proxy)
    • getSpringAdvisedProxyTarget

      protected Object getSpringAdvisedProxyTarget(Object proxy)
    • getSpringInfraProxyTarget

      protected Object getSpringInfraProxyTarget(Object proxy)
    • getContextClassLoaderProxyTarget

      protected Object getContextClassLoaderProxyTarget(Object proxy)
    • getHtmlSafeProxyTarget

      protected Object getHtmlSafeProxyTarget(Object proxy)
    • getOsgiComponentProxyTarget

      protected Object getOsgiComponentProxyTarget(Object proxy)