Class CompositeContext

java.lang.Object
com.atlassian.confluence.velocity.context.CompositeContext
All Implemented Interfaces:
org.apache.velocity.context.Context
Direct Known Subclasses:
CompositeContext

public class CompositeContext extends Object implements org.apache.velocity.context.Context
Simple immutable composite Velocity Context implementation that delegates to a collection of other contexts. The order of the contexts is significant as it checks them in iteration order. This context should be wrapped in a VelocityContext or other chained context before use.
Since:
9.1
  • Constructor Details

    • CompositeContext

      protected CompositeContext(Iterable<? extends org.apache.velocity.context.Context> contexts)
  • Method Details

    • composite

      public static org.apache.velocity.context.Context composite(@NonNull Iterable<? extends org.apache.velocity.context.Context> contexts)
    • reverseComposite

      public static org.apache.velocity.context.Context reverseComposite(@NonNull Iterable<? extends org.apache.velocity.context.Context> contexts)
    • containsKey

      public boolean containsKey(Object o)
      Specified by:
      containsKey in interface org.apache.velocity.context.Context
    • get

      public Object get(String key)
      Specified by:
      get in interface org.apache.velocity.context.Context
    • getKeys

      public Object[] getKeys()
      Union of all keys for all contexts.
      Specified by:
      getKeys in interface org.apache.velocity.context.Context
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface org.apache.velocity.context.Context
    • remove

      public Object remove(Object key)
      Specified by:
      remove in interface org.apache.velocity.context.Context