Class XMLContextBuilder
- java.lang.Object
-
- repast.simphony.dataLoader.engine.XMLContextBuilder
-
- All Implemented Interfaces:
ContextBuilder
public class XMLContextBuilder extends Object implements ContextBuilder
ContextBuilder that loads context from a xml serialized file.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description XMLContextBuilder(File xmlFile)
Creates an XMLContext builder that will load the specified fileXMLContextBuilder(File xmlFile, List<com.thoughtworks.xstream.converters.Converter> converters)
Creates an XMLContext builder that will load from the named file.XMLContextBuilder(String fileName)
Creates an XMLContext builder that will load from the named file.XMLContextBuilder(String fileName, List<com.thoughtworks.xstream.converters.Converter> converters)
Creates an XMLContext builder that will load from the named file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
build(Context context)
Builds and returns a context.File
getXMLFile()
Gets the serialized xml file from which this builder loads a context.
-
-
-
Constructor Detail
-
XMLContextBuilder
public XMLContextBuilder(String fileName)
Creates an XMLContext builder that will load from the named file.- Parameters:
fileName
- the name of the file to load from
-
XMLContextBuilder
public XMLContextBuilder(String fileName, List<com.thoughtworks.xstream.converters.Converter> converters)
Creates an XMLContext builder that will load from the named file.- Parameters:
fileName
- the name of the file to load fromconverters
- a list of XStream Converters to register and use in the XML conversion.
-
XMLContextBuilder
public XMLContextBuilder(File xmlFile, List<com.thoughtworks.xstream.converters.Converter> converters)
Creates an XMLContext builder that will load from the named file.- Parameters:
xmlFile
- the file to load fromconverters
- a list of XStream Converters to register and use in the XML conversion.
-
XMLContextBuilder
public XMLContextBuilder(File xmlFile)
Creates an XMLContext builder that will load the specified file- Parameters:
xmlFile
- the file to load from
-
-
Method Detail
-
build
public Context build(Context context)
Builds and returns a context. Building a context consists of filling it with agents, adding projects and so forth. The returned context does not necessarily have to be the passed in context.- Specified by:
build
in interfaceContextBuilder
- Parameters:
context
- a default context- Returns:
- the built context.
-
getXMLFile
public File getXMLFile()
Gets the serialized xml file from which this builder loads a context.- Returns:
- the serialized xml file from which this builder loads a context.
-
-