Package io.quarkus.qute
Interface SectionHelperFactory.SectionInitContext
-
- All Superinterfaces:
ErrorInitializer,SectionHelperFactory.ParserDelegate
- Enclosing interface:
- SectionHelperFactory<T extends SectionHelper>
public static interface SectionHelperFactory.SectionInitContext extends SectionHelperFactory.ParserDelegate
Section initialization context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default SectionBlockgetBlock(String label)List<SectionBlock>getBlocks()Supplier<Template>getCurrentTemplate()Note that the returned supplier may only be used after the template is parsed, e.g.EnginegetEngine()ExpressiongetExpression(String parameterName)Note that the expression must be registered in theSectionHelperFactory.initializeBlock(Scope, BlockInfo)first.default TemplateNode.OrigingetOrigin()default StringgetParameter(String name)default StringgetParameterOrDefault(String name, String defaultValue)default Map<String,String>getParameters()default booleanhasParameter(String name)ExpressionparseValue(String value)Parse the specified value.-
Methods inherited from interface io.quarkus.qute.ErrorInitializer
error
-
Methods inherited from interface io.quarkus.qute.SectionHelperFactory.ParserDelegate
createParserError
-
-
-
-
Method Detail
-
hasParameter
default boolean hasParameter(String name)
- Returns:
trueif the main block declares a parameter of the given name
-
getParameter
default String getParameter(String name)
- Returns:
- the parameter, or null/
Parameter.EMPTYif the main block does not declare a parameter of the given name
-
getParameterOrDefault
default String getParameterOrDefault(String name, String defaultValue)
- Parameters:
name-defaultValue-- Returns:
- the param or the default value if not specified
-
getExpression
Expression getExpression(String parameterName)
Note that the expression must be registered in theSectionHelperFactory.initializeBlock(Scope, BlockInfo)first.- Parameters:
parameterName-- Returns:
- the expression registered for the main block under the specified param name, or
null - See Also:
SectionHelperFactory.BlockInfo.addExpression(String, String)
-
parseValue
Expression parseValue(String value)
Parse the specified value. The expression is not registered in the template.- Parameters:
value-- Returns:
- a new expression
-
getBlocks
List<SectionBlock> getBlocks()
-
getBlock
default SectionBlock getBlock(String label)
- Parameters:
label-- Returns:
- the first block with the given label, or {code null} if no such exists
-
getEngine
Engine getEngine()
- Returns:
- the engine
-
getOrigin
default TemplateNode.Origin getOrigin()
- Returns:
- the origin of the section start tag
-
getCurrentTemplate
Supplier<Template> getCurrentTemplate()
Note that the returned supplier may only be used after the template is parsed, e.g. during the invocation ofSectionHelper.resolve(io.quarkus.qute.SectionHelper.SectionResolutionContext).- Returns:
- the current template
-
-