From 2c81c11860d7c13d3d69813602c0d8c0fe4e850b Mon Sep 17 00:00:00 2001 From: matthiasgeiger Date: Wed, 7 Oct 2015 10:02:52 +0200 Subject: [PATCH] some javadoc improvements --- .../common/xsdvalidation/AbstractXsdValidator.java | 9 +++++---- .../dsg/bpmnspector/common/xsdvalidation/Input.java | 13 ++++++++----- .../refcheck/BPMNReferenceValidator.java | 2 +- .../dsg/bpmnspector/refcheck/utils/JDOMUtils.java | 2 +- .../refcheck/utils/ViolationMessageCreator.java | 8 ++++++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/AbstractXsdValidator.java b/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/AbstractXsdValidator.java index 3f243d7..dd95e1a 100644 --- a/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/AbstractXsdValidator.java +++ b/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/AbstractXsdValidator.java @@ -1,7 +1,7 @@ package de.uniba.dsg.bpmnspector.common.xsdvalidation; -import api.ValidationResult; import api.ValidationException; +import api.ValidationResult; import org.xml.sax.SAXException; import javax.xml.transform.stream.StreamSource; @@ -24,14 +24,15 @@ public abstract class AbstractXsdValidator { * the given validation result * * @param xmlFile - * the xml file which should be validated + * the xml file which should be validated * @param validationResult - * the result object of the validation + * the result object of the validation * @throws IOException * when xmlFile can't be read * @throws SAXException * when validation process fails somehow * @throws ValidationException + * thrown if checked file is not well-formed or does not have a valid encoding */ public abstract void validateAgainstXsd(File xmlFile, ValidationResult validationResult) throws IOException, SAXException, @@ -43,7 +44,7 @@ public abstract void validateAgainstXsd(File xmlFile, * streamsource with the searched source * * @param resourceName - * the name of the resource file + * the name of the resource file * @return the streamsource of the file to be load * @throws FileNotFoundException * if the resource file doesn't exist there diff --git a/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/Input.java b/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/Input.java index d16d0c7..4cb0124 100644 --- a/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/Input.java +++ b/src/main/java/de/uniba/dsg/bpmnspector/common/xsdvalidation/Input.java @@ -1,16 +1,16 @@ package de.uniba.dsg.bpmnspector.common.xsdvalidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.ls.LSInput; +import org.w3c.dom.ls.LSResourceResolver; + import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.nio.charset.Charset; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.ls.LSInput; -import org.w3c.dom.ls.LSResourceResolver; - /** * Customized LSInput in order to provide access to an resolved resource. @@ -40,8 +40,11 @@ public class Input implements LSInput { * InputStream * * @param publicId + * public ID set by the ResourceResolver * @param sysId + * System ID set by the ResourceResolver * @param input + * InputStream to be used */ public Input(String publicId, String sysId, InputStream input) { this.publicId = publicId; diff --git a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/BPMNReferenceValidator.java b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/BPMNReferenceValidator.java index d39362b..c8c2749 100644 --- a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/BPMNReferenceValidator.java +++ b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/BPMNReferenceValidator.java @@ -36,7 +36,7 @@ public class BPMNReferenceValidator { .getLogger(BPMNReferenceValidator.class.getSimpleName()); /** - * Constructor sets the defaults. Log level = OFF and language = ENGLISH. + * Constructor sets the defaults. And loads the reference definitions to be used for validations. * * @throws ValidationException * if problems with the language files exist diff --git a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/JDOMUtils.java b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/JDOMUtils.java index 684db2f..27509b9 100644 --- a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/JDOMUtils.java +++ b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/JDOMUtils.java @@ -46,7 +46,7 @@ public static Map getAllElements(Document document) { /** * Map which uses the namespace-URI as an ID and another * Map as value. The inner HashMap contains all Elements accessible via - * the ID as key {@see getAllElements()} + * the ID as key {@link #getAllElements} * * @param elementsMap * the Map to be populated diff --git a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/ViolationMessageCreator.java b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/ViolationMessageCreator.java index 12fa189..1deb2fd 100644 --- a/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/ViolationMessageCreator.java +++ b/src/main/java/de/uniba/dsg/bpmnspector/refcheck/utils/ViolationMessageCreator.java @@ -6,7 +6,8 @@ public class ViolationMessageCreator { public static final int PREFIX_MSG = 1; /** - * + * Creates a description of a found ExistenceViolation based on the given parameters + * * @param element * the name of the BPMN element, where the violation occurred * @param reference @@ -20,6 +21,7 @@ public class ViolationMessageCreator { * use for additional information for special violation message * text versions. For the DEFAULT version it is null, for the * PREFIX it is the prefix of the namespace. + * @return the created String describing the ExistenceViolation */ public static String createExistenceViolationMessage(String element, String reference, int line, int textVersion, String additionalInfo) { @@ -36,7 +38,8 @@ public static String createExistenceViolationMessage(String element, String refe } /** - * + * Creates a description of a found Reference Type violation based on the given parameters + * * @param element * the name of the BPMN element, where the violation occurred * @param line @@ -47,6 +50,7 @@ public static String createExistenceViolationMessage(String element, String refe * the incorrect type, which caused the violation * @param expectedType * the types expected instead of the incorrect type + * @return the created String describing the Reference Type violation */ public static String createTypeViolationMessage(String element, int line, String reference, String incorrectType, String expectedType) {