From 3fada6cef21c9b16467177d866df778203b51b4d Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 5 Dec 2019 09:52:48 +0100 Subject: some code code-style modifications active code-quality checks! --- .../eaaf/core/api/gui/IVelocityGuiFormBuilder.java | 40 +++++++------- .../idp/process/ExpressionEvaluationContext.java | 5 +- .../core/api/idp/process/ExpressionEvaluator.java | 8 ++- .../eaaf/core/api/idp/process/ProcessEngine.java | 64 ++++++++++++---------- .../api/idp/process/ProcessInstanceStoreDao.java | 19 ++++--- .../at/gv/egiz/eaaf/core/api/idp/process/Task.java | 6 +- .../gv/egiz/eaaf/core/api/utils/IJsonMapper.java | 43 ++++++++------- 7 files changed, 104 insertions(+), 81 deletions(-) (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/gui/IVelocityGuiFormBuilder.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/gui/IVelocityGuiFormBuilder.java index 5a7ce49d..ff90e9cc 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/gui/IVelocityGuiFormBuilder.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/gui/IVelocityGuiFormBuilder.java @@ -1,16 +1,19 @@ package at.gv.egiz.eaaf.core.api.gui; import java.io.InputStream; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import at.gv.egiz.eaaf.core.exceptions.GuiBuildException; + import org.apache.velocity.VelocityContext; -public interface IVelocityGuiFormBuilder extends IGuiFormBuilder { +import at.gv.egiz.eaaf.core.exceptions.GuiBuildException; +public interface IVelocityGuiFormBuilder extends IGuiFormBuilder { /** - * Generate a new {@link VelocityContext} and populate it with MOA-ID GUI parameters. + * Generate a new {@link VelocityContext} and populate it with MOA-ID GUI + * parameters. * * @param config GUI builder configuration * @return @@ -18,28 +21,27 @@ public interface IVelocityGuiFormBuilder extends IGuiFormBuilder { VelocityContext generateVelocityContextFromConfiguration( IVelocityGuiBuilderConfiguration config); - /** * Load the template from different resources. * * @param config GUI builder configuration - * @return An {@link InputStream} but never null. The {@link InputStream} had to be closed be the - * invoking method + * @return An {@link InputStream} but never null. The {@link InputStream} had to + * be closed be the invoking method * @throws GuiBuildException In case of an error */ InputStream getTemplateInputStream(IVelocityGuiBuilderConfiguration config) throws GuiBuildException; - /** - * Parse a GUI template, with parameters into a http servlet-response and use the default - * http-response content-type.
+ * Parse a GUI template, with parameters into a http servlet-response and use + * the default http-response content-type.
*
- * The parser use the VelocityEngine as internal template evaluator. + * The parser use the VelocityEngine as internal template + * evaluator. * - * @param httpReq http-request object - * @param httpResp http-response object - * @param config Configuration object + * @param httpReq http-request object + * @param httpResp http-response object + * @param config Configuration object * @param loggerName String, which should be used from logger * * @throws GuiBuildException in case of an error @@ -47,17 +49,17 @@ public interface IVelocityGuiFormBuilder extends IGuiFormBuilder { void build(HttpServletRequest httpReq, HttpServletResponse httpResp, IVelocityGuiBuilderConfiguration config, String loggerName) throws GuiBuildException; - /** * Parse a GUI template, with parameters into a http servlet-response.
*
- * The parser use the VelocityEngine as internal template evaluator. + * The parser use the VelocityEngine as internal template + * evaluator. * - * @param httpReq http-request object - * @param httpResp http-response object - * @param config Configuration object + * @param httpReq http-request object + * @param httpResp http-response object + * @param config Configuration object * @param contentType http-response content-type, which should be set - * @param loggerName String, which should be used from logger + * @param loggerName String, which should be used from logger * * @throws GuiBuildException In case of an error */ diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluationContext.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluationContext.java index 7315dbf1..8f66afff 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluationContext.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluationContext.java @@ -21,11 +21,12 @@ package at.gv.egiz.eaaf.core.api.idp.process; import java.io.Serializable; import java.util.Map; -import at.gv.egiz.eaaf.core.impl.idp.process.model.Transition; +import at.gv.egiz.eaaf.core.impl.idp.process.model.Transition; /** - * Context used for evaluation of condition expressions set for {@linkplain Transition Transitions}. + * Context used for evaluation of condition expressions set for + * {@linkplain Transition Transitions}. * * @author tknall * diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluator.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluator.java index 7fa67ae4..18e4533e 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluator.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ExpressionEvaluator.java @@ -29,11 +29,13 @@ public interface ExpressionEvaluator { /** * Evaluates a given {@code expression} returning a boolean value. * - * @param expressionContext The context which can be used for evaluation of the expression. - * @param expression The expression resulting in a boolean (must not be {@code null}). + * @param expressionContext The context which can be used for evaluation of the + * expression. + * @param expression The expression resulting in a boolean (must not be + * {@code null}). * @return A boolean value. * @throws IllegalArgumentException In case of an invalid {@code expression}. - * @throws NullPointerException In case of a {@code null} expression. + * @throws NullPointerException In case of a {@code null} expression. */ boolean evaluate(ExpressionEvaluationContext expressionContext, String expression); diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessEngine.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessEngine.java index d4c221e0..302deae4 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessEngine.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessEngine.java @@ -19,8 +19,8 @@ package at.gv.egiz.eaaf.core.api.idp.process; - import java.io.InputStream; + import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.exceptions.ProcessExecutionException; import at.gv.egiz.eaaf.core.impl.idp.process.ProcessDefinitionParserException; @@ -35,64 +35,71 @@ import at.gv.egiz.eaaf.core.impl.idp.process.model.ProcessDefinition; public interface ProcessEngine { /** - * Registers a new process definition. Note that existing definitions with the same identifier - * will be replaced. + * Registers a new process definition. Note that existing definitions with the + * same identifier will be replaced. * * @param processDefinition The process definition to be registered. */ void registerProcessDefinition(ProcessDefinition processDefinition); /** - * Registers a new process definition given as {@link InputStream}. Note that existing definitions - * with the same identifier will be replaced. + * Registers a new process definition given as {@link InputStream}. Note that + * existing definitions with the same identifier will be replaced. * - * @param processDefinitionInputStream The input stream to the definition to be registered. + * @param processDefinitionInputStream The input stream to the definition to be + * registered. * @return The process definition's identifier. - * @throws ProcessDefinitionParserException Thrown in case of an error parsing the process - * definition. + * @throws ProcessDefinitionParserException Thrown in case of an error parsing + * the process definition. */ String registerProcessDefinition(InputStream processDefinitionInputStream) throws ProcessDefinitionParserException; /** - * Creates a process instance according to the referenced process definition, persists it into the - * database and returns it identifier. + * Creates a process instance according to the referenced process definition, + * persists it into the database and returns it identifier. *

- * Note that the method returns the identifier of a process instance which will be needed in order - * to start a process or to continue process execution after asynchronous task execution (refer to - * {@link #start(String)} and {@link #signal(String)} for further information). + * Note that the method returns the identifier of a process instance which will + * be needed in order to start a process or to continue process execution after + * asynchronous task execution (refer to {@link #start(String)} and + * {@link #signal(String)} for further information). * - * @param processDefinitionId The identifier of the respective process definition. - * @param executionContext The execution context (may be {@code null}). + * @param processDefinitionId The identifier of the respective process + * definition. + * @param executionContext The execution context (may be {@code null}). * @return The id of the newly created process instance (never {@code null}). * @throws ProcessExecutionException Thrown in case of error, e.g. when a - * {@code processDefinitionId} is referenced that does not exist. + * {@code processDefinitionId} is referenced + * that does not exist. */ String createProcessInstance(String processDefinitionId, ExecutionContext executionContext) throws ProcessExecutionException; /** - * Creates a process instance according to the referenced process definition, persists it into the - * database and returns it identifier. + * Creates a process instance according to the referenced process definition, + * persists it into the database and returns it identifier. *

- * Note that the method returns the identifier of a process instance which will be needed in order - * to start a process or to continue process execution after asynchronous task execution (refer to - * {@link #start(String)} and {@link #signal(String)} for further information). + * Note that the method returns the identifier of a process instance which will + * be needed in order to start a process or to continue process execution after + * asynchronous task execution (refer to {@link #start(String)} and + * {@link #signal(String)} for further information). * - * @param processDefinitionId The identifier of the respective process definition. + * @param processDefinitionId The identifier of the respective process + * definition. * @return The id of the newly created process instance (never {@code null}). * @throws ProcessExecutionException Thrown in case of error, e.g. when a - * {@code processDefinitionId} is referenced that does not exist. + * {@code processDefinitionId} is referenced + * that does not exist. */ String createProcessInstance(String processDefinitionId) throws ProcessExecutionException; - /** * Delete a process instance. * * @param processInstanceId The identifier of the respective process. * @throws ProcessExecutionException Thrown in case of error, e.g. when a - * {@code processInstanceId} is referenced that does not exist. + * {@code processInstanceId} is referenced + * that does not exist. */ void deleteProcessInstance(String processInstanceId) throws ProcessExecutionException; @@ -101,8 +108,10 @@ public interface ProcessEngine { * * @param processInstanceId The process instance id. * @return The process instance (never {@code null}). - * @throws IllegalArgumentException In case the process instance does not/no longer exist. - * @throws RuntimeException In case the process instance could not be retrieved from persistence. + * @throws IllegalArgumentException In case the process instance does not/no + * longer exist. + * @throws RuntimeException In case the process instance could not be + * retrieved from persistence. */ ProcessInstance getProcessInstance(String processInstanceId); @@ -114,7 +123,6 @@ public interface ProcessEngine { */ void start(IRequest pendingReq) throws ProcessExecutionException; - /** * Resumes process execution after an asynchronous task has been executed. * diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessInstanceStoreDao.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessInstanceStoreDao.java index 641eeab8..6de53432 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessInstanceStoreDao.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/ProcessInstanceStoreDao.java @@ -30,25 +30,30 @@ public interface ProcessInstanceStoreDao { * Stores a {@link ProcessInstance} defined by {@code pIStore} in the database. * * @param piStore the {@link ProcessInstanceStore} to persist. - * @throws EaafStorageException is thrown if a problem occurs while accessing the database. + * @throws EaafStorageException is thrown if a problem occurs while accessing + * the database. */ void saveOrUpdate(ProcessInstanceStore piStore) throws EaafException; /** - * Returns a {@link ProcessInstanceStore}, defined by {@code processInstanceID} from the database, - * or {@code null} if the object could not be found. + * Returns a {@link ProcessInstanceStore}, defined by {@code processInstanceID} + * from the database, or {@code null} if the object could not be found. * - * @param processInstanceId the id of the {@code ProcessInstanceStore} to retrieve. + * @param processInstanceId the id of the {@code ProcessInstanceStore} to + * retrieve. * @return a ProcessInstanceStore, or {@code null}. - * @throws EaafStorageException is thrown if a problem occurs while accessing the database. + * @throws EaafStorageException is thrown if a problem occurs while accessing + * the database. */ ProcessInstanceStore load(String processInstanceId) throws EaafException; /** - * Deletes the {@link ProcessInstance} corresponding with the {@code processInstanceId}. + * Deletes the {@link ProcessInstance} corresponding with the + * {@code processInstanceId}. * * @param processInstanceId the id of the {@code ProcessInstance} to be deleted. - * @throws EaafStorageException is thrown if a problem occurs while accessing the database. + * @throws EaafStorageException is thrown if a problem occurs while accessing + * the database. */ void remove(String processInstanceId) throws EaafException; diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/Task.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/Task.java index 06573403..a1fd49e5 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/Task.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/idp/process/Task.java @@ -22,7 +22,6 @@ package at.gv.egiz.eaaf.core.api.idp.process; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; - /** * Represents a single task to be performed upon process execution. * @@ -34,9 +33,10 @@ public interface Task { /** * Executes this task. * - * @param pendingReq Provides the current processed protocol request + * @param pendingReq Provides the current processed protocol request * @param executionContext Provides execution related information. - * @return The pending-request object, because Process-management works recursive + * @return The pending-request object, because Process-management works + * recursive * @throws Exception An exception upon task execution. */ IRequest execute(IRequest pendingReq, ExecutionContext executionContext) diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java index dd7e69fd..a7e4f6fe 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/api/utils/IJsonMapper.java @@ -9,38 +9,43 @@ public interface IJsonMapper { /** * Serialize an object to a JSON string. - * + * * @param value the object to serialize * @return a JSON string - * @throws JsonProcessingException thrown when an error occurs during serialization + * @throws JsonProcessingException thrown when an error occurs during + * serialization */ String serialize(Object value) throws EaafJsonMapperException; /** * Deserialize a JSON string. - * + * * @param value the JSON string to deserialize - * @param clazz optional parameter that determines the type of the returned object. If not set, an - * {@link Object} is returned. - * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} - * @throws JsonParseException if the JSON string contains invalid content. - * @throws JsonMappingException if the input JSON structure does not match structure expected for - * result type - * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) + * @param clazz optional parameter that determines the type of the returned + * object. If not set, an {@link Object} is returned. + * @return the deserialized JSON string as an object of type {@code clazz} or + * {@link Object} + * @throws JsonParseException if the JSON string contains invalid content. + * @throws JsonMappingException if the input JSON structure does not match + * structure expected for result type + * @throws IOException if an I/O problem occurs (e.g. unexpected + * end-of-input) */ Object deserialize(String value, Class clazz) throws EaafJsonMapperException; /** * Deserialize a JSON string. - * - * @param is the JSON to deserialize as {@link InputStream} - * @param clazz optional parameter that determines the type of the returned object. If not set, an - * {@link Object} is returned. - * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} - * @throws JsonParseException if the JSON string contains invalid content. - * @throws JsonMappingException if the input JSON structure does not match structure expected for - * result type - * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) + * + * @param is the JSON to deserialize as {@link InputStream} + * @param clazz optional parameter that determines the type of the returned + * object. If not set, an {@link Object} is returned. + * @return the deserialized JSON string as an object of type {@code clazz} or + * {@link Object} + * @throws JsonParseException if the JSON string contains invalid content. + * @throws JsonMappingException if the input JSON structure does not match + * structure expected for result type + * @throws IOException if an I/O problem occurs (e.g. unexpected + * end-of-input) */ Object deserialize(InputStream is, Class clazz) throws EaafJsonMapperException; -- cgit v1.2.3