T - type of the entitiespublic abstract class AbstractXmlStream<T> extends Object
XStream.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractXmlStream(Class<T> type)
Creates a new instance of
AbstractXmlStream. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureXStream(hudson.util.XStream2 xStream)
Configures the
XStream instance with custom converters or alias definitions. |
protected abstract T |
createDefaultValue()
Returns the default value that should be returned if the XML file is broken.
|
T |
read(Path file)
Reads the specified
file and creates a new instance of the given type. |
void |
write(Path file,
T entity)
Writes the specified instance to the given
file. |
protected AbstractXmlStream(Class<T> type)
AbstractXmlStream.type - the type of the elements that are stored and retrievedprotected abstract T createDefaultValue()
protected void configureXStream(hudson.util.XStream2 xStream)
XStream instance with custom converters or alias definitions. This default implementation
is empty.xStream - the XStream instancepublic T read(Path file)
file and creates a new instance of the given type.file - path to the fileCopyright © 2016–2019. All rights reserved.