- All Known Implementing Classes:
AbstractInputFormat,SimpleXmlReader
public interface InputFormat
InputFormat.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionImmutableMap<Key<?>, Object> Reads figures from an input stream and adds them to the specified drawing.default FigureReads a figure from an URIdefault FigureReads a figure from a file.voidsetOptions(ImmutableMap<Key<?>, Object> newValue)
-
Method Details
-
setOptions
-
getOptions
ImmutableMap<Key<?>,Object> getOptions() -
read
default Figure read(URI uri, @Nullable Drawing drawing, WorkState<Void> workState) throws IOException Reads a figure from an URI- Parameters:
uri- The uri.drawing- If you provide a non-null value, the ids of the returned figure are coerced so that they do not clash with ids in the drawing. Also all URIs in the figure are made relative to DOCUMENT_HOME of the drawing.workState- for progress monitoring and cancelling the operation- Returns:
- the figure
- Throws:
IOException- if an IO error occurs
-
read
default Figure read(Path file, @Nullable Drawing drawing, WorkState<Void> workState) throws IOException Reads a figure from a file.- Parameters:
file- the filedrawing- If you provide a non-null value, the ids of the returned figure are coerced so that they do not clash with ids in the drawing. Also all URIs in the figure are made relative to DOCUMENT_HOME of the drawing.workState- for progress monitoring and cancelling the operation- Returns:
- the figure
- Throws:
IOException- if an IO error occurs
-
read
Figure read(InputStream in, Drawing drawing, URI documentHome, WorkState<Void> workState) throws IOException Reads figures from an input stream and adds them to the specified drawing.- Parameters:
in- The input stream.drawing- If you provide a non-null value, the contents of the file is added to the drawing. Otherwise a new drawing is created.documentHome- the URI used to resolve external references from the documentworkState- for progress monitoring and cancelling the operation- Returns:
- the drawing
- Throws:
IOException- if an IO error occurs
-