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
KonstruktorenModifiziererKonstruktorBeschreibungprotectedAbstractXmlStream(Class<T> type) Creates a new instance ofAbstractXmlStream. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voidconfigureXStream(XStream2 xStream) Configures theXStreaminstance with custom converters or alias definitions.protected abstract TReturns the default value that should be returned if the XML file is broken.Reads the specifiedfileand creates a new instance of the given type.voidWrites 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 theXStreaminstance with custom converters or alias definitions. This default implementation is empty.- Parameter:
xStream- theXStreaminstance
-
read
Reads the specifiedfileand 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
-