public class

LazyComponentReference

extends Object
java.lang.Object
   ↳ com.atlassian.confluence.util.LazyComponentReference

Class Overview

Lazily loads the component from the ContainerManager and memoize the result.

Summary

Public Constructors
LazyComponentReference()
Public Methods
static <T> Supplier<T> containerComponent(String name)
Static factory that takes the component name and the type.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public LazyComponentReference ()

Public Methods

public static Supplier<T> containerComponent (String name)

Static factory that takes the component name and the type.

Note this is unsafe as it doesn't actually cast until the usage site due to erasure.

Parameters
name the name of the component
Returns
  • the accessed component or any exception encountered when trying to retrieve it