public final class ChainedFragmentSpec extends Object implements IFragmentSpec
Implementation of IFragmentSpec
that allows the execution of
two fragment specs in chain, effectively performing a double-filering.
Objects of this class are thread-safe.
Constructor and Description |
---|
ChainedFragmentSpec(IFragmentSpec fragmentSpec1,
IFragmentSpec fragmentSpec2)
Creates a new instance of this fragment spec.
|
Modifier and Type | Method and Description |
---|---|
List<Node> |
extractFragment(Configuration configuration,
List<Node> nodes)
Executes the fragment specification against a list of nodes representing a DOM tree
(or a set of trees), returning the extracted nodes.
|
IFragmentSpec |
getFragmentSpec1()
Returns the first fragment spec in the chain.
|
IFragmentSpec |
getFragmentSpec2()
Returns the second fragment spec in the chain.
|
String |
toString() |
public ChainedFragmentSpec(IFragmentSpec fragmentSpec1, IFragmentSpec fragmentSpec2)
Creates a new instance of this fragment spec.
fragmentSpec1
- the first fragment spec that will be executed.fragmentSpec2
- the second fragment spec that will be executed.public IFragmentSpec getFragmentSpec1()
Returns the first fragment spec in the chain.
public IFragmentSpec getFragmentSpec2()
Returns the second fragment spec in the chain.
This fragment spec will be executed using the output from fragmentSpec1 as input.
public List<Node> extractFragment(Configuration configuration, List<Node> nodes)
IFragmentSpec
Executes the fragment specification against a list of nodes representing a DOM tree (or a set of trees), returning the extracted nodes.
extractFragment
in interface IFragmentSpec
configuration
- the configuration object.nodes
- the list of nodes on which to apply extraction.Copyright © 2016 The THYMELEAF team. All rights reserved.