|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.thymeleaf.standard.fragment.StandardFragment
public final class StandardFragment
Object modelling the result of resolving a standard fragment specification, after all its expressions have been evaluated, its parameters parsed, etc.
Note that the specified template can be null, in which case the fragment will
be considered to be executed on the current template (obtained from the
IProcessingContext argument in
extractFragment(org.thymeleaf.Configuration, org.thymeleaf.context.IProcessingContext,
org.thymeleaf.TemplateRepository)
,
which will therefore need to be an instance of
Arguments
).
Constructor Summary | |
---|---|
StandardFragment(String templateName,
IFragmentSpec fragmentSpec,
Map<String,Object> parameters)
Create a new instance of this class. |
|
StandardFragment(String templateName,
IFragmentSpec fragmentSpec,
Map<String,Object> parameters,
String dialectPrefix,
String fragmentSignatureAttributeName)
Create a new instance of this class. |
Method Summary | |
---|---|
List<Node> |
extractFragment(Configuration configuration,
IProcessingContext context,
TemplateRepository templateRepository)
Read the specified template from TemplateRepository , and then apply
the IFragmentSpec to the result of parsing it (the template). |
IFragmentSpec |
getFragmentSpec()
Returns the IFragmentSpec that will be applied to the template. |
Map<String,Object> |
getParameters()
Returns the parameters that will be applied to the fragment. |
String |
getTemplateName()
Returns the name of the template that will be resolved and parsed. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardFragment(String templateName, IFragmentSpec fragmentSpec, Map<String,Object> parameters)
Create a new instance of this class.
templateName
- the name of the template that will be resolved and parsed, null if
fragment is to be executed on the current template.fragmentSpec
- the fragment spec that will be applied to the template, once parsed.parameters
- the parameters to be applied to the fragment, when processed.public StandardFragment(String templateName, IFragmentSpec fragmentSpec, Map<String,Object> parameters, String dialectPrefix, String fragmentSignatureAttributeName)
Create a new instance of this class.
This constructor allows the specification of the attribute in which a fragment signature could be found (if applicable, can be null) so that this signature is processed if found and the specified fragment parameters are processed and adapted accordingly (e.g. matching of synthetic --not named-- parameters).
templateName
- the name of the template that will be resolved and parsed, null if
fragment is to be executed on the current template.fragmentSpec
- the fragment spec that will be applied to the template, once parsed.parameters
- the parameters to be applied to the fragment, when processed.dialectPrefix
- the dialect prefix to be applied to the attribute name in which we could expect to find a
fragment. Can be null.fragmentSignatureAttributeName
- the name of the attribute in which we could expect to find a
fragment. Can be null.Method Detail |
---|
public String getTemplateName()
Returns the name of the template that will be resolved and parsed.
public IFragmentSpec getFragmentSpec()
Returns the IFragmentSpec
that will be applied to the template.
public Map<String,Object> getParameters()
Returns the parameters that will be applied to the fragment.
public List<Node> extractFragment(Configuration configuration, IProcessingContext context, TemplateRepository templateRepository)
Read the specified template from TemplateRepository
, and then apply
the IFragmentSpec
to the result of parsing it (the template).
Fragment parameters will also be processed and applied as local variables of the returned nodes.
In order to execute on the current template (templateName == null), the context
argument will need to be an Arguments
object.
configuration
- the configuration to be used for resolving the template and
processing the fragment spec.context
- the processing context to be used for resolving and parsing the template.templateRepository
- the template repository to be asked for the template.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |