Module ilusr.textadventurelib
Package textadventurelib.persistence
Class AppendTextActionPersistence
- java.lang.Object
-
- ilusr.persistencelib.configuration.XmlConfigurationObject
-
- textadventurelib.persistence.ActionPersistenceObject
-
- textadventurelib.persistence.AppendTextActionPersistence
-
- All Implemented Interfaces:
ilusr.persistencelib.configuration.IXmlConfigurationObject,ilusr.persistencelib.configuration.PersistXml
public class AppendTextActionPersistence extends ActionPersistenceObject
- Author:
- Jeff Riggle
Creates an XML node for the Append Text action. The current xml should look like
this:
<Action type="AppendText"> <Parameters> <AppendText>Text to append</AppendText> </Parameters> </Action>
-
-
Constructor Summary
Constructors Constructor Description AppendTextActionPersistence()Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddParameter(ilusr.persistencelib.configuration.XmlConfigurationObject parameter)StringappendText()voidappendText(String text)protected voidclearParameters()Removes all parameters from the parameters section.voidconvertFromPersistence(ilusr.persistencelib.configuration.XmlConfigurationObject obj)IActionconvertToAction()protected List<ilusr.persistencelib.configuration.XmlConfigurationObject>parameters()voidprepareXml()This must be called before saving the xml otherwise this object will not be saved correctly to the xml file.protected voidremoveParameter(ilusr.persistencelib.configuration.XmlConfigurationObject parameter)protected voidtype(String type)-
Methods inherited from class textadventurelib.persistence.ActionPersistenceObject
type
-
Methods inherited from class ilusr.persistencelib.configuration.XmlConfigurationObject
addChild, addChildren, addConfigurationProperties, addConfigurationProperty, children, clearChildren, clearConfigurationProperties, configurationProperties, getChildObject, getChildValue, getValueType, load, name, name, persist, removeChild, removeChildren, removeConfigurationProperties, removeConfigurationProperty, value, value
-
-
-
-
Constructor Detail
-
AppendTextActionPersistence
public AppendTextActionPersistence() throws TransformerConfigurationException, ParserConfigurationExceptionDefault Constructor.
-
-
Method Detail
-
appendText
public void appendText(String text)
- Parameters:
text- The text that should be appened with this action.
-
appendText
public String appendText()
- Returns:
- The String for the append text action.
-
prepareXml
public void prepareXml() throws TransformerConfigurationException, ParserConfigurationExceptionThis must be called before saving the xml otherwise this object will not be saved correctly to the xml file.
-
convertToAction
public IAction convertToAction()
- Specified by:
convertToActionin classActionPersistenceObject
-
convertFromPersistence
public void convertFromPersistence(ilusr.persistencelib.configuration.XmlConfigurationObject obj)
-
type
protected void type(String type)
- Parameters:
type- The new type of action.
-
addParameter
protected void addParameter(ilusr.persistencelib.configuration.XmlConfigurationObject parameter)
- Parameters:
parameter- A list of @see XmlConfigurationObject to add under the parameters section.
-
removeParameter
protected void removeParameter(ilusr.persistencelib.configuration.XmlConfigurationObject parameter)
- Parameters:
parameter- A list of @see XmlConfigurationObject to remove from the parameters section.
-
clearParameters
protected void clearParameters()
Removes all parameters from the parameters section.
-
parameters
protected List<ilusr.persistencelib.configuration.XmlConfigurationObject> parameters()
- Returns:
- A list of @see XmlConfigurationObject representing the parameters section of the xml.
-
-