Class AbstractDirective
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.struts2.views.velocity.components.AbstractDirective
- All Implemented Interfaces:
- Cloneable,- org.apache.velocity.runtime.directive.DirectiveConstants
- Direct Known Subclasses:
- ActionDirective,- ActionErrorDirective,- ActionMessageDirective,- AnchorDirective,- BeanDirective,- CheckBoxDirective,- CheckBoxListDirective,- ComboBoxDirective,- ComponentDirective,- DateDirective,- DoubleSelectDirective,- FieldErrorDirective,- FileDirective,- FormDirective,- HeadDirective,- HiddenDirective,- I18nDirective,- IncludeDirective,- InputTransferSelectDirective,- LabelDirective,- OptGroupDirective,- OptionTransferSelectDirective,- ParamDirective,- PasswordDirective,- PropertyDirective,- PushDirective,- RadioDirective,- ResetDirective,- SelectDirective,- SetDirective,- SubmitDirective,- TextAreaDirective,- TextDirective,- TextFieldDirective,- TokenDirective,- UpDownSelectDirective,- URLDirective
public abstract class AbstractDirective
extends org.apache.velocity.runtime.directive.Directive
- 
Field SummaryFields inherited from class org.apache.velocity.runtime.directive.Directivelog, rsvcFields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstantsBLOCK, LINE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected MapcreatePropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) Create a Map of properties that the user has passed in.protected abstract ComponentgetBean(ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) abstract StringgetName()intgetType()protected voidputProperty(Map propertyMap, org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) adds a given Node's key/value pair to the propertyMap.booleanrender(org.apache.velocity.context.InternalContextAdapter ctx, Writer writer, org.apache.velocity.runtime.parser.node.Node node) Methods inherited from class org.apache.velocity.runtime.directive.DirectivecheckArgs, getColumn, getLine, getScopeName, getTemplate, getTemplateName, init, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
- 
Constructor Details- 
AbstractDirectivepublic AbstractDirective()
 
- 
- 
Method Details- 
getName- Specified by:
- getNamein class- org.apache.velocity.runtime.directive.Directive
 
- 
getBeanName
- 
getTypepublic int getType()- Specified by:
- getTypein class- org.apache.velocity.runtime.directive.Directive
- Returns:
- All components, unless otherwise stated, are LINE-level directives.
 
- 
getBeanprotected abstract Component getBean(ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) 
- 
renderpublic boolean render(org.apache.velocity.context.InternalContextAdapter ctx, Writer writer, org.apache.velocity.runtime.parser.node.Node node) throws IOException, org.apache.velocity.exception.ResourceNotFoundException, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException - Specified by:
- renderin class- org.apache.velocity.runtime.directive.Directive
- Throws:
- IOException
- org.apache.velocity.exception.ResourceNotFoundException
- org.apache.velocity.exception.ParseErrorException
- org.apache.velocity.exception.MethodInvocationException
 
- 
createPropertyMapprotected Map createPropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException Create a Map of properties that the user has passed in. For example: #xxx("name=hello" "value=world" "template=foo")would yield a params that contains {["name", "hello"], ["value", "world"], ["template", "foo"]} - Parameters:
- contextAdapter- the context adapter
- node- the Node passed in to the render method
- Returns:
- a Map of the user specified properties
- Throws:
- org.apache.velocity.exception.ParseErrorException- if the was an error in the format of the property
- org.apache.velocity.exception.MethodInvocationException
 
- 
putPropertyprotected void putProperty(Map propertyMap, org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException adds a given Node's key/value pair to the propertyMap. For example, if this Node contained the value "rows=20", then the key, rows, would be added to the propertyMap with the String value, 20.- Parameters:
- propertyMap- a params containing all the properties that we wish to set
- contextAdapter- the context adapter
- node- the parameter to set expressed in "name=value" format
- Throws:
- org.apache.velocity.exception.ParseErrorException- in case of parsing errors
- org.apache.velocity.exception.MethodInvocationException- in case of method invocation errors
 
 
-