net.sf.morph.integration.velocity
Class ReflectorVelocityContext

java.lang.Object
  extended by org.apache.velocity.context.AbstractContext
      extended by net.sf.morph.integration.velocity.ReflectorVelocityContext
All Implemented Interfaces:
org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext

public class ReflectorVelocityContext
extends org.apache.velocity.context.AbstractContext

Single parent bean Velocity context implemented with a Reflector.

Since:
Morph 1.1
Author:
Matt Benson

Constructor Summary
ReflectorVelocityContext()
          Create a new ReflectorVelocityContext which must subsequently have its bean property set.
ReflectorVelocityContext(java.lang.Object bean)
          Create a new ReflectorVelocityContext.
ReflectorVelocityContext(java.lang.Object bean, BeanReflector reflector)
          Create a new ReflectorVelocityContext.
ReflectorVelocityContext(java.lang.Object bean, BeanReflector reflector, org.apache.velocity.context.Context inner)
          Create a new ReflectorVelocityContext.
ReflectorVelocityContext(java.lang.Object bean, org.apache.velocity.context.Context inner)
          Create a new ReflectorVelocityContext.
 
Method Summary
 org.apache.velocity.app.event.EventCartridge attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0)
           
 boolean getAllowRendering()
           
 java.lang.Object getBean()
          Get the bean.
 org.apache.velocity.runtime.resource.Resource getCurrentResource()
           
 java.lang.String getCurrentTemplateName()
           
 org.apache.velocity.app.event.EventCartridge getEventCartridge()
           
 BeanReflector getReflector()
          Get the reflector.
 java.lang.Object[] getTemplateNameStack()
           
 org.apache.velocity.util.introspection.IntrospectionCacheData icacheGet(java.lang.Object arg0)
           
 void icachePut(java.lang.Object arg0, org.apache.velocity.util.introspection.IntrospectionCacheData arg1)
           
 boolean internalContainsKey(java.lang.Object arg0)
          
 java.lang.Object internalGet(java.lang.String arg0)
          
 java.lang.Object[] internalGetKeys()
          
 java.lang.Object internalPut(java.lang.String arg0, java.lang.Object arg1)
          
 java.lang.Object internalRemove(java.lang.Object arg0)
          Set to null and take our lumps.
 void popCurrentTemplateName()
           
 void pushCurrentTemplateName(java.lang.String arg0)
           
 void setAllowRendering(boolean arg0)
           
 void setBean(java.lang.Object bean)
          Set the bean.
 void setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0)
           
 void setReflector(BeanReflector reflector)
          Set the reflector.
 
Methods inherited from class org.apache.velocity.context.AbstractContext
containsKey, get, getChainedContext, getKeys, put, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectorVelocityContext

public ReflectorVelocityContext()
Create a new ReflectorVelocityContext which must subsequently have its bean property set.


ReflectorVelocityContext

public ReflectorVelocityContext(java.lang.Object bean)
Create a new ReflectorVelocityContext.

Parameters:
bean -

ReflectorVelocityContext

public ReflectorVelocityContext(java.lang.Object bean,
                                org.apache.velocity.context.Context inner)
Create a new ReflectorVelocityContext.

Parameters:
bean -
inner -

ReflectorVelocityContext

public ReflectorVelocityContext(java.lang.Object bean,
                                BeanReflector reflector)
Create a new ReflectorVelocityContext.

Parameters:
bean -
reflector -

ReflectorVelocityContext

public ReflectorVelocityContext(java.lang.Object bean,
                                BeanReflector reflector,
                                org.apache.velocity.context.Context inner)
Create a new ReflectorVelocityContext.

Parameters:
bean -
reflector -
inner -
Method Detail

internalContainsKey

public boolean internalContainsKey(java.lang.Object arg0)

Specified by:
internalContainsKey in class org.apache.velocity.context.AbstractContext

internalGet

public java.lang.Object internalGet(java.lang.String arg0)

Specified by:
internalGet in class org.apache.velocity.context.AbstractContext

internalGetKeys

public java.lang.Object[] internalGetKeys()

Specified by:
internalGetKeys in class org.apache.velocity.context.AbstractContext

internalPut

public java.lang.Object internalPut(java.lang.String arg0,
                                    java.lang.Object arg1)

Specified by:
internalPut in class org.apache.velocity.context.AbstractContext

internalRemove

public java.lang.Object internalRemove(java.lang.Object arg0)
Set to null and take our lumps.

Specified by:
internalRemove in class org.apache.velocity.context.AbstractContext

getBean

public java.lang.Object getBean()
Get the bean.

Returns:
Object

setBean

public void setBean(java.lang.Object bean)
Set the bean.

Parameters:
bean - the Object to set

getReflector

public BeanReflector getReflector()
Get the reflector.

Returns:
BeanReflector

setReflector

public void setReflector(BeanReflector reflector)
Set the reflector.

Parameters:
reflector - the BeanReflector to set

pushCurrentTemplateName

public void pushCurrentTemplateName(java.lang.String arg0)

popCurrentTemplateName

public void popCurrentTemplateName()

getCurrentTemplateName

public java.lang.String getCurrentTemplateName()

getTemplateNameStack

public java.lang.Object[] getTemplateNameStack()

icacheGet

public org.apache.velocity.util.introspection.IntrospectionCacheData icacheGet(java.lang.Object arg0)

icachePut

public void icachePut(java.lang.Object arg0,
                      org.apache.velocity.util.introspection.IntrospectionCacheData arg1)

setCurrentResource

public void setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0)

getCurrentResource

public org.apache.velocity.runtime.resource.Resource getCurrentResource()

getAllowRendering

public boolean getAllowRendering()

setAllowRendering

public void setAllowRendering(boolean arg0)

attachEventCartridge

public org.apache.velocity.app.event.EventCartridge attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0)
Specified by:
attachEventCartridge in interface org.apache.velocity.context.InternalEventContext

getEventCartridge

public org.apache.velocity.app.event.EventCartridge getEventCartridge()
Specified by:
getEventCartridge in interface org.apache.velocity.context.InternalEventContext


Copyright © 2004-2008.