From 7a7834fb061934d1b572b71acedfa1d9f5c00203 Mon Sep 17 00:00:00 2001 From: modzeleg Date: Fri, 30 Apr 2021 18:08:39 +0200 Subject: [PATCH] T285 javadoc added --- .../src/main/java/r11/mltx/restxslt/Main.java | 8 ++++++++ .../r11/mltx/restxslt/SparkInitializer.java | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/REST_XSLT/src/main/java/r11/mltx/restxslt/Main.java b/REST_XSLT/src/main/java/r11/mltx/restxslt/Main.java index ab90124..42e540d 100644 --- a/REST_XSLT/src/main/java/r11/mltx/restxslt/Main.java +++ b/REST_XSLT/src/main/java/r11/mltx/restxslt/Main.java @@ -1,6 +1,14 @@ package r11.mltx.restxslt; +/** + * Application initializer + * @author Wojciech Czop + */ public class Main { + /** + * Initializes the application + * @param args + */ public static void main(String[] args) { SparkInitializer.run(); } diff --git a/REST_XSLT/src/main/java/r11/mltx/restxslt/SparkInitializer.java b/REST_XSLT/src/main/java/r11/mltx/restxslt/SparkInitializer.java index 8257764..e5ed21a 100644 --- a/REST_XSLT/src/main/java/r11/mltx/restxslt/SparkInitializer.java +++ b/REST_XSLT/src/main/java/r11/mltx/restxslt/SparkInitializer.java @@ -9,7 +9,14 @@ import spark.*; import java.util.HashMap; import java.util.Map; +/** + * Class contains spark configuration and method initializing spark framework + * @author Wojciech Czop + */ public class SparkInitializer { + /** + * Initializes spark framework + */ public static void run(){ Spark.port(8081); @@ -27,6 +34,9 @@ public class SparkInitializer { System.out.println("Server is online"); } + /** + * Handler that returns processor version + */ private static Route procinfoHandler = (Request req, Response resp) -> { try { resp.header("processor", "Saxon " + Saxon.getVersion() + " over s9api"); @@ -36,6 +46,10 @@ public class SparkInitializer { } }; + /** + * Handler that returns info if document is valid + * Also provides info about request time and processor + */ private static Route xsdHandler = (Request req, Response resp) -> { String body = req.body(); System.out.println("Request: " + body); @@ -73,6 +87,9 @@ public class SparkInitializer { return resp; }; + /** + * Handler that returns output of xpath query and processor data + */ private static Route xpathHandler = (Request req, Response resp) -> { String body = req.body(); @@ -149,6 +166,9 @@ public class SparkInitializer { } }; + /** + * Handler that returns outcome of xslt transformation and processor data + */ private static Route xsltHandler = (Request req, Response resp) -> { String body = req.body(); ObjectMapper mapper = new ObjectMapper();