Package io.quarkus.qute
Class LoopSectionHelper.Factory
- java.lang.Object
-
- io.quarkus.qute.LoopSectionHelper.Factory
-
- All Implemented Interfaces:
SectionHelperFactory<LoopSectionHelper>
- Enclosing class:
- LoopSectionHelper
public static class LoopSectionHelper.Factory extends Object implements SectionHelperFactory<LoopSectionHelper>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.quarkus.qute.SectionHelperFactory
SectionHelperFactory.BlockInfo, SectionHelperFactory.ParametersInfo, SectionHelperFactory.ParserDelegate, SectionHelperFactory.SectionInitContext
-
-
Field Summary
Fields Modifier and Type Field Description static StringHINT_ELEMENTstatic StringHINT_METADATAstatic StringHINT_PREFIXstatic StringITERATION_METADATA_PREFIX_ALIAS_QMConstant value for iteration metadata prefix indicating that the alias suffixed with a question mark should be used.static StringITERATION_METADATA_PREFIX_ALIAS_UNDERSCOREConstant value for iteration metadata prefix indicating that the alias suffixed with an underscore should be used.static StringITERATION_METADATA_PREFIX_NONEConstant value for iteration metadata prefix indicating that no prefix should be used.-
Fields inherited from interface io.quarkus.qute.SectionHelperFactory
MAIN_BLOCK_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getBlockLabels()A nested section tag that matches a name of a block will be added as a block to the current section.List<String>getDefaultAliases()SectionHelperFactory.ParametersInfogetParameters()A factory may definefactory parametersfor the start tag of any section block.LoopSectionHelperinitialize(SectionHelperFactory.SectionInitContext context)ScopeinitializeBlock(Scope previousScope, SectionHelperFactory.BlockInfo block)Initialize a section block.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.qute.SectionHelperFactory
cacheFactoryConfig, treatUnknownSectionsAsBlocks
-
-
-
-
Field Detail
-
ITERATION_METADATA_PREFIX_ALIAS_QM
public static final String ITERATION_METADATA_PREFIX_ALIAS_QM
Constant value for iteration metadata prefix indicating that the alias suffixed with a question mark should be used.- See Also:
- Constant Field Values
-
ITERATION_METADATA_PREFIX_ALIAS_UNDERSCORE
public static final String ITERATION_METADATA_PREFIX_ALIAS_UNDERSCORE
Constant value for iteration metadata prefix indicating that the alias suffixed with an underscore should be used.- See Also:
- Constant Field Values
-
ITERATION_METADATA_PREFIX_NONE
public static final String ITERATION_METADATA_PREFIX_NONE
Constant value for iteration metadata prefix indicating that no prefix should be used.- See Also:
- Constant Field Values
-
HINT_ELEMENT
public static final String HINT_ELEMENT
- See Also:
- Constant Field Values
-
HINT_METADATA
public static final String HINT_METADATA
- See Also:
- Constant Field Values
-
HINT_PREFIX
public static final String HINT_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Factory
public Factory()
-
Factory
public Factory(String metadataPrefix)
-
-
Method Detail
-
getDefaultAliases
public List<String> getDefaultAliases()
- Specified by:
getDefaultAliasesin interfaceSectionHelperFactory<LoopSectionHelper>- Returns:
- the list of default aliases used to match the helper
- See Also:
SectionHelperFactory.cacheFactoryConfig()
-
getParameters
public SectionHelperFactory.ParametersInfo getParameters()
Description copied from interface:SectionHelperFactoryA factory may definefactory parametersfor the start tag of any section block. A factoryParameterhas a name and optional default value. The default value is automatically assigned if no other value is set by a parser. A parameter may be optional. A non-optional parameter that has no value assigned results in a parser error.A section block in a template defines the
actual parameters:{! The value is "item.isActive". The name is not defined. !} {#if item.isActive}{/} {! The name is "age" and the value is "10". !} {#let age=10}{/}The actual parameters are parsed taking the factory parameters into account:- Named actual params are processed first and the relevant values are assigned, e.g. the param with name
agehas the value10, - Then, if the number of actual params is greater or equals to the number of factory params the values are set according to position of factory params,
- Otherwise, the values are set according to position but params with no default value take precedence.
- Finally, all unset parameters that define a default value are initialized with the default value.
- Specified by:
getParametersin interfaceSectionHelperFactory<LoopSectionHelper>- Returns:
- the factory parameters
- See Also:
SectionHelperFactory.cacheFactoryConfig(),SectionHelperFactory.BlockInfo.getParameters()
- Named actual params are processed first and the relevant values are assigned, e.g. the param with name
-
getBlockLabels
public List<String> getBlockLabels()
Description copied from interface:SectionHelperFactoryA nested section tag that matches a name of a block will be added as a block to the current section.- Specified by:
getBlockLabelsin interfaceSectionHelperFactory<LoopSectionHelper>- Returns:
- the list of block labels
- See Also:
SectionHelperFactory.cacheFactoryConfig()
-
initialize
public LoopSectionHelper initialize(SectionHelperFactory.SectionInitContext context)
- Specified by:
initializein interfaceSectionHelperFactory<LoopSectionHelper>- Returns:
- a new helper instance
-
initializeBlock
public Scope initializeBlock(Scope previousScope, SectionHelperFactory.BlockInfo block)
Description copied from interface:SectionHelperFactoryInitialize a section block.- Specified by:
initializeBlockin interfaceSectionHelperFactory<LoopSectionHelper>- Returns:
- a new scope if this section introduces a new scope, or the outer scope
- See Also:
SectionHelperFactory.BlockInfo.addExpression(String, String)
-
-