Class XmlIo
- java.lang.Object
-
- net.ssehub.easy.instantiation.serializer.xml.XmlIo
-
public class XmlIo extends java.lang.ObjectSupports storing projects (and referenced projects) into XML format. Please note that the XML format is intended for temporary storage of models, in particular in environments where xText or Eclipse dependency must not be used. Further, this class does not rely onVarModel, i.e. the related mechanisms, loaders and listeners there are not considered by this class (this would require a specific XML loader). [req SAP, TUV]- Author:
- Holger Eichelberger, Aike Sass
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classXmlIo.ModelDefines the top level element in the XML.
-
Field Summary
Fields Modifier and Type Field Description static java.util.Map<java.lang.String,java.lang.String>CLASSESprotected static EASyLoggerFactory.EASyLoggerlogger
-
Constructor Summary
Constructors Constructor Description XmlIo()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static com.thoughtworks.xstream.XStreamcreateStream()Creates a stream instance for reading and writing.private static voidprintMap(java.util.Map<java.lang.String,java.lang.String> classes, java.io.File target)Print map to properties file.static java.util.List<IModel>read(java.io.File source, boolean isIvmlFile)Reads a list ofIModelfrom an input stream.private static voidreadMap(java.io.File target)Read map from properties file.static voidwrite(java.util.List<IModel> list, java.io.File target, boolean isIvmlFile)Writes a list ofIModelto the given output stream.
-
-
-
Field Detail
-
CLASSES
public static final java.util.Map<java.lang.String,java.lang.String> CLASSES
-
logger
protected static EASyLoggerFactory.EASyLogger logger
-
-
Method Detail
-
write
public static final void write(java.util.List<IModel> list, java.io.File target, boolean isIvmlFile) throws java.io.IOException
Writes a list ofIModelto the given output stream. IF YOU WANT TO WRITE IVML THEN CALL#isIvmlFile()TO DISABLE CERTAIN CONVERTERS!- Parameters:
list- the list to be writtentarget- the target where to write the list toisIvmlFile- switch to enable specific converter- Throws:
java.io.IOException
-
printMap
private static void printMap(java.util.Map<java.lang.String,java.lang.String> classes, java.io.File target) throws java.io.IOExceptionPrint map to properties file.- Parameters:
classes- map to be printedtarget- target- Throws:
java.io.IOException
-
readMap
private static void readMap(java.io.File target) throws java.io.IOExceptionRead map from properties file.- Parameters:
target- target file- Throws:
java.io.IOException
-
read
public static final java.util.List<IModel> read(java.io.File source, boolean isIvmlFile) throws java.io.IOException
Reads a list ofIModelfrom an input stream. IF YOU WANT TO WRITE IVML THEN CALL#isIvmlFile()TO DISABLE CERTAIN CONVERTERS!- Parameters:
source- the source to read the project definition fromisIvmlFile- switch to enable specific converter- Returns:
- the instantiated IModel
- Throws:
java.io.IOException
-
createStream
private static final com.thoughtworks.xstream.XStream createStream()
Creates a stream instance for reading and writing.- Returns:
- the stream instance
-
-