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 Stringanchorprotected Fragment<?>fragmentprotected StringBuilderstringBuilder
-
Constructor Summary
Constructors Constructor Description TextAccumulatorMemento(Fragment<?> fragment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextAccumulatorMementoaccumulateText(String text)Mementocopy()Performs a deep clone of thisMemento.StringgetAnchor()Gets the anchor value of thisMemento.Fragment<?>getFragment()StringgetText()voidrestore(Memento memento)Combines aMementostate 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:MementoPerforms a deep clone of thisMemento.
-
restore
public void restore(Memento memento)
Description copied from interface:MementoCombines aMementostate with thisMemento
-
getFragment
public Fragment<?> getFragment()
- Specified by:
getFragmentin interfaceMemento- Returns:
- the fragment which this
Mementois bound to
-
getAnchor
public String getAnchor()
Description copied from interface:MementoGets the anchor value of thisMemento.Mementos 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()
-
-