org.thymeleaf.fragment
Class ChainedFragmentSpec

Object
  extended by org.thymeleaf.fragment.ChainedFragmentSpec
All Implemented Interfaces:
IFragmentSpec

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.

Since:
2.0.11
Author:
Daniel Fernández

Constructor Summary
ChainedFragmentSpec(IFragmentSpec fragmentSpec1, IFragmentSpec fragmentSpec2)
           Creates a new instance of this fragment spec.
 
Method Summary
 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()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedFragmentSpec

public ChainedFragmentSpec(IFragmentSpec fragmentSpec1,
                           IFragmentSpec fragmentSpec2)

Creates a new instance of this fragment spec.

Parameters:
fragmentSpec1 - the first fragment spec that will be executed.
fragmentSpec2 - the second fragment spec that will be executed.
Method Detail

getFragmentSpec1

public IFragmentSpec getFragmentSpec1()

Returns the first fragment spec in the chain.

Returns:
the fragment spec

getFragmentSpec2

public IFragmentSpec getFragmentSpec2()

Returns the second fragment spec in the chain.

This fragment spec will be executed using the output from fragmentSpec1 as input.

Returns:
the fragment spec

extractFragment

public final List<Node> extractFragment(Configuration configuration,
                                        List<Node> nodes)
Description copied from interface: IFragmentSpec

Executes the fragment specification against a list of nodes representing a DOM tree (or a set of trees), returning the extracted nodes.

Specified by:
extractFragment in interface IFragmentSpec
Parameters:
configuration - the configuration object.
nodes - the list of nodes on which to apply extraction.
Returns:
the extracted nodes.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 The THYMELEAF team. All Rights Reserved.