Package io.jenkins.plugins.util
Klasse AbstractXmlStream<T>
java.lang.Object
io.jenkins.plugins.util.AbstractXmlStream<T>
- Typparameter:
T
- type of the entities
Base class that provides the basic setup to read and write entities of a given type using
XStream
.- Autor:
- Ullrich Hafner
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
AbstractXmlStream
(Class<T> type) Creates a new instance ofAbstractXmlStream
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
configureXStream
(XStream2 xStream) Configures theXStream
instance with custom converters or alias definitions.protected abstract T
Returns the default value that should be returned if the XML file is broken.Reads the specifiedfile
and creates a new instance of the given type.void
Writes the specified instance to the givenfile
.
-
Konstruktordetails
-
AbstractXmlStream
Creates a new instance ofAbstractXmlStream
.- Parameter:
type
- the type of the elements that are stored and retrieved
-
-
Methodendetails
-
createDefaultValue
Returns the default value that should be returned if the XML file is broken.- Gibt zurück:
- the default value
-
configureXStream
Configures theXStream
instance with custom converters or alias definitions. This default implementation is empty.- Parameter:
xStream
- theXStream
instance
-
read
Reads the specifiedfile
and creates a new instance of the given type.- Parameter:
file
- path to the file- Gibt zurück:
- the created instance
-
write
Writes the specified instance to the givenfile
.- Parameter:
file
- path to the fileentity
- the entity to write to the file
-