Package repast.simphony.integration
Class DataFileWriter
- java.lang.Object
-
- repast.simphony.integration.DataFileWriter
-
-
Constructor Summary
Constructors Constructor Description DataFileWriter()
DataFileWriter(Object source)
DataFileWriter(Queryable dataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getDescriptorFileName()
String
getDestFileName()
EscapeConverter
getNewLineConverter()
Object
getRoot()
Retrieves the root object.Object
getValue(Object o)
Extracts a value from a Node and returns it.void
mark()
void
popMark()
void
reset()
Object
selectNode(Object curContext, String path)
Selects a node using the specified context as the current location.Object
selectNode(String path)
Selects a node from using the current location (or root if no such thing exists) using the specified path.List<?>
selectNodes(Object curContext, String path)
Selects multiple nodes using the query based at the specified context.List<?>
selectNodes(String path)
Selects multiple nodes using the query.void
setDescriptorFileName(String descriptorFileName)
void
setDestFileName(String fileName)
void
setNewLineConverter(EscapeConverter newLineConverter)
void
setWrittenObject(Queryable queryable)
void
write()
void
writeValueDelimiter(Object data, String delimiter)
void
writeValuePattern(Object data, String type, String pattern)
-
-
-
Method Detail
-
write
public void write() throws org.jdom.JDOMException, IOException
- Specified by:
write
in interfaceWriter
- Throws:
org.jdom.JDOMException
IOException
-
setNewLineConverter
public void setNewLineConverter(EscapeConverter newLineConverter)
-
getNewLineConverter
public EscapeConverter getNewLineConverter()
-
setDestFileName
public void setDestFileName(String fileName)
-
getDestFileName
public String getDestFileName()
-
setDescriptorFileName
public void setDescriptorFileName(String descriptorFileName)
-
getDescriptorFileName
public String getDescriptorFileName()
-
mark
public void mark() throws IOException
- Throws:
IOException
-
popMark
public void popMark()
-
reset
public void reset() throws IOException
- Throws:
IOException
-
selectNode
public Object selectNode(String path)
Description copied from interface:Queryable
Selects a node from using the current location (or root if no such thing exists) using the specified path. If multiple nodes are returned with the query this will be the first one.- Specified by:
selectNode
in interfaceQueryable
- Parameters:
path
- the XPath query- Returns:
- the selected node (can be null if the query failed)
-
selectNode
public Object selectNode(Object curContext, String path)
Description copied from interface:Queryable
Selects a node using the specified context as the current location. If multiple nodes are returned with the query this will be the first one.- Specified by:
selectNode
in interfaceQueryable
- Parameters:
curContext
- the context of the querypath
- the query- Returns:
- the value of the query
- See Also:
Queryable.selectNode(String)
-
selectNodes
public List<?> selectNodes(String path)
Description copied from interface:Queryable
Selects multiple nodes using the query.- Specified by:
selectNodes
in interfaceQueryable
- Parameters:
path
- the query- Returns:
- the result
-
selectNodes
public List<?> selectNodes(Object curContext, String path)
Description copied from interface:Queryable
Selects multiple nodes using the query based at the specified context.- Specified by:
selectNodes
in interfaceQueryable
path
- the query- Returns:
- the result
-
getRoot
public Object getRoot()
Description copied from interface:Queryable
Retrieves the root object.
-
getValue
public Object getValue(Object o)
Description copied from interface:Queryable
Extracts a value from a Node and returns it. What this means is implementation dependent.
-
setWrittenObject
public void setWrittenObject(Queryable queryable)
- Specified by:
setWrittenObject
in interfaceWriter
-
-