com.atlassian.confluence.velocity.context
Class ChainedVelocityContext
java.lang.Object
org.apache.velocity.context.AbstractContext
org.apache.velocity.VelocityContext
com.atlassian.confluence.velocity.context.ChainedVelocityContext
- All Implemented Interfaces:
- java.lang.Cloneable, org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext
public final class ChainedVelocityContext
- extends org.apache.velocity.VelocityContext
Replace the chaining provided by AbstractContext
because it has broken implementations of containsKey() and getKeys() in Velocity 1.5.
This class works around the broken implementations of containsKey() by checking the result of
get() instead.
Constructor Summary |
ChainedVelocityContext(org.apache.velocity.context.Context delegate)
Creates a new chained context using the provided delegate context for secondary lookups. |
Method Summary |
boolean |
internalContainsKey(java.lang.Object key)
|
java.lang.Object |
internalGet(java.lang.String key)
|
java.lang.Object[] |
internalGetKeys()
This method is inherently unreliable because the implementation of AbstractContext.getKeys() used in
other Velocity contexts doesn't delegate correctly. |
Methods inherited from class org.apache.velocity.VelocityContext |
clone, internalPut, internalRemove |
Methods inherited from class org.apache.velocity.context.AbstractContext |
containsKey, get, getChainedContext, getKeys, put, remove |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChainedVelocityContext
public ChainedVelocityContext(org.apache.velocity.context.Context delegate)
- Creates a new chained context using the provided delegate context for secondary lookups.
- Parameters:
delegate
- the delegate context which is checked after this context
- Throws:
java.lang.IllegalArgumentException
- if delegate is null
internalGet
public java.lang.Object internalGet(java.lang.String key)
- Overrides:
internalGet
in class org.apache.velocity.VelocityContext
internalContainsKey
public boolean internalContainsKey(java.lang.Object key)
- Overrides:
internalContainsKey
in class org.apache.velocity.VelocityContext
internalGetKeys
public java.lang.Object[] internalGetKeys()
- This method is inherently unreliable because the implementation of AbstractContext.getKeys() used in
other Velocity contexts doesn't delegate correctly. Because of this, the result may not contains all
the keys of the delegate context.
- Overrides:
internalGetKeys
in class org.apache.velocity.VelocityContext
Copyright © 2003-2013 Atlassian. All Rights Reserved.