Package org.smooks.engine.memento
Class TextAccumulatorMemento
- java.lang.Object
-
- org.smooks.engine.memento.TextAccumulatorMemento
-
- All Implemented Interfaces:
Memento
- Direct Known Subclasses:
TextAccumulatorVisitorMemento
public class TextAccumulatorMemento extends Object implements Memento
-
-
Field Summary
Fields Modifier and Type Field Description protected String
anchor
protected Fragment<?>
fragment
protected StringBuilder
stringBuilder
-
Constructor Summary
Constructors Constructor Description TextAccumulatorMemento(Fragment<?> fragment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextAccumulatorMemento
accumulateText(String text)
Memento
copy()
Performs a deep clone of thisMemento
.String
getAnchor()
Gets the anchor value of thisMemento
.Fragment<?>
getFragment()
String
getText()
void
restore(Memento memento)
Combines aMemento
state with thisMemento
-
-
-
Field Detail
-
fragment
protected final Fragment<?> fragment
-
stringBuilder
protected final StringBuilder stringBuilder
-
anchor
protected String anchor
-
-
Constructor Detail
-
TextAccumulatorMemento
public TextAccumulatorMemento(Fragment<?> fragment)
-
-
Method Detail
-
copy
public Memento copy()
Description copied from interface:Memento
Performs a deep clone of thisMemento
.
-
restore
public void restore(Memento memento)
Description copied from interface:Memento
Combines aMemento
state with thisMemento
-
getFragment
public Fragment<?> getFragment()
- Specified by:
getFragment
in interfaceMemento
- Returns:
- the fragment which this
Memento
is bound to
-
getAnchor
public String getAnchor()
Description copied from interface:Memento
Gets the anchor value of thisMemento
.Memento
s with equal anchor values are considered to be capturing the state of the same object but at different points in time.
-
accumulateText
public TextAccumulatorMemento accumulateText(String text)
-
getText
public String getText()
-
-