com.spun.util.velocity.ContextAware Maven / Gradle / Ivy
package com.spun.util.velocity;
import org.apache.velocity.context.Context;
import java.util.HashMap;
import java.util.Map.Entry;
public interface ContextAware
{
public void setupContext(Context context);
/* INNER CLASS */
public static class ContextAwareMap implements ContextAware
{
HashMap add = new HashMap();
public ContextAwareMap()
{
}
public ContextAwareMap(String key, Object object)
{
put(key, object);
}
public void put(String key, Object object)
{
add.put(key, object);
}
public void setupContext(Context context)
{
for (Entry entry : add.entrySet())
{
context.put(entry.getKey(), entry.getValue());
}
}
}
}