|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.io.GraphImporter
public class GraphImporter
An importer of graph content. This class can be used directly, or the import can be done via the Graph
using the
Graph.importXmlFrom(java.io.File)
(and similar) methods.
Constructor Summary | |
---|---|
GraphImporter(Graph graph)
|
Method Summary | |
---|---|
ExecutionContext |
getContext()
Get the context in which the importer will be executed. |
Graph |
getGraph()
The graph that this importer uses. |
XmlHandler |
getHandlerForImportingXml(Location location,
boolean skip)
Return an XmlHandler that can be used to import content directly into the supplied location. |
protected Name |
getNameAttribute()
|
protected Name |
getTypeAttribute()
|
Graph.Batch |
importXml(InputStream stream,
Location location)
Read the content from the supplied URI and import into the repository at the supplied location. |
Graph.Batch |
importXml(InputStream stream,
Location location,
boolean skip)
Read the content from the supplied URI and import into the repository at the supplied location. |
Graph.Batch |
importXml(URI uri,
Location location)
Read the content from the supplied URI and import into the repository at the supplied location. |
Graph.Batch |
importXml(URI uri,
Location location,
boolean skip)
Read the content from the supplied URI and import into the repository at the supplied location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GraphImporter(Graph graph)
Method Detail |
---|
public ExecutionContext getContext()
public Graph getGraph()
public Graph.Batch importXml(URI uri, Location location) throws IOException, SAXException, RepositorySourceException
uri
- the URI where the importer can read the content that is to be importedlocation
- the location in the repository source
where the content is to be written; may not
be null
IllegalArgumentException
- if the uri
or destination path are null
IOException
- if there is a problem reading the content
SAXException
- if there is a problem with the SAX Parser
RepositorySourceException
- if there is a problem while writing the content to the repository
source
public Graph.Batch importXml(URI uri, Location location, boolean skip) throws IOException, SAXException, RepositorySourceException
uri
- the URI where the importer can read the content that is to be importedlocation
- the location in the repository source
where the content is to be written; may not
be nullskip
- true if the root element should be skipped, or false if a node should be created for the root XML element
IllegalArgumentException
- if the uri
or destination path are null
IOException
- if there is a problem reading the content
SAXException
- if there is a problem with the SAX Parser
RepositorySourceException
- if there is a problem while writing the content to the repository
source
public Graph.Batch importXml(InputStream stream, Location location) throws IOException, SAXException, RepositorySourceException
stream
- the stream containing the content to be importedlocation
- the location in the repository source
where the content is to be written; may not
be null
IllegalArgumentException
- if the stream
or destination path are null
IOException
- if there is a problem reading the content
SAXException
- if there is a problem with the SAX Parser
RepositorySourceException
- if there is a problem while writing the content to the repository
source
public Graph.Batch importXml(InputStream stream, Location location, boolean skip) throws IOException, SAXException, RepositorySourceException
stream
- the stream containing the content to be importedlocation
- the location in the repository source
where the content is to be written; may not
be nullskip
- true if the root element should be skipped, or false if a node should be created for the root XML element
IllegalArgumentException
- if the stream
or destination path are null
IOException
- if there is a problem reading the content
SAXException
- if there is a problem with the SAX Parser
RepositorySourceException
- if there is a problem while writing the content to the repository
source
public XmlHandler getHandlerForImportingXml(Location location, boolean skip)
XmlHandler
that can be used to import content directly into the supplied location. The operations
resulting from the XmlHandler
operations are batched until the XmlHandler.endDocument()
is called, at which
point all enqueued operations are submitted to the graph.
location
- the location in the repository source
where the content is to be written; may not
be nullskip
- true if the root element should be skipped, or false if a node should be created for the root XML element
XmlHandler
that can be used to import content
IllegalArgumentException
- if the stream
or destination path are nullprotected Name getNameAttribute()
protected Name getTypeAttribute()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |