- All Known Implementing Classes:
AbstractInputFormat,SimpleXmlReader
public interface InputFormat
InputFormat.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionread(@NonNull InputStream in, Drawing drawing, URI documentHome, @NonNull WorkState<Void> workState) Reads figures from an input stream and adds them to the specified drawing.Reads a figure from an URIReads a figure from a file.voidsetOptions(@NonNull ImmutableMap<Key<?>, Object> newValue)
-
Method Details
-
setOptions
-
getOptions
@NonNull ImmutableMap<Key<?>,Object> getOptions() -
read
default @NonNull Figure read(@NonNull URI uri, @Nullable Drawing drawing, @NonNull 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 @NonNull Figure read(@NonNull Path file, @Nullable Drawing drawing, @NonNull 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
@NonNull Figure read(@NonNull InputStream in, Drawing drawing, URI documentHome, @NonNull 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
-