C# Class NVelocity.Runtime.Directive.Parse

Pluggable directive that handles the #parse() statement in VTL. Notes: ----- 1) The parsed source material can only come from somewhere in the TemplateRoot tree for security reasons. There is no way around this. If you want to include content from elsewhere on your disk, use a link from somwhere under Template Root to that content. 2) There is a limited parse depth. It is set as a property "parse_directive.maxdepth = 10" for example. There is a 20 iteration safety in the event that the parameter isn't set.
Inheritance: Directive
显示文件 Open project: rasmus-toftdahl-olesen/NVelocity

Public Methods

Method Description
Render ( IInternalContextAdapter context, TextWriter writer, INode node ) : bool

iterates through the argument list and renders every argument that is appropriate. Any non appropriate arguments are logged, but render() continues.

Private Methods

Method Description
AssertArgument ( INode node ) : bool
AssertNodeHasValue ( INode node, IInternalContextAdapter context, Object &value ) : bool
AssertTemplateStack ( IInternalContextAdapter context ) : bool

See if we have exceeded the configured depth. If it isn't configured, put a stop at 20 just in case.

GetTemplate ( String arg, String encoding, IInternalContextAdapter context ) : Template
RenderTemplate ( Template template, String arg, TextWriter writer, IInternalContextAdapter context ) : bool

Method Details

Render() public method

iterates through the argument list and renders every argument that is appropriate. Any non appropriate arguments are logged, but render() continues.
public Render ( IInternalContextAdapter context, TextWriter writer, INode node ) : bool
context IInternalContextAdapter
writer System.IO.TextWriter
node INode
return bool