diff --git a/src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/IDUUICommunicationLayer.java b/src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/IDUUICommunicationLayer.java index 7d0da09..20dffe2 100644 --- a/src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/IDUUICommunicationLayer.java +++ b/src/main/java/org/texttechnologylab/DockerUnifiedUIMAInterface/IDUUICommunicationLayer.java @@ -18,38 +18,42 @@ public interface IDUUICommunicationLayer { public void deserialize(JCas jc, ByteArrayInputStream input, String targetView) throws IOException, SAXException, CASException; - /** - * Serializes a JCas to a byte array output stream by using the LUA script provided by the component. - * @param jc Input JCas. - * @param out Output stream, i.e. the input to the component. - * @param parameters Parameters for use in the LUA script. - * @throws CompressorException - * @throws IOException - * @throws SAXException - */ - public void serialize(JCas jc, ByteArrayOutputStream out, Map parameters) throws CompressorException, IOException, SAXException; - - /** - * Deserializes a byte array input stream to a JCas by using the LUA script provided by the component. - * @param jc Output JCas, note that the CAS is not reset before deserialization. - * @param input Input stream, i.e. the output of the component. - * @throws IOException - * @throws SAXException - */ - public void deserialize(JCas jc, ByteArrayInputStream input) throws IOException, SAXException; - - /** - * - * @return - */ - public IDUUICommunicationLayer copy(); - - /** - * - * @param results - * @return - */ - public ByteArrayInputStream merge(List results); - - String myLuaTestMerging(); + /** + * Serializes a JCas to a byte array output stream by using the LUA script provided by the component. + * @param jc Input JCas. + * @param out Output stream, i.e. the input to the component. + * @param parameters Parameters for use in the LUA script. + * @throws CompressorException + * @throws IOException + * @throws SAXException + */ + default void serialize(JCas jc, ByteArrayOutputStream out, Map parameters) throws CompressorException, IOException, SAXException, CASException { + serialize(jc, out, parameters, "_InitialView"); + } + + /** + * Deserializes a byte array input stream to a JCas by using the LUA script provided by the component. + * @param jc Output JCas, note that the CAS is not reset before deserialization. + * @param input Input stream, i.e. the output of the component. + * @throws IOException + * @throws SAXException + */ + default void deserialize(JCas jc, ByteArrayInputStream input) throws IOException, SAXException, CASException { + deserialize(jc, input, "_InitialView"); + } + + /** + * + * @return + */ + public IDUUICommunicationLayer copy(); + + /** + * + * @param results + * @return + */ + public ByteArrayInputStream merge(List results); + + String myLuaTestMerging(); }