From c42646f444c664fe83177ad0fc59419cdaa4aa34 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 27 Sep 2021 17:38:28 +0200 Subject: [PATCH 01/40] Fix javadoc errors --- .../main/java/org/metafacture/xml/XmlElementSplitter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java index 6ecfbd31c..c65e334c0 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java @@ -62,8 +62,8 @@ public XmlElementSplitter() { /** * Enriched constructor setting the top level element and the Element name * - * @param aTopLevelElement the name of the top level XML tag - * @param aElementName the name of the tag defining a new Element to be split + * @param topLevelElement the name of the top level XML tag + * @param elementName the name of the tag defining a new Element to be split */ public XmlElementSplitter(final String topLevelElement, final String elementName) { setTopLevelElement(topLevelElement); @@ -83,7 +83,7 @@ public void setElementName(final String name) { /** * Sets the top-level XML document element. * - * @param root the top level element. Don't set it to omit setting top level + * @param newRoot the top level element. Don't set it to omit setting top level * element. */ public void setTopLevelElement(final String newRoot) { From 001b5601e7db2ad973bdb8d932acc8dab0ff30c4 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 30 Sep 2021 16:19:08 +0200 Subject: [PATCH 02/40] Fix javadoc errors See #396. --- config/checkstyle/checkstyle.xml | 1 + .../org/metafacture/biblio/marc21/MarcXmlEncoder.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index a5415c3d6..f10d92687 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -68,6 +68,7 @@ + diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index 43df44e5f..e03c81ba5 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -242,12 +242,18 @@ private void writeFooter() { writeRaw(ROOT_CLOSE); } - /** Writes a unescaped sequence */ + /** Writes a unescaped sequence + * @param str + * the unescaped sequence to be written + */ private void writeRaw(final String str) { builder.append(str); } - /** Writes a escaped sequence */ + /** Writes a escaped sequence + * @param str + * the unescaped sequence to be written + */ private void writeEscaped(final String str) { builder.append(XmlUtil.escape(str, false)); } From 86bfdb4c6a400d430e3de94f065564f561022473 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 1 Oct 2021 08:57:33 +0200 Subject: [PATCH 03/40] Add MissingJavadocMethod to checkstyle Allow missing java doc for empty methods and constructors. - fix javadoc - simplify Marc21Encoder's non-arg constructor See #396. --- config/checkstyle/checkstyle.xml | 3 + .../biblio/iso2709/RecordBuilder.java | 109 ++++++++++++++++++ .../biblio/iso2709/RecordFormat.java | 60 ++++++++++ .../biblio/marc21/Marc21Encoder.java | 4 + .../biblio/marc21/MarcXmlEncoder.java | 24 ++-- 5 files changed, 183 insertions(+), 17 deletions(-) diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index f10d92687..86deceec7 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -82,6 +82,9 @@ + + + diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java index 5c47701c9..aa0e1246b 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java @@ -56,6 +56,12 @@ public final class RecordBuilder { private AppendState appendState; private int fieldStart; + /** + * Initializes the RecordBuilder based on a RecordFormat. + * + * @param recordFormat RecordFormat as base to configure the RecordBuilder + * @see RecordFormat + */ public RecordBuilder(final RecordFormat recordFormat) { Require.notNull(recordFormat); label = new LabelBuilder(recordFormat); @@ -82,6 +88,13 @@ private char[] arrayOfNSpaceChars(final int count) { return chars; } + /** + * Sets the charset of the FieldsBuilder. + * + * @param charset Charset used by the FieldsBuilder + * @see FieldsBuilder + * @see Charset + */ public void setCharset(final Charset charset) { fields.setCharset(Require.notNull(charset)); } @@ -90,11 +103,25 @@ public Charset getCharset() { return fields.getCharset(); } + /** + * Sets the record status of the LabelBuilder. + * + * @param recordStatus 7 bit char record status + * @see Iso2709Constants.RECORD_STATUS_POS + * @see LabelBuilder + */ public void setRecordStatus(final char recordStatus) { require7BitAscii(recordStatus); label.setRecordStatus(recordStatus); } + /** + * Sets the impl codes in the LabelBuilder. + * + * @param implCodes char array of 7 bit impl codes + * @see Iso2709Constants + * @see LabelBuilder + */ public void setImplCodes(final char[] implCodes) { Require.notNull(implCodes); Require.that(implCodes.length == Iso2709Constants.IMPL_CODES_LENGTH); @@ -102,12 +129,27 @@ public void setImplCodes(final char[] implCodes) { label.setImplCodes(implCodes); } + /** + * Sets an impl code at a given position in the LabelBuilder. + * + * @param index index of the 7 bit impl code + * @param implCode char of a 7 bit impl code + * @see Iso2709Constants + * @see LabelBuilder + */ public void setImplCode(final int index, final char implCode) { Require.that(0 <= index && index < Iso2709Constants.IMPL_CODES_LENGTH); require7BitAscii(implCode); label.setImplCode(index, implCode); } + /** + * Sets the system chars in the LabelBuilder. + * + * @param systemChars 7-bit char array to be set as system chars + * @see Iso2709Constants + * @see LabelBuilder + */ public void setSystemChars(final char[] systemChars) { Require.notNull(systemChars); Require.that(systemChars.length == Iso2709Constants.SYSTEM_CHARS_LENGTH); @@ -115,21 +157,47 @@ public void setSystemChars(final char[] systemChars) { label.setSystemChars(systemChars); } + /** + * Sets a system char at the given position in the LabelBuilder. + * + * @param systemChar 7-bit char to be set as the system char + * @param index position of the system char + * @see Iso2709Constants + * @see LabelBuilder + */ public void setSystemChar(final int index, final char systemChar) { Require.that(0 <= index && index < Iso2709Constants.SYSTEM_CHARS_LENGTH); require7BitAscii(systemChar); label.setSystemChar(index, systemChar); } + /** + * Sets a reserved char in the LabelBuilder. + * + * @param reservedChar 7-bit char to be set as reserved char + * @see Iso2709Constants + * @see LabelBuilder + */ public void setReservedChar(final char reservedChar) { require7BitAscii(reservedChar); label.setReservedChar(reservedChar); } + /** + * Appends an identifier field. + * + * @param value String that is appended as an identfier field + */ public void appendIdentifierField(final String value) { appendIdentifierField(defaultImplDefinedPart, value); } + /** + * Appends an identifier field in dependency of the current impl defined part. + * + * @param currentImplDefinedPart char array of the current impl defined part + * @param value String that is appended as an identfier field + */ public void appendIdentifierField(final char[] currentImplDefinedPart, final String value) { requireNotInDataField(); requireNotAppendingReferenceFields(); @@ -144,6 +212,14 @@ public void appendReferenceField(final char[] currentTag, final String value) { appendReferenceField(currentTag, defaultImplDefinedPart, value); } + /** + * Appends a reference field in dependency of the current tag and of the + * current impl defined part. + * + * @param currentTag char array of the current tag + * @param currentImplDefinedPart char array of the current impl defined part + * @param value String that is appended as a reference field + */ public void appendReferenceField(final char[] currentTag, final char[] currentImplDefinedPart, final String value) { requireNotInDataField(); requireNotAppendingDataFields(); @@ -181,6 +257,14 @@ public void startDataField(final char[] currentTag, final char[] indicators) { startDataField(currentTag, indicators, defaultImplDefinedPart); } + /** + * Starts a data field in dependency of the current tag, indicators and of the + * current impl defined part. + * + * @param currentTag char array of the current tag + * @param indicators char array of the current indicators + * @param currentImplDefinedPart char array of the current impl defined part + */ public void startDataField(final char[] currentTag, final char[] indicators, final char[] currentImplDefinedPart) { requireNotInDataField(); Require.notNull(currentTag); @@ -208,6 +292,9 @@ private void copyArray(final char[] source, final char[] destination) { System.arraycopy(source, 0, destination, 0, destination.length); } + /** + * Ends a data field. + */ public void endDataField() { requireInDataField(); final int fieldEnd = fields.endField(); @@ -221,12 +308,23 @@ public void endDataField() { } } + /** + * Appends a subfield. + * + * @param value String of the to be appended subfield + */ public void appendSubfield(final String value) { requireInDataField(); Require.notNull(value); fields.appendSubfield(defaultIdentifier, value); } + /** + * Appends a subfield in dependency of an identifier. + * + * @param identifier char array of an identifier + * @param value String of the to be appended subfield + */ public void appendSubfield(final char[] identifier, final String value) { requireInDataField(); Require.notNull(identifier); @@ -236,6 +334,11 @@ public void appendSubfield(final char[] identifier, final String value) { fields.appendSubfield(identifier, value); } + /** + * Builds the record. + * + * @return byte array of the record + */ public byte[] build() { requireNotInDataField(); final int baseAddress = Iso2709Constants.RECORD_LABEL_LENGTH + directory.length(); @@ -286,6 +389,12 @@ private void require7BitAscii(final char charCode) { Require.that(charCode != Iso646Constants.INFORMATION_SEPARATOR_3); } + /** + * Resets the label, directory and the fields. Sets the "append state" to "id + * field". + * + * @see AppendState.ID_FIELD + */ public void reset() { label.reset(); directory.reset(); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java index 0fe9756cf..646ed0984 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java @@ -51,6 +51,15 @@ public final class RecordFormat { private final int fieldStartLength; private final int implDefinedPartLength; + /** + * Initializes the RecordFormat. + * + * @param indicatorLength the length of the indicator + * @param identifierLength the length of the identifier + * @param fieldLengthLength the length of the field + * @param fieldStartLength the length of the indicator + * @param implDefinedPartLength the length of the part + */ public RecordFormat(final int indicatorLength, final int identifierLength, final int fieldLengthLength, final int fieldStartLength, final int implDefinedPartLength) { @@ -61,6 +70,11 @@ public RecordFormat(final int indicatorLength, final int identifierLength, this.implDefinedPartLength = implDefinedPartLength; } + /** + * Initializes a RecordFormat defined by a RecordFormat. + * + * @param source the RecordFormat + */ public RecordFormat(final RecordFormat source) { Require.notNull(source); @@ -71,10 +85,21 @@ public RecordFormat(final RecordFormat source) { implDefinedPartLength = source.implDefinedPartLength; } + /** + * Returns a new default Builder. + * + * @return Builder + */ public static Builder create() { return new Builder(); } + /** + * Returns a new Builder created from a RecordFormat. + * + * @param source the RecordFormat + * @return Builder + */ public static Builder createFrom(final RecordFormat source) { return create() .withIndicatorLength(source.indicatorLength) @@ -149,6 +174,12 @@ public static class Builder { Builder() { } + /** + * Returns a new Builder with defined indicator length. + * + * @param currentIndicatorLength the length of the indicator + * @return Builder + */ public Builder withIndicatorLength(final int currentIndicatorLength) { Require.notNegative(currentIndicatorLength); Require.that(currentIndicatorLength < RADIX); @@ -156,6 +187,12 @@ public Builder withIndicatorLength(final int currentIndicatorLength) { return this; } + /** + * Returns a new Builder with defined identifier length. + * + * @param currentIdentifierLength the length of the identifier + * @return Builder + */ public Builder withIdentifierLength(final int currentIdentifierLength) { Require.notNegative(currentIdentifierLength); Require.that(currentIdentifierLength < RADIX); @@ -163,6 +200,12 @@ public Builder withIdentifierLength(final int currentIdentifierLength) { return this; } + /** + * Returns a new Builder with defined field length. + * + * @param currentFieldLengthLength the length of the field + * @return Builder + */ public Builder withFieldLengthLength(final int currentFieldLengthLength) { Require.that(currentFieldLengthLength > 0); Require.that(currentFieldLengthLength < RADIX); @@ -170,6 +213,12 @@ public Builder withFieldLengthLength(final int currentFieldLengthLength) { return this; } + /** + * Returns a new Builder with defined field start length. + * + * @param currentFieldStartLength the length of the field start + * @return Builder + */ public Builder withFieldStartLength(final int currentFieldStartLength) { Require.that(currentFieldStartLength > 0); Require.that(currentFieldStartLength < RADIX); @@ -177,6 +226,12 @@ public Builder withFieldStartLength(final int currentFieldStartLength) { return this; } + /** + * Returns a new Builder with defined part length. + * + * @param currentImplDefinedPartLength the length of the part + * @return Builder + */ public Builder withImplDefinedPartLength(final int currentImplDefinedPartLength) { Require.notNegative(currentImplDefinedPartLength); Require.that(currentImplDefinedPartLength < RADIX); @@ -184,6 +239,11 @@ public Builder withImplDefinedPartLength(final int currentImplDefinedPartLength) return this; } + /** + * Returns a new RecordFormat. + * + * @return RecordFormat + */ public RecordFormat build() { return new RecordFormat(indicatorLength, identifierLength, fieldLengthLength, fieldStartLength, implDefinedPartLength); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java index 5bf3643fc..12c872162 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java @@ -80,6 +80,10 @@ public final class Marc21Encoder extends private boolean generateIdField; + /** + * Initializes the encoder with MARC 21 constants and charset. + * + */ public Marc21Encoder() { builder = new RecordBuilder(Marc21Constants.MARC21_FORMAT); builder.setCharset(Marc21Constants.MARC21_CHARSET); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index e03c81ba5..9e89f2f6a 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -71,30 +71,20 @@ public final class MarcXmlEncoder extends DefaultStreamPipe Date: Mon, 11 Oct 2021 15:13:04 +0200 Subject: [PATCH 04/40] Fix javadoc in the "commons" module See #396. --- .../org/metafacture/commons/ResourceUtil.java | 44 +++++++++++++++++++ .../org/metafacture/commons/StringUtil.java | 19 ++++++++ .../org/metafacture/commons/TimeUtil.java | 7 +++ .../java/org/metafacture/commons/XmlUtil.java | 27 ++++++++++++ .../commons/reflection/ConfigurableClass.java | 18 ++++++++ .../commons/reflection/ObjectFactory.java | 14 ++++++ .../commons/reflection/ReflectionUtil.java | 13 ++++++ .../metafacture/commons/tries/SetMatcher.java | 19 ++++++++ .../commons/tries/SetReplacer.java | 33 +++++++++----- .../metafacture/commons/tries/SimpleTrie.java | 12 +++++ .../commons/tries/WildcardTrie.java | 12 +++-- .../metafacture/commons/types/ListMap.java | 35 +++++++++++++-- .../metafacture/commons/types/NamedValue.java | 6 +++ 13 files changed, 242 insertions(+), 17 deletions(-) diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java index a6d0fca39..fe8b307fb 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java @@ -148,6 +148,13 @@ public static Properties loadProperties(final String location) return loadProperties(getStream(location)); } + /** + * Loads properties from an InputStream. + * + * @param stream properties as InputStream + * @return Properties + * @throws IOException + */ public static Properties loadProperties(final InputStream stream) throws IOException { final Properties properties; @@ -156,10 +163,24 @@ public static Properties loadProperties(final InputStream stream) return properties; } + /** + * Loads properties from an URL. + * + * @param url properties as URL + * @return Properties + * @throws IOException + */ public static Properties loadProperties(final URL url) throws IOException { return loadProperties(url.openStream()); } + /** + * Loads a text file. + * + * @param location filename + * @return the content of the file + * @throws IOException + */ public static String loadTextFile(final String location) throws IOException { final StringBuilder builder = new StringBuilder(); final BufferedReader reader = new BufferedReader(getReader(location)); @@ -173,6 +194,14 @@ public static String loadTextFile(final String location) throws IOException { return builder.toString(); } + /** + * * Loads a text file. + * + * @param location the filename + * @param list a List of Strings + * @return a List of Strings of the content of the filename, line-by-line + * @throws IOException + */ public static List loadTextFile(final String location, final List list) throws IOException { final BufferedReader reader = new BufferedReader(getReader(location)); @@ -186,6 +215,14 @@ public static List loadTextFile(final String location, return list; } + /** + * Reads an InputStream with the given Charset. + * + * @param inputStream the InputStream + * @param encoding the Charset + * @return a String of the content of the InputStream + * @throws IOException + */ public static String readAll(final InputStream inputStream, final Charset encoding) throws IOException { try (Reader reader = new InputStreamReader(inputStream, encoding)) { @@ -193,6 +230,13 @@ public static String readAll(final InputStream inputStream, final Charset encodi } } + /** + * Reads a Reader. + * + * @param reader the Reader + * @return a String of the content of the Reader + * @throws IOException + */ public static String readAll(final Reader reader) throws IOException { final StringBuilder loadedText = new StringBuilder(); try (Reader bufferedReader = new BufferedReader(reader)) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java index 2d703bc10..4d08daafe 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java @@ -34,6 +34,14 @@ private StringUtil() { // no instances allowed } + /** + * Sets a fallback of an Object if the the Object is null. + * + * @param a class + * @param value the Object + * @param fallbackValue the default Object + * @return an Object + */ public static O fallback(final O value, final O fallbackValue) { if (value == null) { return fallbackValue; @@ -55,6 +63,17 @@ public static String format(final String format, final boolean ignoreMissingVars return format(format, DEFAULT_VARSTART, DEFAULT_VAREND, ignoreMissingVars, variables); } + /** + * Formats a String. If a String has a variable it will be replaced based on a + * Map. The start and the end of indicating this variable must be defined. + * + * @param format the String to be formatted + * @param varStartIndicator a String indicating the start of a variable + * @param varEndIndicator a String indicating the end of a variable + * @param ignoreMissingVars boolean if an unassigned variable should be ignored + * @param variables a Map of variable names and their values + * @return a formatted String + */ public static String format(final String format, final String varStartIndicator, final String varEndIndicator, final boolean ignoreMissingVars, final Map variables) { if (format.indexOf(varStartIndicator) < 0) { // shortcut if there is diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java index df04cfd55..30c4c2352 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java @@ -39,6 +39,13 @@ private TimeUtil() { // No instances allowed } + /** + * Formats a duration to human readable abbrevations. See {@link TimeUtilTest} + * how to use it. + * + * @param duration a long value of the duration + * @return a human readable format of the duration + */ public static String formatDuration(final long duration) { long major = duration; long minor = 0; diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java index daa6f9ba2..224969f9a 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java @@ -49,6 +49,13 @@ public static String nodeToString(final Node node) { return nodeToString(node, false); } + /** + * Converts a Node to a String, with or without an XML declaration + * + * @param node the Node + * @param omitXMLDecl boolean if an XML declaration is ommited or not + * @return a String representation of the Node + */ public static String nodeToString(final Node node, final boolean omitXMLDecl) { final StringWriter writer = new StringWriter(); @@ -79,6 +86,12 @@ public static String nodeToString(final Node node, return writer.toString(); } + /** + * Converts a NodeList to a String. + * + * @param nodes the NodeList + * @return a String representation od the NodeList + */ public static String nodeListToString(final NodeList nodes) { final StringBuilder builder = new StringBuilder(); @@ -89,6 +102,12 @@ public static String nodeListToString(final NodeList nodes) { return builder.toString(); } + /** + * Checks if a String is an Xml Mime Type. + * + * @param mimeType the Mime Type + * @return boolean if a String is an Xml Mime Type + */ public static boolean isXmlMimeType(final String mimeType) { if (mimeType == null) { return false; @@ -102,6 +121,14 @@ public static String escape(final String unescaped) { return escape(unescaped, true); } + /** + * Escapes XML special characters. May also escape non-ASCII characters (aka + * unicode). + * + * @param unescaped the String to be unescaped + * @param escapeUnicode boolean if unicode should be also escaped + * @return the escaped String + */ public static String escape(final String unescaped, final boolean escapeUnicode) { return unescaped.codePoints() .mapToObj(value -> escapeCodePoint(value, escapeUnicode)) diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java index 2fdb4d59d..c27390694 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java @@ -54,6 +54,11 @@ public Class getPlainClass() { return plainClass; } + /** + * Gets all "public set" methods of this class. + * + * @return the Map of all setter methods of this class + */ public Map getSetters() { if (settersCache == null) { initSettersCache(); @@ -82,6 +87,11 @@ private boolean isSetter(final Method method) { return false; } + /** + * Gets the class types of the setter methods. + * + * @return a Map of the setter methods name and their types + */ public Map> getSetterTypes() { final Map> setterTypes = new HashMap<>(); for (final Map.Entry method : getSetters().entrySet()) { @@ -95,6 +105,14 @@ public T newInstance() { return newInstance(Collections.emptyMap()); } + /** + * Creates an instance of the class using the first constructor that matches the + * varargs argument of the methods. + * + * @param setterValues + * @param constructorArgs + * @return the new instance + */ public T newInstance(final Map setterValues, final Object... constructorArgs) { try { final Constructor constructor = findConstructor(constructorArgs); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java index 239d963ec..a6695fbd7 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java @@ -40,6 +40,12 @@ public class ObjectFactory { public ObjectFactory() { } + /** + * Loads classes from a map. + * + * @param classMap the map of classes + * @param baseType the object type of the classes + */ public final void loadClassesFromMap(final Map classMap, final Class baseType) { final ClassLoader loader = ReflectionUtil.getContextClassLoader(); for (final Entry entry : classMap.entrySet()) { @@ -61,6 +67,14 @@ public final T newInstance(final String key, final Object... constructorArgs) { return newInstance(key, Collections.emptyMap(), constructorArgs); } + /** + * Returns a new instance of a ConfigurableClass. + * + * @param key the name of the class + * @param values the Map of Strings of the setters + * @param constructorArgs the args of the constructor + * @return a new instance + */ public final T newInstance(final String key, final Map values, final Object... constructorArgs) { if (!classes.containsKey(key)) { throw new NoSuchElementException("no registered class for: " + key); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java index e381ea0b4..b21a460a2 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java @@ -28,6 +28,10 @@ private ReflectionUtil() { throw new AssertionError("No instances allowed"); } + /** + * @return the context ClassLoader for this thread, or null indicating the + * system class loader (or, failing that, the bootstrap class loader) + */ public static ClassLoader getContextClassLoader() { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { @@ -40,6 +44,15 @@ public static ConfigurableClass loadClass(final String classNam return loadClass(getContextClassLoader(), className, baseType); } + /** + * Wraps a Class to a ConfigurableClass. + * + * @param the object type of the ConfigurableClass + * @param loader the ClassLoader + * @param className the name of the class + * @param baseType the object typed class to be wrapped + * @return the ConfigurableClass + */ public static ConfigurableClass loadClass(final ClassLoader loader, final String className, final Class baseType) { final Class clazz; try { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java index eaa706977..9da4cd870 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java @@ -36,6 +36,12 @@ public final class SetMatcher { public SetMatcher() { } + /** + * Puts a value to a key. + * + * @param key the key + * @param value the value + */ public void put(final String key, final T value) { if (isPrepared) { throw new IllegalStateException("keys cannot be added during matching."); @@ -63,6 +69,12 @@ else if (next.getValue() == null) { } } + /** + * Gets the List of Matches of a text. + * + * @param text the text + * @return List of Matches + */ public List> match(final String text) { if (!isPrepared) { prepare(); @@ -173,6 +185,13 @@ public static final class Match { private final int start; private final int length; + /** + * Constructs a Match. + * + * @param value the value + * @param start the position + * @param length the length + */ public Match(final T value, final int start, final int length) { this.value = value; this.start = start; diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java index fbb2eae38..78f7e1ef3 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java @@ -25,6 +25,8 @@ import java.util.Map; /** + * Replaces Strings by other Strings. + * * @author Markus Michael Geipel * */ @@ -34,20 +36,37 @@ public final class SetReplacer { public SetReplacer() { } - public void addReplacement(final String key, final String with) { - matcher.put(key, with); + /** + * Adds a replacement of a String by an other String. + * + * @param toReplace String to replace + * @param replacement String of replacement + */ + public void addReplacement(final String toReplace, final String replacement) { + matcher.put(toReplace, replacement); } + /** + * Adds replacements given as a Map of Strings. + * + * @param replacements the Map of Strings to be replaced + */ public void addReplacements(final Map replacements) { for (final Entry entry : replacements.entrySet()) { addReplacement(entry.getKey(), entry.getValue()); } } + /** + * Replaces the Strings defined with {@link #addReplacement(String, String)} in + * the text. + * + * @param text + * @return the text with the replacements + */ public String replaceIn(final String text) { final List> matches = matcher.match(text); final StringBuilder builder = new StringBuilder(); - int lastCut = 0; Collections.sort(matches, new Comparator>() { @@ -56,25 +75,17 @@ public int compare(final Match o1, final Match o2) { final int delta = o1.getStart() - o2.getStart(); return delta < 0 ? -1 : delta > 0 ? 1 : o1.getLength() > o2.getLength() ? -1 : 1; } - }); for (final SetMatcher.Match match : matches) { - if (match.getStart() < lastCut) { continue; } - - // System.out.println(match.getStart() + " "+ match.getValue() +" "+ - // match.getLength()); - builder.append(text.substring(lastCut, match.getStart())); builder.append(match.getValue()); - lastCut = match.getStart() + match.getLength(); } builder.append(text.substring(lastCut, text.length())); - return builder.toString(); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java index 40f0f422f..94ac10fb9 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java @@ -28,6 +28,12 @@ public final class SimpleTrie

{ public SimpleTrie() { } + /** + * Puts a value to the key. + * + * @param key the name of the key + * @param value the value + */ public void put(final String key, final P value) { Node

node = root; @@ -49,6 +55,12 @@ public void put(final String key, final P value) { } } + /** + * Gets the value of a key. + * + * @param key the name of the key + * @return the value + */ public P get(final String key) { Node

node = root; final int length = key.length(); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java index 1bada6d34..88627fb1b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java @@ -46,10 +46,10 @@ public WildcardTrie() { } /** - * Inserts keys into the try. Use '|' to concatenate. Use '*' (0,inf) and - * '?' (1,1) to express wildcards. + * Inserts keys into the trie. Use '|' to concatenate. Use '*' (0,inf) and '?' + * (1,1) to express wildcards. * - * @param keys pattern of keys to register + * @param keys pattern of keys to register * @param value value to associate with the key pattern. */ public void put(final String keys, final P value) { @@ -80,6 +80,12 @@ private void simplyPut(final String key, final P value) { node.addValue(value); } + /** + * Gets the List of values identified by a key. + * + * @param key the key + * @return the List of + */ public List

get(final String key) { nodes.add(root); final int length = key.length(); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java index 2b0ec6859..2a8d6f67a 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java @@ -57,10 +57,21 @@ public final void clear() { identifier = null; } + /** + * Removes a key of the map. + * + * @param key the key + * @return the List of values or null if the map didn't contain the key + */ public final List removeKey(final K key) { return map.remove(key); } + /** + * Clears all values of a key of the map. + * + * @param key the key of the map + */ public final void clearKey(final K key) { final List values = map.get(key); if (values != null) { @@ -68,6 +79,9 @@ public final void clearKey(final K key) { } } + /** + * Clears all values of all keys of the map. + */ public final void clearAllKeys() { for (final Entry> entry: map.entrySet()) { entry.getValue().clear(); @@ -84,14 +98,18 @@ public final Set keySet() { return map.keySet(); } + /** + * Adds a value to the List of values of the key of the map. + * + * @param name the key + * @param value the value + */ public final void add(final K name, final V value) { - List values = map.get(name); if (values == null) { values = new ArrayList(); map.put(name, values); } - values.add(value); } @@ -108,6 +126,12 @@ public final boolean existsKey(final K name) { return getFirst(name) != null; } + /** + * Gets the first element of the List of values of the key of the map. + * + * @param name the key + * @return first element of the values of the key + */ public final V getFirst(final K name) { final List values = map.get(name); if (values == null || values.isEmpty()) { @@ -159,7 +183,12 @@ public final List remove(final Object key) { return map.remove(key); } - //@Override + /** + * Adds a List of values to a key of the map. + * + * @param name the key + * @param addValues the List of values + */ public final void putAll(final K name, final Collection addValues) { List values = map.get(name); if (values == null) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java index f1c310945..23e981bda 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java @@ -30,6 +30,12 @@ public final class NamedValue implements Comparable { private final String value; private final int preCompHashCode; + /** + * Constructs an immutable name-value-pair by computing a hash code. + * + * @param name the name of the pair + * @param value the value of the pair + */ public NamedValue(final String name, final String value) { this.name = name; this.value = value; From 239a3de67ea42a4446af9ac04e61d714cc9b61d4 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 15:16:29 +0200 Subject: [PATCH 05/40] Fix javadoc for module "elasticsearch" Simplify non-arg constructor. See #396. --- .../metafacture/elasticsearch/JsonToElasticsearchBulk.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java b/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java index 804e762eb..c314a723a 100644 --- a/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java +++ b/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java @@ -46,14 +46,11 @@ public class JsonToElasticsearchBulk extends DefaultObjectPipe> { private ObjectMapper mapper = new ObjectMapper(); - private String[] idPath; + private String[] idPath = new String[] {}; private String type; private String index; public JsonToElasticsearchBulk() { - this.idPath = new String[]{}; - this.type = null; - this.index = null; } /** From 0ca03f11a3f16782e8c67408adca032320393b1f Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 15:26:51 +0200 Subject: [PATCH 06/40] Fix javadoc for module "files" See #396. --- .../metafacture/files/FileDigestCalculator.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/metafacture-files/src/main/java/org/metafacture/files/FileDigestCalculator.java b/metafacture-files/src/main/java/org/metafacture/files/FileDigestCalculator.java index e36395868..f2e3d8823 100644 --- a/metafacture-files/src/main/java/org/metafacture/files/FileDigestCalculator.java +++ b/metafacture-files/src/main/java/org/metafacture/files/FileDigestCalculator.java @@ -56,11 +56,21 @@ public final class FileDigestCalculator extends private final DigestAlgorithm algorithm; private final MessageDigest messageDigest; + /** + * Uses the given DigestAlgorithm to define the MessageDigest. + * + * @param algorithm the DigestAlgorithm + */ public FileDigestCalculator(final DigestAlgorithm algorithm) { this.algorithm = algorithm; this.messageDigest = this.algorithm.getInstance(); } + /** + * Uses the given name of the algorithm to define the MessageDigest. + * + * @param algorithm the name of the algorithm + */ public FileDigestCalculator(final String algorithm) { this.algorithm = DigestAlgorithm.valueOf(algorithm.toUpperCase()); this.messageDigest = this.algorithm.getInstance(); @@ -129,6 +139,12 @@ public enum DigestAlgorithm { this.identifier = identifier; } + /** + * Returns a MessageDigest object that implements the specified digest + * algorithm. + * + * @return the MessageDigest + */ public MessageDigest getInstance() { try { return MessageDigest.getInstance(identifier); From ceae172f469377e7a24025a4b132f3c7f4b1f7bd Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 15:29:37 +0200 Subject: [PATCH 07/40] Fix javadoc for module "flowcontrol". See #396. --- .../main/java/org/metafacture/flowcontrol/StreamBuffer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java index 0f1940d63..f87ce2772 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java @@ -80,6 +80,9 @@ public void replay() { } } + /** + * Clears the buffer. + */ public void clear() { typeBuffer.clear(); valueBuffer.clear(); From f7cc5907149a02ceeb6ce9cdb984f6d3b422ac12 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 15:39:17 +0200 Subject: [PATCH 08/40] Fix javadoc for module "flux" See #396. --- .../src/main/java/org/metafacture/flux/HelpPrinter.java | 9 ++++++++- .../java/org/metafacture/flux/parser/FluxProgramm.java | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java b/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java index fc173cf5e..d3375bf85 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java @@ -37,7 +37,7 @@ import java.util.Map; /** - * prints Flux help for a given {@link ObjectFactory} + * Prints Flux help for a given {@link ObjectFactory} * * @author Markus Michael Geipel */ @@ -46,6 +46,13 @@ private HelpPrinter() { // no instances } + /** + * Prints Flux help for a given ObjectFactory. Excerpts setters and their + * arguments, @in annotations and @out annotations. + * + * @param factory the ObjectFactory + * @param out the PrintStream to print to + */ public static void print(final ObjectFactory factory, final PrintStream out) { out.println("Welcome to Metafacture"); diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java b/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java index 0b1d162ca..55de12cb2 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java @@ -157,6 +157,9 @@ protected void compile() { } } + /** + * Starts all flows. + */ public void start() { for (final Flow flow : initialFlows) { flow.start(); From 91f02e44a316fe5f7477255a8ebfb1ff6d17cb04 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 15:53:50 +0200 Subject: [PATCH 09/40] Fix javadoc for module "formeta" See #396. --- .../main/java/org/metafacture/formeta/FormetaEncoder.java | 5 +++++ .../java/org/metafacture/formeta/parser/FormetaParser.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java index e9f65ee6e..a1db1137f 100644 --- a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java +++ b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java @@ -48,6 +48,11 @@ public FormatterStyle getStyle() { return style; } + /** + * Sets the style of the Formatter. + * + * @param formatterStyle the FormatterStyle + */ public void setStyle(final FormatterStyle formatterStyle) { this.style = formatterStyle; formatter = formatterStyle.createFormatter(); diff --git a/metafacture-formeta/src/main/java/org/metafacture/formeta/parser/FormetaParser.java b/metafacture-formeta/src/main/java/org/metafacture/formeta/parser/FormetaParser.java index 9ed4ed3c4..267344480 100644 --- a/metafacture-formeta/src/main/java/org/metafacture/formeta/parser/FormetaParser.java +++ b/metafacture-formeta/src/main/java/org/metafacture/formeta/parser/FormetaParser.java @@ -48,6 +48,11 @@ public Emitter getEmitter() { return structureParserContext.getEmitter(); } + /** + * Parses the data. + * + * @param data the data + */ public void parse(final String data) { assert structureParserContext.getEmitter() != null : "No emitter set"; From 24b3fe023da082d5b0e646c205ee3a689445d130 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 16:03:50 +0200 Subject: [PATCH 10/40] Fix javadoc for module "framework" See #396. --- .../framework/annotations/Description.java | 9 ++++++-- .../metafacture/framework/annotations/In.java | 9 ++++++-- .../framework/annotations/Out.java | 9 ++++++-- .../metafacture/framework/objects/Triple.java | 21 +++++++++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Description.java b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Description.java index 2bb4d5a5a..da812189e 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Description.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Description.java @@ -22,14 +22,19 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** - * @author Markus Michael Geipel * Metadata for pipe elements + * + * @author Markus Michael Geipel */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Description { + /** + * Returns the description of the class. + * + * @return the description as String + */ String value(); } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java index 40b8ba4a7..ff97549c1 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java @@ -22,14 +22,19 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** - * @author Markus Michael Geipel * Metadata for pipe elements + * + * @author Markus Michael Geipel */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface In { + /** + * Returns the class used as input to when using the class in a pipe. + * + * @return the Class + */ Class value(); } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java index ee9b62723..a46c24bfb 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java @@ -22,14 +22,19 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; - /** + * Metadata for pipe elements. + * * @author Markus Michael Geipel - * Metadata for pipe elements */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Out { + /** + * Returns the class used as output when using this class in a pipe. + * + * @return the Class + */ Class value(); } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java index f793d3cf3..7262bed7d 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java @@ -40,6 +40,14 @@ public Triple(final String subject, final String predicate, this(subject, predicate, object, ObjectType.STRING); } + /** + * Constructs a Triple. + * + * @param subject the subject + * @param predicate the predicate + * @param object the object + * @param objectType the ObjectType + */ public Triple(final String subject, final String predicate, final String object, final ObjectType objectType) { this.subject = subject; @@ -69,6 +77,13 @@ public ObjectType getObjectType() { return objectType; } + /** + * Reads an ObjectInputStream as Triple and returns it. + * + * @param in the ObjectInputStream + * @return the Triple + * @throws IOException + */ public static Triple read(final ObjectInputStream in) throws IOException { try { return new Triple(in.readUTF(), in.readUTF(), in.readUTF(), @@ -79,6 +94,12 @@ public static Triple read(final ObjectInputStream in) throws IOException { } } + /** + * Writes the Triple to an ObjectOutputStream. + * + * @param out the ObjectOutputStream. + * @throws IOException + */ public void write(final ObjectOutputStream out) throws IOException { out.writeUTF(subject); out.writeUTF(predicate); From cabc09537138c87a4f6ac17460020dd6756c7619 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 11 Oct 2021 16:12:30 +0200 Subject: [PATCH 11/40] Fix javadoc for module "html" See #396. --- .../src/main/java/org/metafacture/html/HtmlDecoder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java index 26ae792d5..151f6f286 100644 --- a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java +++ b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java @@ -123,6 +123,12 @@ private boolean handleAttributeValuesAsSubfields(final StreamReceiver receiver, return false; } + /** + * Sets attribute values as subfields. If the value(s) start with an `&` they + * are appended to {@link #DEFAULT_ATTR_VALS_AS_SUBFIELDS}. + * + * @param mapString the attributes to be added as subfields + */ public void setAttrValsAsSubfields(final String mapString) { this.attrValsAsSubfields = new HashMap(); final String input = mapString.startsWith("&") ? DEFAULT_ATTR_VALS_AS_SUBFIELDS + mapString : mapString; From e3785d9592eb1173c7dad7b11d8b7c6c04a1948a Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 18 Oct 2021 16:49:04 +0200 Subject: [PATCH 12/40] Fix javadoc for module "io" (#396) --- .../src/main/java/org/metafacture/io/LineReader.java | 7 +++++++ .../main/java/org/metafacture/io/ObjectFileWriter.java | 5 +++++ .../main/java/org/metafacture/io/ObjectJavaIoWriter.java | 9 +++++++++ .../src/main/java/org/metafacture/io/ObjectWriter.java | 8 ++++++++ .../src/main/java/org/metafacture/io/RecordReader.java | 5 +++++ 5 files changed, 34 insertions(+) diff --git a/metafacture-io/src/main/java/org/metafacture/io/LineReader.java b/metafacture-io/src/main/java/org/metafacture/io/LineReader.java index 45860bd96..351fda8ed 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/LineReader.java +++ b/metafacture-io/src/main/java/org/metafacture/io/LineReader.java @@ -52,6 +52,13 @@ public void process(final Reader reader) { process(reader, getReceiver()); } + /** + * Processes input from a reader line by line and pass them line by line to a + * receiver. + * + * @param reader the Reader + * @param receiver the ObjectReceiver + */ public static void process(final Reader reader, final ObjectReceiver receiver) { final BufferedReader lineReader = new BufferedReader(reader, BUFFER_SIZE); try { diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectFileWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectFileWriter.java index fd487f0d1..bcbf90fb3 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectFileWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectFileWriter.java @@ -52,6 +52,11 @@ public final class ObjectFileWriter extends AbstractObjectWriter { private String encoding = "UTF-8"; private FileCompression compression = FileCompression.AUTO; + /** + * Sets the destination of a file to write objects to. + * + * @param path the path to be written to + */ public ObjectFileWriter(final String path) { this.path = path; startNewFile(); diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java index fd431ca73..273fbb969 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java @@ -36,11 +36,20 @@ public final class ObjectJavaIoWriter implements ObjectReceiver { private boolean closed; private final IoWriterFactory writerFactory; + /** + * Deprecated. + * @param writer the Writer + */ public ObjectJavaIoWriter(final Writer writer) { this.writer = writer; writerFactory = null; } + /** + * Deprecated. + * + * @param writerFactory the IoWriterFactory + */ public ObjectJavaIoWriter(final IoWriterFactory writerFactory) { this.writerFactory = writerFactory; this.writer = writerFactory.createWriter(); diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java index 279c36832..ac28edb5b 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java @@ -45,6 +45,14 @@ public final class ObjectWriter implements ConfigurableObjectWriter { private final ConfigurableObjectWriter objectWriter; + /** + * Sets the destination to write objects to. If destination is set to + * {@value #STDOUT} the object is written to standard out. Else it's written to + * a file. + * + * @param destination the path to be written to or standard out if it's + * {@value #STDOUT} + */ public ObjectWriter(final String destination) { if (STDOUT.equals(destination)) { objectWriter = new ObjectStdoutWriter(); diff --git a/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java b/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java index 2ddbdb56a..8014b23a1 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java +++ b/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java @@ -56,6 +56,11 @@ public final class RecordReader extends DefaultObjectPipe= 1) { this.separator = separator.charAt(0); From 527c24d1f21003116c9e4875c51cf357cf1d072a Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 18 Oct 2021 18:01:55 +0200 Subject: [PATCH 13/40] Fix javadoc for module "javaintegration" (#396) Also simplifies some constructors. --- .../metafacture/javaintegration/NamedValueList.java | 9 ++++++--- .../org/metafacture/javaintegration/NamedValueSet.java | 6 +----- .../javaintegration/StringListMapToStream.java | 6 ++++++ .../org/metafacture/javaintegration/StringMap.java | 10 ++++++---- .../java/org/metafacture/javaintegration/ValueSet.java | 6 +----- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java index d2dc101b4..39298faf3 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java @@ -34,14 +34,17 @@ public final class NamedValueList extends DefaultStreamReceiver implements List, Collector> { private Collection> collection; - private List list; + private List list = new ArrayList(); public NamedValueList() { - list = new ArrayList(); } + /** + * Constructs a NamedValueList with a given Collection. + * + * @param collection the Collection + */ public NamedValueList(final Collection> collection) { - list = new ArrayList(); this.collection = collection; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java index 0630172ea..d2d9106d0 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java @@ -33,12 +33,9 @@ public final class NamedValueSet extends DefaultStreamReceiver implements Set, Collector> { private Collection> collection; - private Set set; + private Set set = new HashSet<>(); public NamedValueSet() { - set = new HashSet<>(); - this.collection = null; - } /** @@ -48,7 +45,6 @@ public NamedValueSet() { * @param collection is filled with the received results. */ public NamedValueSet(final Collection> collection) { - set = new HashSet<>(); this.collection = collection; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java index a9ccf95b0..625cd2496 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java @@ -46,6 +46,12 @@ public void process(final ListMap listMap) { process(listMap, getReceiver()); } + /** + * Reads a {@link ListMap} and sends it to a {@link StreamReceiver}. + * + * @param listMap the ListMap to be read + * @param receiver the StreamReceiver to send to + */ public static void process(final ListMap listMap, final StreamReceiver receiver) { receiver.startRecord(listMap.getId()); for (final Entry> entry: listMap.entrySet()) { diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java index fd7113ede..1e552792c 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java @@ -33,15 +33,17 @@ public final class StringMap extends DefaultStreamReceiver implements Map> collection; - private Map map; + private Map map = new HashMap(); public StringMap() { - map = new HashMap(); - collection = null; } + /** + * Constructs a StringMap with a given Collection. + * + * @param collection the Collection + */ public StringMap(final Collection> collection) { - map = new HashMap(); this.collection = collection; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java index b079a7e08..23a2cd6fe 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java @@ -31,13 +31,10 @@ */ public final class ValueSet extends DefaultStreamReceiver implements Set, Collector> { - private Collection> collection; + private Collection> collection = new HashSet<>(); private Set set; public ValueSet() { - set = new HashSet<>(); - this.collection = null; - } /** @@ -47,7 +44,6 @@ public ValueSet() { * @param collection is filled with the received results. */ public ValueSet(final Collection> collection) { - set = new HashSet<>(); this.collection = collection; } From 273dea9713ad6fc29e79704a846e497e5e797266 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 18 Oct 2021 18:08:39 +0200 Subject: [PATCH 14/40] Fix javadoc for module "jdom" (#396) --- .../java/org/metafacture/jdom/JDomDocumentToStream.java | 5 +++++ .../java/org/metafacture/jdom/StreamToJDomDocument.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java b/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java index dc9309078..732c33915 100644 --- a/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java +++ b/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java @@ -41,6 +41,11 @@ public final class JDomDocumentToStream private final SAXOutputter saxOutputer; private final XmlPipe xmlPipe; + /** + * Contructs a JDomDocumentToStream with a given XmlPipe. + * + * @param xmlPipe + */ public JDomDocumentToStream(final XmlPipe xmlPipe) { this.xmlPipe = xmlPipe; saxOutputer = new SAXOutputter(xmlPipe); diff --git a/metafacture-jdom/src/main/java/org/metafacture/jdom/StreamToJDomDocument.java b/metafacture-jdom/src/main/java/org/metafacture/jdom/StreamToJDomDocument.java index b1cc3101a..d9ed9d541 100644 --- a/metafacture-jdom/src/main/java/org/metafacture/jdom/StreamToJDomDocument.java +++ b/metafacture-jdom/src/main/java/org/metafacture/jdom/StreamToJDomDocument.java @@ -58,6 +58,13 @@ public final class StreamToJDomDocument private final String rootTagName; private final Map namespaces = new HashMap(); + /** + * Constructs a StreamToJDomDocument initialized with a given root tag name and + * a location of a file with named properties. + * + * @param rootTagName the root tag name + * @param namespaceProperties the location of the file of the named properties + */ public StreamToJDomDocument(final String rootTagName, final String namespaceProperties) { this.rootTagName = rootTagName; namespaces.put(XML, Namespace.getNamespace(XML, "http://www.w3.org/XML/1998/namespace")); From 16fa34d481d3f5685e64f28676ce83a885e98b31 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 14:01:57 +0200 Subject: [PATCH 15/40] Fix javadoc for module "json" (#396) Also simplifies a constructor. --- .../java/org/metafacture/json/JsonDecoder.java | 16 +++++----------- .../java/org/metafacture/json/JsonEncoder.java | 4 ++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java b/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java index 410fe7bd0..8bf937c91 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java @@ -60,20 +60,14 @@ public final class JsonDecoder extends DefaultObjectPipe private final JsonFactory jsonFactory = new JsonFactory(); private JsonParser jsonParser; - private String arrayMarker; - private String arrayName; - private String recordId; - private int recordCount; + private String arrayMarker = DEFAULT_ARRAY_MARKER; + private String arrayName = DEFAULT_ARRAY_NAME; + private String recordId = DEFAULT_RECORD_ID; + private String recordPath = DEFAULT_ROOT_PATH; - private String recordPath; + private int recordCount; public JsonDecoder() { - setArrayMarker(DEFAULT_ARRAY_MARKER); - setArrayName(DEFAULT_ARRAY_NAME); - setRecordId(DEFAULT_RECORD_ID); - setRecordPath(DEFAULT_ROOT_PATH); - - resetRecordCount(); } public void setAllowComments(final boolean allowComments) { diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java index d0527fa18..6a7a7f1a9 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java @@ -62,6 +62,10 @@ public final class JsonEncoder extends DefaultStreamPipe> private String arrayMarker = ARRAY_MARKER; + /** + * Default constructor initializes the JsonGenerator. The root value separator + * of the JsonGenerator is set to null. + */ public JsonEncoder() { try { jsonGenerator = new JsonFactory().createGenerator(writer); From b5fb3277180cca793ec642cfe467ec8c3763e0f6 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 16:22:29 +0200 Subject: [PATCH 16/40] Fix javadoc for module "mangling" (#396) Also simplifies constructors. --- .../org/metafacture/mangling/ObjectToLiteral.java | 7 ++----- .../org/metafacture/mangling/RecordPathFilter.java | 12 +++++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/ObjectToLiteral.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/ObjectToLiteral.java index 0e988cf51..2773b4627 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/ObjectToLiteral.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/ObjectToLiteral.java @@ -37,14 +37,11 @@ public final class ObjectToLiteral extends public static final String DEFAULT_LITERAL_NAME = "obj"; public static final String DEFAULT_RECORD_ID = ""; - private String literalName; - private String recordId; + private String literalName = DEFAULT_LITERAL_NAME; + private String recordId = DEFAULT_RECORD_ID; private int recordCount; public ObjectToLiteral() { - setLiteralName(DEFAULT_LITERAL_NAME); - setRecordId(DEFAULT_RECORD_ID); - recordCount = 0; } public void setLiteralName(final String literalName) { diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java index bba0e6210..6700223cf 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java @@ -38,21 +38,23 @@ public final class RecordPathFilter extends DefaultStreamPipe { private final EntityPathTracker entityPathTracker = new EntityPathTracker(); - private String path; - private String recordIdFormat; + private String path = ROOT_PATH; + private String recordIdFormat = DEFAULT_RECORD_ID_FORMAT; private String recordIdentifier; private boolean inMatch; private boolean recordStarted; private int recordCount; public RecordPathFilter() { - this(ROOT_PATH); } + /** + * Constructs a RecordPathFilter with a given path. + * + * @param path the name of the path + */ public RecordPathFilter(final String path) { - resetRecord(); setPath(path); - setRecordIdFormat(DEFAULT_RECORD_ID_FORMAT); } public void setEntitySeparator(final String entitySeparator) { From 118c86cd45ed9887b59a57542aa01711a31d2962 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 16:43:31 +0200 Subject: [PATCH 17/40] Fix javadoc for module "monitoring" (#396) --- .../metafacture/monitoring/ObjectBatchLogger.java | 13 ++++++++++++- .../metafacture/monitoring/StreamBatchLogger.java | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java index 2554eedc8..481a93260 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java @@ -61,6 +61,10 @@ public final class ObjectBatchLogger extends DefaultObjectPipe vars) { + /** + * Constructs an ObjectBatchLogger with a not changeable format and a map of + * variables. + * + * @param format a not changeable format + * @param vars a map of not changeable variables + */ + ObjectBatchLogger(final String format, final Map vars) { this.format = format; this.vars.putAll(vars); } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java index 53cca5f53..1980368b4 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java @@ -70,6 +70,13 @@ public StreamBatchLogger(final String format) { this.format = format; } + /** + * Constructs a StreamBatchLogger with a not changeable format and a map of + * variables. + * + * @param format a not changeable format + * @param vars a map of variables + */ public StreamBatchLogger(final String format, final Map vars) { this.format = format; this.vars.putAll(vars); From aa396752fdabad0bda630dde5b48571de0c5fe25 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 16:52:42 +0200 Subject: [PATCH 18/40] Fix javadoc for module "runner" (#396) --- .../src/main/java/org/metafacture/runner/Flux.java | 7 +++++++ .../org/metafacture/runner/util/DirectoryClassLoader.java | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java b/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java index c10adffdd..4cc1e4ece 100644 --- a/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java +++ b/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java @@ -47,6 +47,13 @@ private Flux() { // No instances allowed } + /** + * Runs the Flux. + * + * @param args the pathname of the flux file to run + * @throws IOException + * @throws RecognitionException + */ public static void main(final String[] args) throws IOException, RecognitionException { loadCustomJars(); diff --git a/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java b/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java index 1116928d6..625a453f4 100644 --- a/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java +++ b/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java @@ -49,6 +49,12 @@ public DirectoryClassLoader(final ClassLoader parent) { super(new URL[0], parent); } + /** + * Adds a directory and appends all jars and classes of that directory to the + * list of URLs to search for classes and resources. + * + * @param dir the directory as File to be added + */ public void addDirectory(final File dir) { for (final File file : dir.listFiles(JAR_AND_CLASS_FILTER)) { try { From ef337bc218095512730bcfb1fa68eacca22a7b93 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 17:08:44 +0200 Subject: [PATCH 19/40] Fix javadoc for module "statistics" (#396) --- .../statistics/CooccurrenceMetricCalculator.java | 10 ++++++++++ .../org/metafacture/statistics/UniformSampler.java | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/metafacture-statistics/src/main/java/org/metafacture/statistics/CooccurrenceMetricCalculator.java b/metafacture-statistics/src/main/java/org/metafacture/statistics/CooccurrenceMetricCalculator.java index 2f37159b8..e6e9783be 100644 --- a/metafacture-statistics/src/main/java/org/metafacture/statistics/CooccurrenceMetricCalculator.java +++ b/metafacture-statistics/src/main/java/org/metafacture/statistics/CooccurrenceMetricCalculator.java @@ -98,6 +98,11 @@ enum Metric { private final List metrics = new ArrayList(); + /** + * Constructs a CooccurrenceMetricCalculator with given metrics. + * + * @param allMetrics the Metrics as a comma separated String + */ public CooccurrenceMetricCalculator(final String allMetrics) { setMinCount(MIN_COUNT); for (final String metric : allMetrics.split("\\s*,\\s*")) { @@ -105,6 +110,11 @@ public CooccurrenceMetricCalculator(final String allMetrics) { } } + /** + * Constructs a CooccurrenceMetricCalculator with given metrics. + * + * @param metrics the Metrics as an array + */ public CooccurrenceMetricCalculator(final Metric... metrics) { setMinCount(MIN_COUNT); for (final Metric metric : metrics) { diff --git a/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java b/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java index 8af90b332..7eddc8f7d 100644 --- a/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java +++ b/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java @@ -49,6 +49,11 @@ public final class UniformSampler extends private long count; + /** + * Constructs a UniformSampler with a given sample size. + * + * @param sampleSize the size of the sample + */ public UniformSampler(final int sampleSize) { this.sampleSize = sampleSize; sample = new ArrayList(sampleSize); From f53a15678254e5bff77b4ce0f0718e9da62db0a9 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 17:11:05 +0200 Subject: [PATCH 20/40] Fix javadoc for module "strings" (#396) --- .../src/main/java/org/metafacture/strings/RegexDecoder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java b/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java index aca3f5573..5f90969d4 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java @@ -93,6 +93,11 @@ public final class RegexDecoder extends DefaultObjectPipe Date: Thu, 21 Oct 2021 18:00:54 +0200 Subject: [PATCH 21/40] Fix javadoc for module "triples" (#396) --- .../triples/AbstractTripleSort.java | 30 ++++++++++++------- .../triples/SortedTripleFileFacade.java | 22 ++++++++++++++ .../metafacture/triples/TripleCollect.java | 5 ++++ .../org/metafacture/triples/TripleWriter.java | 5 ++++ 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java index 1ccd21710..27cee6080 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java @@ -35,17 +35,20 @@ * @author markus geipel * */ -public abstract class AbstractTripleSort extends DefaultObjectPipe> implements MemoryWarningSystem.Listener { +public abstract class AbstractTripleSort extends DefaultObjectPipe> + implements MemoryWarningSystem.Listener { + /** - * specifies the comparator + * Specifies the comparator. Can be one of {@link #SUBJECT}, {@link #PREDICATE}, + * {@link #OBJECT}, {@link #ALL}. */ public enum Compare { SUBJECT, PREDICATE, OBJECT, ALL } /** - * sort order - * + * Specifies the sort order.Can be one of {@link #INCREASING}, + * {@link #DECREASING}. */ public enum Order { INCREASING { @@ -63,17 +66,17 @@ public int order(final int indicator) { public abstract int order(int indicator); } - private final List buffer = new ArrayList(); - private final List tempFiles; + private final List buffer = new ArrayList<>(); + private final List tempFiles = new ArrayList<>(); private Compare compare = Compare.SUBJECT; private Order order = Order.INCREASING; private volatile boolean memoryLow; - public AbstractTripleSort() { + /** + * Constructs an AbstractTripleSort. Calls {@link #MemoryWarningSystem}. + */ + protected AbstractTripleSort() { MemoryWarningSystem.addListener(this); - tempFiles = new ArrayList(); // Initialized here to let the - // compiler enforce the call to - // super() in subclasses. } @Override @@ -192,6 +195,13 @@ public final Comparator createComparator() { return createComparator(compare, order); } + /** + * Creates a Comparator. + * + * @param compareBy one of {@link #Compare} + * @param order the {@link #Order} + * @return a Comparator of type Triple + */ public static Comparator createComparator(final Compare compareBy, final Order order) { final Comparator comparator; switch (compareBy) { diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java index 00490bd6b..5ed357311 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java @@ -37,6 +37,13 @@ public final class SortedTripleFileFacade { private Triple triple; private boolean empty; + /** + * Constructs a SortedTripleFileFacade with a file. Reads a Triple from the + * file. + * + * @param file the File to load a Triple from + * @throws IOException + */ public SortedTripleFileFacade(final File file) throws IOException { this.file = file; in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file), BUFFERSIZE)); @@ -58,6 +65,10 @@ private void next() throws IOException { } } + /** + * Closes the {@link #ObjectInputStream} and deletes the {@value #file} it if it + * exists. + */ public void close() { try { in.close(); @@ -70,6 +81,11 @@ public void close() { } } + /** + * Peeks at a Triple at the top of the stack. + * + * @return the Triple on top of the stack + */ public Triple peek() { if (isEmpty()) { return null; @@ -77,6 +93,12 @@ public Triple peek() { return triple; } + /** + * Pops a Triple from the stack. + * + * @return the Triple at the top of the stack. + * @throws IOException + */ public Triple pop() throws IOException { final Triple nextTriple = peek(); next(); diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java b/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java index 14b1053be..a5c25df1a 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java @@ -67,6 +67,11 @@ public void process(final Triple triple) { } } + /** + * Decodes a Triple. Passes the Predicate and the Object to the receiver. + * + * @param triple the Triple + */ public void decodeTriple(final Triple triple) { if (triple.getObjectType() == ObjectType.STRING) { getReceiver().literal(triple.getPredicate(), triple.getObject()); diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/TripleWriter.java b/metafacture-triples/src/main/java/org/metafacture/triples/TripleWriter.java index ab39de294..43a4fc6c3 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/TripleWriter.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/TripleWriter.java @@ -45,6 +45,11 @@ public final class TripleWriter extends DefaultObjectReceiver { private ObjectOutputStream outputStream; + /** + * Constructs a TripleWriter with a given file name as output path. + * + * @param filename the name of the file to write to + */ public TripleWriter(final String filename) { this.filename = filename; resetStream(); From a69bd87e993d41ce9a8418a3c64af25a620ba428 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Thu, 21 Oct 2021 18:13:58 +0200 Subject: [PATCH 22/40] Fix javadoc for module "xml" (#396) --- .../java/org/metafacture/xml/GenericXmlHandler.java | 8 +++++++- .../java/org/metafacture/xml/SimpleXmlEncoder.java | 10 ++++++++++ .../src/main/java/org/metafacture/xml/XmlDecoder.java | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java index a2813f6fa..e529cde2b 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java @@ -44,6 +44,8 @@ public final class GenericXmlHandler extends DefaultXmlPipe { private static final Pattern TABS = Pattern.compile("\t+"); + private static final String METAMORPH_RECORD_TAG = "org.culturegraph.metamorph.xml.recordtag"; + private String attributeMarker = DEFAULT_ATTRIBUTE_MARKER; private String recordTagName = DEFAULT_RECORD_TAG; private String valueTagName = DEFAULT_VALUE_TAG; @@ -53,8 +55,12 @@ public final class GenericXmlHandler extends DefaultXmlPipe { private boolean emitNamespace = EMIT_NAMESPACE; + /** + * Constructs a GenericXmlHandler by loading the system property + * {@value #METAMORPH_RECORD_TAG} if that system property was set. + */ public GenericXmlHandler() { - final String recordTagNameProperty = System.getProperty("org.culturegraph.metamorph.xml.recordtag"); + final String recordTagNameProperty = System.getProperty(METAMORPH_RECORD_TAG); if (recordTagNameProperty != null) { recordTagName = recordTagNameProperty; } diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java index c0a944918..2ca4016b2 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java @@ -105,6 +105,11 @@ public String getValueTag() { return valueTag; } + /** + * Loads namespaces from a file. + * + * @param file the name of the file to load the namespace properties from + */ public void setNamespaceFile(final String file) { final Properties properties; try { @@ -118,6 +123,11 @@ public void setNamespaceFile(final String file) { } } + /** + * Loads namespaces from a URL. + * + * @param url the URL to load the namespace properties from. + */ public void setNamespaceFile(final URL url) { final Properties properties; try { diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java index 623088949..199fc4ddb 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java @@ -50,6 +50,10 @@ public final class XmlDecoder extends DefaultObjectPipe { private final XMLReader saxReader; + /** + * Constructs an XmlDecoder by obtaining a new instance of a {@link + * org.xml.sax.XMLReader}. + */ public XmlDecoder() { try { saxReader = XMLReaderFactory.createXMLReader(); From 4087c1a140eb3f727c99bc5175412902c966d1c4 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 22 Oct 2021 11:27:52 +0200 Subject: [PATCH 23/40] Fix javadoc for module "metamorph" (#396) --- .../api/helpers/AbstractFunction.java | 5 +++ .../metamorph/AbstractMetamorphDomWalker.java | 7 +++++ .../org/metafacture/metamorph/Entity.java | 5 +++ .../org/metafacture/metamorph/Filter.java | 24 ++++++++++++++ .../org/metafacture/metamorph/Metamorph.java | 8 +++++ .../org/metafacture/metamorph/Splitter.java | 23 ++++++++++++++ .../metafacture/metamorph/functions/Case.java | 5 +++ .../metamorph/functions/DateFormat.java | 5 +++ .../metafacture/metamorph/functions/ISBN.java | 31 +++++++++++++++++++ .../metamorph/functions/Script.java | 5 +++ .../metamorph/functions/Timestamp.java | 5 +++ .../metamorph/functions/Unique.java | 6 ++++ .../metafacture/metamorph/maps/FileMap.java | 13 ++++++++ .../metamorph/maps/JndiSqlMap.java | 12 +++++++ .../metafacture/metamorph/maps/SqlMap.java | 3 ++ .../metafacture/metamorph/xml/DomLoader.java | 8 +++++ .../metafacture/metamorph/xml/Location.java | 12 +++++++ 17 files changed, 177 insertions(+) diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java index 8aaf1f5da..ff0140b4b 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java @@ -49,6 +49,11 @@ public final String getMapName() { return mapName; } + /** + * Gets the {@value #localMap} or a Map with the name of {@value #mapName}. + * + * @return the Map + */ public final Map getMap() { if (localMap == null) { return maps.getMap(mapName); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java index 4f884b399..e7705e9e7 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java @@ -100,6 +100,13 @@ protected final MapFactory getMapFactory() { return mapFactory; } + /** + * Walks through the metamorph definition file. Respects the metamorph + * variables. + * + * @param morphScript the InputSource of the metamorph definition file + * @param newVars the Map of Metamorph variables + */ public final void walk(final InputSource morphScript, final Map newVars) { vars.putAll(newVars); walk(morphScript); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java index 016fbe9e6..19ad1526e 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java @@ -53,6 +53,11 @@ public Entity(final Supplier receiver) { this.receiver = receiver; } + /** + * Sets the NamedValueSource the entity will act on. + * + * @param source the NamedValueSource + */ public void setNameSource(final NamedValueSource source) { nameSource = source; nameSource.setNamedValueReceiver(this); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Filter.java b/metamorph/src/main/java/org/metafacture/metamorph/Filter.java index eafb1e22f..b83e8a35e 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Filter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Filter.java @@ -45,21 +45,45 @@ public final class Filter extends DefaultStreamPipe { private final SingleValue singleValue = new SingleValue(); private final Metamorph metamorph; + /** + * Constructs a Filter by a path to the metamorph definition. + * + * @param morphDef the path to the metamorph definition + */ public Filter(final String morphDef) { metamorph = new Metamorph(morphDef); metamorph.setReceiver(singleValue); } + /** + * Constructs a Filter by a Metamorph. + * + * @param metamorph the Metamorph + */ public Filter(final Metamorph metamorph) { this.metamorph = metamorph; metamorph.setReceiver(singleValue); } + /** + * Constructs a Filter by a path to the metamorph definition and a Map of + * Metamorph variables. + * + * @param morphDef the path to the metamorph definition + * @param vars the Map of the metamorph variables + */ public Filter(final String morphDef, final Map vars) { metamorph = new Metamorph(morphDef, vars); metamorph.setReceiver(singleValue); } + /** + * Constructs a Filter by a path to the metamorph definition and an + * InterceptorFactory. + * + * @param morphDef the path to the metamorph definition + * @param interceptorFactory the InterceptorFactory + */ public Filter(final String morphDef, final InterceptorFactory interceptorFactory) { metamorph = new Metamorph(morphDef, interceptorFactory); metamorph.setReceiver(singleValue); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java b/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java index 7a6ea687c..98f788115 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java @@ -174,6 +174,14 @@ public Metamorph(final InputSource inputSource, final InterceptorFactory interce this(inputSource, NO_VARS, interceptorFactory); } + /** + * Constructs a Metamorph by setting an InputSource, a Map of variables and an + * InterceptorFactory. + * + * @param inputSource the InputSource + * @param vars the Map of variables + * @param interceptorFactory the InterceptorFactory + */ public Metamorph(final InputSource inputSource, final Map vars, final InterceptorFactory interceptorFactory) { buildPipeline(inputSource, vars, interceptorFactory); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java b/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java index 0646e38b7..5e6fd3978 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java @@ -44,16 +44,31 @@ public final class Splitter implements StreamPipe { private final Map receiverMap = new HashMap(); private final Metamorph metamorph; + /** + * Constructs a Splitter by setting a the path to a metamorph definition file. + * + * @param morphDef the name of the file of the metamorph definition + */ public Splitter(final String morphDef) { metamorph = new Metamorph(morphDef); metamorph.setReceiver(singleValue); } + /** + * Constructs a Splitter by setting a Reader of a metamorph definition. + * + * @param morphDef the Reader of the metamorph definition + */ public Splitter(final Reader morphDef) { metamorph = new Metamorph(morphDef); metamorph.setReceiver(singleValue); } + /** + * Constructs a Splitter by setting the Metamorph. + * + * @param metamorph the Metamoprh + */ public Splitter(final Metamorph metamorph) { this.metamorph = metamorph; metamorph.setReceiver(singleValue); @@ -65,6 +80,14 @@ public R setReceiver(final R receiver) { return receiver; } + /** + * Sets the receiver. + * + * @param the type of the receiver + * @param key the name of the receiver + * @param receiver the receiver + * @return the receiver + */ public R setReceiver(final String key, final R receiver) { receiverMap.put(key, receiver); return receiver; diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java index 666132e4f..0307c5248 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java @@ -58,6 +58,11 @@ public void setTo(final String string) { this.toUpper = UPPER.equals(string); } + /** + * Sets the language if it's present in {@value #SUPPORTED_LANGUAGES}. + * + * @param language the language + */ public void setLanguage(final String language) { if (!LANGUAGES.contains(language)) { throw new MorphBuildException("Language " + language + " not supported."); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java index 0d240e669..a9e18b788 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java @@ -178,6 +178,11 @@ public final void setRemoveLeadingZeros(final boolean removeLeadingZeros) { this.removeLeadingZeros = removeLeadingZeros; } + /** + * Sets the language if it's present in {@value #SUPPORTED_LANGUAGES}. + * + * @param language the language + */ public final void setLanguage(final String language) { if (!SUPPORTED_LANGUAGES.contains(language)) { throw new MorphBuildException("Language '" + language + "' not supported."); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java index 353ba1845..a81db6195 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java @@ -75,6 +75,14 @@ else if (to13 && ISBN10_SIZE == size) { return result; } + /** + * Cleanse the ISBN free of semantic sugar and uppercase a possible "x" + * character. + * + * @param isbn the ISBN + * @return the normalized ISBN or an empty string if normalization is not + * succesful + */ public static String cleanse(final String isbn) { String normValue = isbn.replace('x', 'X'); normValue = DIRT_PATTERN.matcher(normValue).replaceAll(""); @@ -85,6 +93,11 @@ public static String cleanse(final String isbn) { return ""; } + /** + * Sets the ISBN to ISBN-10 or ISBN-13. + * + * @param toString {@value #ISBN10} or {@value #ISBN13} + */ public void setTo(final String toString) { to13 = toString.equalsIgnoreCase(ISBN13); to10 = toString.equalsIgnoreCase(ISBN10); @@ -127,6 +140,12 @@ private static int charToInt(final char cha) { return (byte) cha - (byte) '0'; } + /** + * Converts a ISBN-13 to ISBN-10. + * + * @param isbn the ISBN-13 + * @return the ISBN-10 + */ public static String isbn13to10(final String isbn) { if (isbn.length() != ISBN13_SIZE) { throw new IllegalArgumentException( @@ -137,6 +156,12 @@ public static String isbn13to10(final String isbn) { return isbn10Data + check10(isbn10Data); } + /** + * Converts a ISBN-10 to ISBN-13. + * + * @param isbn the ISBN-10 + * @return the ISBN-13 + */ public static String isbn10to13(final String isbn) { if (isbn.length() != ISBN10_SIZE) { throw new IllegalArgumentException( @@ -148,6 +173,12 @@ public static String isbn10to13(final String isbn) { return isbn13Data + check13(isbn13Data); } + /** + * Checks if a ISBN is valid. + * + * @param isbn the ISBN + * @return true if it's valid and false if not + */ public static boolean isValid(final String isbn) { boolean result = false; diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java index e1110509f..9f0f243e1 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java @@ -44,6 +44,11 @@ public void setInvoke(final String invoke) { this.invoke = invoke; } + /** + * Sets the filename of a JavaScript and loads it. + * + * @param file the file + */ public void setFile(final String file) { final ScriptEngineManager manager = new ScriptEngineManager(); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java index 3c25b5f5d..9522e867a 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java @@ -89,6 +89,11 @@ public void setTimezone(final String timezone) { this.timezone = timezone; } + /** + * Sets the language if supported in {@link #SUPPORTED_LANGUAGES}. + * + * @param language the language + */ public void setLanguage(final String language) { if (!SUPPORTED_LANGUAGES.contains(language)) { throw new MorphBuildException("Language '" + language + "' not supported."); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java index 572fca9f0..0b692f89e 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java @@ -71,6 +71,12 @@ public void setIn(final String scope) { uniqueInEntity = ENTITY.equals(scope); } + /** + * Sets the Unique part to be processed. Possible values are {@value #ENTITY}, + * {@value #NAME} and {@value #VALUE}. + * + * @param part the part + */ public void setPart(final String part) { if (NAME.equals(part)) { keyGenerator = new KeyGenerator() { diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java index ff2782b8f..a8b047e3c 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java @@ -50,6 +50,12 @@ public final class FileMap extends AbstractReadOnlyMap { public FileMap() { } + /** + * Sets a comma separated list of files which are then passed to + * {@link #setFile}. + * + * @param files a comma separated list of files + */ public void setFiles(final String files) { final String[] parts = files.split("\\s*,\\s*"); for (final String part : parts) { @@ -57,6 +63,13 @@ public void setFiles(final String files) { } } + /** + * Provides a {@link Map} based on a file. The file is supposed to be UTF-8 + * encoded. The separator is by default \t. Important: Lines + * that are not split in two parts by the separator are ignored! + * + * @param file the file + */ public void setFile(final String file) { try ( InputStream stream = openStream(file); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java index 05400ad53..758954643 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java @@ -44,6 +44,13 @@ public final class JndiSqlMap extends AbstractReadOnlyMap implem public JndiSqlMap() { } + /** + * Sets the {@link DataSource}. + * + * See {@link InitialContext} + * + * @param name the name to be lookuped in the InitialContext. + */ public void setDatasource(final String name) { try { datasource = (DataSource) new InitialContext().lookup(name); @@ -53,6 +60,11 @@ public void setDatasource(final String name) { } } + /** + * Sets the query. + * + * @param query the query + */ public void setQuery(final String query) { this.query = query; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java index 8a8d53a6b..ba3f5d0f6 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java @@ -51,6 +51,9 @@ public final class SqlMap extends AbstractReadOnlyMap implements public SqlMap() { } + /** + * Initializes the prepared statement using the {@value #query}. + */ public void init() { try { preparedStatement = getMySqlConnection().prepareStatement(query); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java b/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java index 8ed4d4f5f..c09fd6cb3 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java @@ -62,6 +62,14 @@ private DomLoader() { throw new AssertionError("No instances allowed"); } + /** + * Returns a Document build from an InputSpurce and a schema file. Removes all + * ignorable whitespace and all text nodes containing only whitespace. + * + * @param schemaFile the name of the file of the schema + * @param input the InputSource + * @return the Document + */ public static Document parse(final String schemaFile, final InputSource input) { final Document document = createEmptyDocument(); final XMLReader pipeline = createXmlFilterPipeline(schemaFile, document); diff --git a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java index aaee029e6..8a59c3a7b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java @@ -50,11 +50,23 @@ public void handle(final short operation, final String key, final Object data, private final Locator elementStart; private final Locator elementEnd; + /** + * Constructs a Location from a Locator as start element and a Locator as end + * element. + * + * @param elementStart the Locator as start element + * @param elementEnd the Locator as end element + */ public Location(final Locator elementStart, final Locator elementEnd) { this.elementStart = new LocatorImpl(elementStart); this.elementEnd = new LocatorImpl(elementEnd); } + /** + * Constructs a Location from an other Location. + * + * @param src the Location + */ public Location(final Location src) { elementStart = new LocatorImpl(src.elementStart); elementEnd = new LocatorImpl(src.elementEnd); From 78639a28fd020358a17d4264009cd5bc9e8c289a Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 22 Oct 2021 11:59:15 +0200 Subject: [PATCH 24/40] Fix javadoc for module "test" (#396) --- .../metamorph/test/MetamorphTestSuite.java | 7 ++++++ .../test/reader/MultiFormatReader.java | 6 +++++ .../test/validators/StreamValidator.java | 25 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java index a7534fe5c..47a6874a4 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java @@ -40,6 +40,13 @@ public final class MetamorphTestSuite extends ParentRunner { private final List runners; + /** + * Constructs a MetamorphTestSuite by binding a list of Metamorph-Test resources + * to a class. + * + * @param suiteRoot the {@code @TestClass} + * @throws InitializationError + */ public MetamorphTestSuite(final Class suiteRoot) throws InitializationError { super(suiteRoot); diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java index 9ce4e76a1..2a2bebf4a 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java @@ -35,6 +35,12 @@ public MultiFormatReader(final String format) { setFormat(format); } + /** + * Sets the format of {@value #currentReader} if the {@value #READER_FACTORY} + * contains that format. + * + * @param format the format + */ public void setFormat(final String format) { if (!READER_FACTORY.containsKey(format)) { throw new IllegalArgumentException("Format '" + format + "' not regognized"); diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java index 49e58b731..89a59c695 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java @@ -70,6 +70,14 @@ public final class StreamValidator implements StreamReceiver { private final WellformednessChecker wellformednessChecker = new WellformednessChecker(); + /** + * Constructs a StreamValidator with a List of {@link Event}s. Validates this + * stream of events using that list of expected stream events. If the stream is + * invalid, the error handler set via {@link #setErrorHandler(Consumer)} is + * called. Checks for wellformedness and resets the stream. + * + * @param expectedStream the List of expected stream events + */ public StreamValidator(final List expectedStream) { this.eventStream = new EventNode(null, null); foldEventStream(this.eventStream, expectedStream.iterator()); @@ -100,6 +108,12 @@ public boolean isStrictRecordOrder() { return strictRecordOrder; } + /** + * Sets strict record order. + * + * @param strictRecordOrder "true" if the record order shall be strict or + * "false" otherwise + */ public void setStrictRecordOrder(final boolean strictRecordOrder) { if (validating) { throw new IllegalStateException(CANNOT_CHANGE_OPTIONS); @@ -112,6 +126,11 @@ public boolean isStrictKeyOrder() { return strictKeyOrder; } + /** + * Sets strict key order. + * + * @param strictKeyOrder "true" if key order should be strict, otherwise "false" + */ public void setStrictKeyOrder(final boolean strictKeyOrder) { if (validating) { throw new IllegalStateException(CANNOT_CHANGE_OPTIONS); @@ -124,6 +143,12 @@ public boolean isStrictValueOrder() { return strictValueOrder; } + /** + * Sets strict value order. + * + * @param strictValueOrder "true" if value order should be strict, otherwise + * "false" + */ public void setStrictValueOrder(final boolean strictValueOrder) { if (validating) { throw new IllegalStateException(CANNOT_CHANGE_OPTIONS); From 6c9bf162991ea701109884a1636094e31aeb91d1 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 22 Oct 2021 12:01:11 +0200 Subject: [PATCH 25/40] Fix javadoc error introduced with 86bfdb4c6a400d430e3de94f065564f561022473. --- .../java/org/metafacture/biblio/iso2709/RecordBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java index aa0e1246b..992505c71 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java @@ -107,7 +107,7 @@ public Charset getCharset() { * Sets the record status of the LabelBuilder. * * @param recordStatus 7 bit char record status - * @see Iso2709Constants.RECORD_STATUS_POS + * @see Iso2709Constants#RECORD_STATUS_POS * @see LabelBuilder */ public void setRecordStatus(final char recordStatus) { @@ -393,7 +393,7 @@ private void require7BitAscii(final char charCode) { * Resets the label, directory and the fields. Sets the "append state" to "id * field". * - * @see AppendState.ID_FIELD + * @see AppendState#ID_FIELD */ public void reset() { label.reset(); From 7b96367cd0b750c6198a489d2bab082525307df0 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 22 Oct 2021 14:43:21 +0200 Subject: [PATCH 26/40] Fix some more javadoc error and warnings (#396) - fix some reference errors - simplify constructor --- .../main/java/org/metafacture/commons/TimeUtil.java | 3 +-- .../main/java/org/metafacture/html/HtmlDecoder.java | 2 +- .../metafacture/triples/SortedTripleFileFacade.java | 6 +++--- .../main/java/org/metafacture/yaml/YamlDecoder.java | 11 +++-------- .../main/java/org/metafacture/yaml/YamlEncoder.java | 3 +++ .../metamorph/api/helpers/AbstractFunction.java | 2 +- .../metamorph/test/MetamorphTestSuite.java | 2 +- .../metamorph/test/reader/MultiFormatReader.java | 2 +- .../org/metafacture/metamorph/functions/Case.java | 2 +- .../metafacture/metamorph/functions/DateFormat.java | 2 +- .../java/org/metafacture/metamorph/maps/SqlMap.java | 2 +- 11 files changed, 17 insertions(+), 20 deletions(-) diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java index 30c4c2352..55b274543 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/TimeUtil.java @@ -40,8 +40,7 @@ private TimeUtil() { } /** - * Formats a duration to human readable abbrevations. See {@link TimeUtilTest} - * how to use it. + * Formats a duration to human readable abbrevations. * * @param duration a long value of the duration * @return a human readable format of the duration diff --git a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java index 151f6f286..cf90248f4 100644 --- a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java +++ b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java @@ -124,7 +124,7 @@ private boolean handleAttributeValuesAsSubfields(final StreamReceiver receiver, } /** - * Sets attribute values as subfields. If the value(s) start with an `&` they + * Sets attribute values as subfields. If the value(s) start with an `&` they * are appended to {@link #DEFAULT_ATTR_VALS_AS_SUBFIELDS}. * * @param mapString the attributes to be added as subfields diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java index 5ed357311..b1e2ca5d3 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java @@ -42,7 +42,7 @@ public final class SortedTripleFileFacade { * file. * * @param file the File to load a Triple from - * @throws IOException + * @throws IOException if Triple can't be loaded */ public SortedTripleFileFacade(final File file) throws IOException { this.file = file; @@ -66,7 +66,7 @@ private void next() throws IOException { } /** - * Closes the {@link #ObjectInputStream} and deletes the {@value #file} it if it + * Closes the {@link ObjectInputStream} and deletes the {@link #file} it if it * exists. */ public void close() { @@ -97,7 +97,7 @@ public Triple peek() { * Pops a Triple from the stack. * * @return the Triple at the top of the stack. - * @throws IOException + * @throws IOException if the Triple can't be loaded */ public Triple pop() throws IOException { final Triple nextTriple = peek(); diff --git a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java index e79828ee5..69d434de5 100644 --- a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java +++ b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java @@ -56,17 +56,12 @@ public final class YamlDecoder extends DefaultObjectPipe private final YAMLFactory yamlFactory = new YAMLFactory(); private YAMLParser yamlParser; - private String arrayMarker; - private String arrayName; - private String recordId; + private String arrayMarker = DEFAULT_ARRAY_MARKER; + private String arrayName = DEFAULT_ARRAY_NAME; + private String recordId = DEFAULT_RECORD_ID; private int recordCount; public YamlDecoder() { - setArrayMarker(DEFAULT_ARRAY_MARKER); - setArrayName(DEFAULT_ARRAY_NAME); - setRecordId(DEFAULT_RECORD_ID); - - resetRecordCount(); } public void setArrayMarker(final String arrayMarker) { diff --git a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java index 76b8f37d5..b1fef9704 100644 --- a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java +++ b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java @@ -63,6 +63,9 @@ public final class YamlEncoder extends DefaultStreamPipe> private String arrayMarker = ARRAY_MARKER; + /** + * Constructs a YamlEncoder if no IOException occurs. + */ public YamlEncoder() { try { yamlGenerator = new YAMLFactory().createGenerator(writer); diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java index ff0140b4b..44471641e 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java @@ -50,7 +50,7 @@ public final String getMapName() { } /** - * Gets the {@value #localMap} or a Map with the name of {@value #mapName}. + * Gets the {@link #localMap} or a Map with the name of {@link #mapName}. * * @return the Map */ diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java index 47a6874a4..e8b58f9e9 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/MetamorphTestSuite.java @@ -45,7 +45,7 @@ public final class MetamorphTestSuite extends ParentRunner { * to a class. * * @param suiteRoot the {@code @TestClass} - * @throws InitializationError + * @throws InitializationError if definitions couldn't be loaded */ public MetamorphTestSuite(final Class suiteRoot) throws InitializationError { diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java index 2a2bebf4a..77a2693be 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java @@ -36,7 +36,7 @@ public MultiFormatReader(final String format) { } /** - * Sets the format of {@value #currentReader} if the {@value #READER_FACTORY} + * Sets the format of {@link #currentReader} if the {@link #READER_FACTORY} * contains that format. * * @param format the format diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java index 0307c5248..d034df0d6 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java @@ -59,7 +59,7 @@ public void setTo(final String string) { } /** - * Sets the language if it's present in {@value #SUPPORTED_LANGUAGES}. + * Sets the language if it's present in {@link #LANGUAGES}. * * @param language the language */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java index a9e18b788..cce89b750 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java @@ -179,7 +179,7 @@ public final void setRemoveLeadingZeros(final boolean removeLeadingZeros) { } /** - * Sets the language if it's present in {@value #SUPPORTED_LANGUAGES}. + * Sets the language if it's present in {@link #SUPPORTED_LANGUAGES}. * * @param language the language */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java index ba3f5d0f6..8a8333575 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java @@ -52,7 +52,7 @@ public SqlMap() { } /** - * Initializes the prepared statement using the {@value #query}. + * Initializes the prepared statement using the {@link #query}. */ public void init() { try { From a3b5095a13ee5213b587a54a2c57cf7565402dd2 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Sat, 23 Oct 2021 16:11:59 +0200 Subject: [PATCH 27/40] Javadoc fixes and improvements. (#396) --- .../org/metafacture/biblio/iso2709/Label.java | 2 +- .../biblio/iso2709/RecordBuilder.java | 4 ++-- .../biblio/iso2709/RecordFormat.java | 12 ++++++------ .../biblio/marc21/Marc21Encoder.java | 1 - .../biblio/marc21/MarcXmlEncoder.java | 14 ++++++++------ .../metafacture/biblio/pica/PicaDecoder.java | 4 ++-- .../org/metafacture/commons/ResourceUtil.java | 8 ++++---- .../org/metafacture/commons/StringUtil.java | 10 +++++----- .../java/org/metafacture/commons/XmlUtil.java | 14 +++++++------- .../commons/reflection/ConfigurableClass.java | 8 ++++---- .../commons/reflection/ReflectionUtil.java | 4 ++-- .../metafacture/commons/tries/SetMatcher.java | 8 ++++---- .../commons/tries/SetReplacer.java | 3 +-- .../metafacture/commons/tries/SimpleTrie.java | 3 +-- .../commons/tries/WildcardTrie.java | 5 +++-- .../metafacture/commons/types/ListMap.java | 19 +++++++++---------- .../metafacture/commons/types/NamedValue.java | 4 ++-- .../org/metafacture/flux/HelpPrinter.java | 2 +- .../metafacture/framework/annotations/In.java | 2 +- .../framework/annotations/Out.java | 2 +- .../java/org/metafacture/io/LineReader.java | 3 +-- .../metafacture/io/ObjectJavaIoWriter.java | 4 ++-- .../java/org/metafacture/io/ObjectWriter.java | 6 +++--- .../javaintegration/NamedValueList.java | 2 +- .../javaintegration/StringMap.java | 2 +- .../org/metafacture/json/JsonEncoder.java | 4 ++-- .../monitoring/ObjectBatchLogger.java | 9 ++++----- .../monitoring/StreamBatchLogger.java | 5 ++--- .../triples/SortedTripleFileFacade.java | 6 +++--- .../metafacture/triples/TripleCollect.java | 2 +- .../metafacture/xml/GenericXmlHandler.java | 10 +++++----- .../java/org/metafacture/xml/XmlDecoder.java | 4 ++-- .../metafacture/xml/XmlElementSplitter.java | 4 ++-- .../metamorph/api/NamedValueSource.java | 2 +- .../api/helpers/AbstractFunction.java | 8 +++----- .../test/validators/StreamValidator.java | 9 +++++---- .../metamorph/AbstractMetamorphDomWalker.java | 6 +++--- .../org/metafacture/metamorph/Filter.java | 17 +++++++++-------- .../org/metafacture/metamorph/Splitter.java | 8 ++++---- .../metafacture/metamorph/functions/Case.java | 2 +- .../metamorph/functions/DateFormat.java | 2 +- .../metafacture/metamorph/functions/ISBN.java | 6 +++--- .../metamorph/functions/Script.java | 10 ++++------ .../metamorph/functions/Timestamp.java | 2 +- .../metamorph/functions/Unique.java | 4 ++-- .../metafacture/metamorph/maps/FileMap.java | 8 ++++---- .../metamorph/maps/JndiSqlMap.java | 2 +- .../metafacture/metamorph/xml/DomLoader.java | 2 +- .../metafacture/metamorph/xml/Location.java | 2 +- 49 files changed, 137 insertions(+), 143 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Label.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Label.java index 51de1fd2b..6068eee5b 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Label.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Label.java @@ -17,7 +17,7 @@ package org.metafacture.biblio.iso2709; /** - * Provides read access to the record label of a ISO 2709:2008 formatted + * Provides read access to the record label of an ISO 2709:2008 formatted * record. The record label consists of the first 24 octets of the record. *

* Use {@link LabelBuilder} if write access to the label is required. diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java index 992505c71..6380b6c25 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java @@ -311,7 +311,7 @@ public void endDataField() { /** * Appends a subfield. * - * @param value String of the to be appended subfield + * @param value String of the subfield to be appended */ public void appendSubfield(final String value) { requireInDataField(); @@ -323,7 +323,7 @@ public void appendSubfield(final String value) { * Appends a subfield in dependency of an identifier. * * @param identifier char array of an identifier - * @param value String of the to be appended subfield + * @param value String of the subfield to be appended */ public void appendSubfield(final char[] identifier, final String value) { requireInDataField(); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java index 646ed0984..8a493351f 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java @@ -56,9 +56,9 @@ public final class RecordFormat { * * @param indicatorLength the length of the indicator * @param identifierLength the length of the identifier - * @param fieldLengthLength the length of the field - * @param fieldStartLength the length of the indicator - * @param implDefinedPartLength the length of the part + * @param fieldLengthLength the length of the field length + * @param fieldStartLength the length of the field start + * @param implDefinedPartLength the length of the defined part */ public RecordFormat(final int indicatorLength, final int identifierLength, final int fieldLengthLength, final int fieldStartLength, @@ -201,9 +201,9 @@ public Builder withIdentifierLength(final int currentIdentifierLength) { } /** - * Returns a new Builder with defined field length. + * Returns a new Builder with defined field length length. * - * @param currentFieldLengthLength the length of the field + * @param currentFieldLengthLength the length of the field length * @return Builder */ public Builder withFieldLengthLength(final int currentFieldLengthLength) { @@ -229,7 +229,7 @@ public Builder withFieldStartLength(final int currentFieldStartLength) { /** * Returns a new Builder with defined part length. * - * @param currentImplDefinedPartLength the length of the part + * @param currentImplDefinedPartLength the length of the defined part * @return Builder */ public Builder withImplDefinedPartLength(final int currentImplDefinedPartLength) { diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java index 12c872162..5dc1be44a 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java @@ -82,7 +82,6 @@ public final class Marc21Encoder extends /** * Initializes the encoder with MARC 21 constants and charset. - * */ public Marc21Encoder() { builder = new RecordBuilder(Marc21Constants.MARC21_FORMAT); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index f0937647e..55ddeb3df 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -236,17 +236,19 @@ private void writeFooter() { writeRaw(ROOT_CLOSE); } - /** Writes a unescaped sequence - * @param str - * the unescaped sequence to be written + /** + * Writes an unescaped sequence. + * + * @param str the unescaped sequence to be written */ private void writeRaw(final String str) { builder.append(str); } - /** Writes a escaped sequence - * @param str - * the unescaped sequence to be written + /** + * Writes an escaped sequence. + * + * @param str the unescaped sequence to be written */ private void writeEscaped(final String str) { builder.append(XmlUtil.escape(str, false)); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java index a94af6020..b5b0748d5 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java @@ -219,7 +219,7 @@ public boolean getIgnoreMissingIdn() { } /** - * Controls whether decomposed unicode characters in field values are + * Controls whether decomposed Unicode characters in field values are * normalised to their precomposed version. By default no normalisation is * applied. The normalisation is only applied to values not to field or * subfield names. @@ -229,7 +229,7 @@ public boolean getIgnoreMissingIdn() { *

* Default value: {@code false} * - * @param normalizeUTF8 if true, decomposed unicode characters in values are + * @param normalizeUTF8 if true, decomposed Unicode characters in values are * normalised to their precomposed version. */ public void setNormalizeUTF8(final boolean normalizeUTF8) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java index fe8b307fb..11ef87b4b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java @@ -164,7 +164,7 @@ public static Properties loadProperties(final InputStream stream) } /** - * Loads properties from an URL. + * Loads properties from a URL. * * @param url properties as URL * @return Properties @@ -177,7 +177,7 @@ public static Properties loadProperties(final URL url) throws IOException { /** * Loads a text file. * - * @param location filename + * @param location the filename * @return the content of the file * @throws IOException */ @@ -198,8 +198,8 @@ public static String loadTextFile(final String location) throws IOException { * * Loads a text file. * * @param location the filename - * @param list a List of Strings - * @return a List of Strings of the content of the filename, line-by-line + * @param list a List of Strings to append the lines of the file to + * @return the List of Strings with the lines of the file appended * @throws IOException */ public static List loadTextFile(final String location, diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java index 4d08daafe..6d5b2483b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java @@ -35,12 +35,12 @@ private StringUtil() { } /** - * Sets a fallback of an Object if the the Object is null. + * Returns a fallback of an object if the object is null. * - * @param a class - * @param value the Object - * @param fallbackValue the default Object - * @return an Object + * @param the type of the object + * @param value the object + * @param fallbackValue the default object + * @return an object */ public static O fallback(final O value, final O fallbackValue) { if (value == null) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java index 224969f9a..92af10965 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java @@ -53,7 +53,7 @@ public static String nodeToString(final Node node) { * Converts a Node to a String, with or without an XML declaration * * @param node the Node - * @param omitXMLDecl boolean if an XML declaration is ommited or not + * @param omitXMLDecl boolean if an XML declaration is omitted or not * @return a String representation of the Node */ public static String nodeToString(final Node node, @@ -90,7 +90,7 @@ public static String nodeToString(final Node node, * Converts a NodeList to a String. * * @param nodes the NodeList - * @return a String representation od the NodeList + * @return a String representation of the NodeList */ public static String nodeListToString(final NodeList nodes) { final StringBuilder builder = new StringBuilder(); @@ -103,10 +103,10 @@ public static String nodeListToString(final NodeList nodes) { } /** - * Checks if a String is an Xml Mime Type. + * Checks if a String is an XML MIME type. * - * @param mimeType the Mime Type - * @return boolean if a String is an Xml Mime Type + * @param mimeType the MIME type + * @return boolean if a String is an XML MIME type */ public static boolean isXmlMimeType(final String mimeType) { if (mimeType == null) { @@ -123,10 +123,10 @@ public static String escape(final String unescaped) { /** * Escapes XML special characters. May also escape non-ASCII characters (aka - * unicode). + * Unicode). * * @param unescaped the String to be unescaped - * @param escapeUnicode boolean if unicode should be also escaped + * @param escapeUnicode boolean if Unicode should be also escaped * @return the escaped String */ public static String escape(final String unescaped, final boolean escapeUnicode) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java index c27390694..74825cd5b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java @@ -55,9 +55,9 @@ public Class getPlainClass() { } /** - * Gets all "public set" methods of this class. + * Gets all public "set" methods of this class. * - * @return the Map of all setter methods of this class + * @return the Map of the setter methods of this class */ public Map getSetters() { if (settersCache == null) { @@ -88,9 +88,9 @@ private boolean isSetter(final Method method) { } /** - * Gets the class types of the setter methods. + * Gets the parameter types of the setter methods. * - * @return a Map of the setter methods name and their types + * @return a Map of the setter method names and their types */ public Map> getSetterTypes() { final Map> setterTypes = new HashMap<>(); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java index b21a460a2..798e0523b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java @@ -45,12 +45,12 @@ public static ConfigurableClass loadClass(final String classNam } /** - * Wraps a Class to a ConfigurableClass. + * Wraps a Class in a ConfigurableClass. * * @param the object type of the ConfigurableClass * @param loader the ClassLoader * @param className the name of the class - * @param baseType the object typed class to be wrapped + * @param baseType the object type of the class to be wrapped * @return the ConfigurableClass */ public static ConfigurableClass loadClass(final ClassLoader loader, final String className, final Class baseType) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java index 9da4cd870..dcbeffe6c 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java @@ -37,7 +37,7 @@ public SetMatcher() { } /** - * Puts a value to a key. + * Adds a value for a key. * * @param key the key * @param value the value @@ -147,10 +147,10 @@ private void prepare() { } /** - * Prints dot description of the automaton to out for visualization in - * GraphViz. Used for debugging and education. + * Prints dot description of the automaton to the PrintStream for + * visualization in GraphViz. Used for debugging and education. * - * @param out the stream t which the description is written + * @param out the stream to which the description is written */ public void printAutomaton(final PrintStream out) { out.println("digraph ahocorasick {"); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java index 78f7e1ef3..b72ff2656 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java @@ -28,7 +28,6 @@ * Replaces Strings by other Strings. * * @author Markus Michael Geipel - * */ public final class SetReplacer { private final SetMatcher matcher = new SetMatcher(); @@ -37,7 +36,7 @@ public SetReplacer() { } /** - * Adds a replacement of a String by an other String. + * Adds a replacement of a String by another String. * * @param toReplace String to replace * @param replacement String of replacement diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java index 94ac10fb9..01acdbc9d 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java @@ -29,13 +29,12 @@ public SimpleTrie() { } /** - * Puts a value to the key. + * Adds a value for the key. * * @param key the name of the key * @param value the value */ public void put(final String key, final P value) { - Node

node = root; Node

next; final int length = key.length(); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java index 88627fb1b..52d66a990 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java @@ -32,6 +32,7 @@ * @author Pascal Christoph */ public final class WildcardTrie

{ + public static final char STAR_WILDCARD = '*'; public static final char Q_WILDCARD = '?'; public static final String OR_STRING = "|"; @@ -50,7 +51,7 @@ public WildcardTrie() { * (1,1) to express wildcards. * * @param keys pattern of keys to register - * @param value value to associate with the key pattern. + * @param value value to associate with the key pattern */ public void put(final String keys, final P value) { if (keys.contains(OR_STRING)) { @@ -65,7 +66,6 @@ public void put(final String keys, final P value) { } private void simplyPut(final String key, final P value) { - final int length = key.length(); Node

node = root; @@ -174,4 +174,5 @@ public Node getNext(final char key) { return links.get(key); } } + } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java index 2a8d6f67a..e46825dcd 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java @@ -29,10 +29,8 @@ * * @author Markus Michael Geipel * - * @param - * key - * @param - * value + * @param key + * @param value */ public class ListMap implements Map> { @@ -58,7 +56,7 @@ public final void clear() { } /** - * Removes a key of the map. + * Removes a key from the map. * * @param key the key * @return the List of values or null if the map didn't contain the key @@ -68,7 +66,7 @@ public final List removeKey(final K key) { } /** - * Clears all values of a key of the map. + * Clears all values of a key in the map. * * @param key the key of the map */ @@ -80,7 +78,7 @@ public final void clearKey(final K key) { } /** - * Clears all values of all keys of the map. + * Clears all values of all keys in the map. */ public final void clearAllKeys() { for (final Entry> entry: map.entrySet()) { @@ -99,7 +97,7 @@ public final Set keySet() { } /** - * Adds a value to the List of values of the key of the map. + * Adds a value to the List of values of the key in the map. * * @param name the key * @param value the value @@ -127,7 +125,7 @@ public final boolean existsKey(final K name) { } /** - * Gets the first element of the List of values of the key of the map. + * Gets the first element of the List of values of the key in the map. * * @param name the key * @return first element of the values of the key @@ -184,7 +182,7 @@ public final List remove(final Object key) { } /** - * Adds a List of values to a key of the map. + * Adds a List of values to a key in the map. * * @param name the key * @param addValues the List of values @@ -208,4 +206,5 @@ public final void putAll(final Map> putMap) { public final Collection> values() { return map.values(); } + } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java index 23e981bda..f308e85c0 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/NamedValue.java @@ -17,7 +17,7 @@ package org.metafacture.commons.types; /** - * Stores an immutable name-value-pair. The hash code is + * Stores an immutable name-value pair. The hash code is * precomputed during instantiation. * * @author Markus Michael Geipel @@ -31,7 +31,7 @@ public final class NamedValue implements Comparable { private final int preCompHashCode; /** - * Constructs an immutable name-value-pair by computing a hash code. + * Constructs an immutable name-value pair by computing a hash code. * * @param name the name of the pair * @param value the value of the pair diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java b/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java index d3375bf85..8ed027aba 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/HelpPrinter.java @@ -48,7 +48,7 @@ private HelpPrinter() { /** * Prints Flux help for a given ObjectFactory. Excerpts setters and their - * arguments, @in annotations and @out annotations. + * arguments, {@code @in} annotations and {@code @out} annotations. * * @param factory the ObjectFactory * @param out the PrintStream to print to diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java index ff97549c1..aa04d4203 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/In.java @@ -32,7 +32,7 @@ @Target(ElementType.TYPE) public @interface In { /** - * Returns the class used as input to when using the class in a pipe. + * Returns the class expected as input when using the class in a pipe. * * @return the Class */ diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java index a46c24bfb..d9eecc70f 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/annotations/Out.java @@ -32,7 +32,7 @@ @Target(ElementType.TYPE) public @interface Out { /** - * Returns the class used as output when using this class in a pipe. + * Returns the class produced as output when using this class in a pipe. * * @return the Class */ diff --git a/metafacture-io/src/main/java/org/metafacture/io/LineReader.java b/metafacture-io/src/main/java/org/metafacture/io/LineReader.java index 351fda8ed..5f76c4468 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/LineReader.java +++ b/metafacture-io/src/main/java/org/metafacture/io/LineReader.java @@ -53,8 +53,7 @@ public void process(final Reader reader) { } /** - * Processes input from a reader line by line and pass them line by line to a - * receiver. + * Processes input from a reader and passes it line by line to a receiver. * * @param reader the Reader * @param receiver the ObjectReceiver diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java index 273fbb969..08659fd04 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectJavaIoWriter.java @@ -23,8 +23,7 @@ import java.io.Writer; /** - * @param - * object type + * @param object type * * @author Christoph Böhme, Markus Geipel * @deprecated Use {@link ObjectWriter} or {@link ObjectFileWriter} instead. @@ -38,6 +37,7 @@ public final class ObjectJavaIoWriter implements ObjectReceiver { /** * Deprecated. + * * @param writer the Writer */ public ObjectJavaIoWriter(final Writer writer) { diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java index ac28edb5b..34268166c 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java @@ -46,9 +46,9 @@ public final class ObjectWriter implements ConfigurableObjectWriter { private final ConfigurableObjectWriter objectWriter; /** - * Sets the destination to write objects to. If destination is set to - * {@value #STDOUT} the object is written to standard out. Else it's written to - * a file. + * Sets the destination to write objects to. If the destination is set to + * {@value #STDOUT} the object is written to the standard output. Otherwise + * it's written to a file of that name. * * @param destination the path to be written to or standard out if it's * {@value #STDOUT} diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java index 39298faf3..185439e78 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java @@ -34,7 +34,7 @@ public final class NamedValueList extends DefaultStreamReceiver implements List, Collector> { private Collection> collection; - private List list = new ArrayList(); + private List list = new ArrayList<>(); public NamedValueList() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java index 1e552792c..e51557cce 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java @@ -33,7 +33,7 @@ public final class StringMap extends DefaultStreamReceiver implements Map> collection; - private Map map = new HashMap(); + private Map map = new HashMap<>(); public StringMap() { } diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java index 6a7a7f1a9..8947662e5 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java @@ -63,8 +63,8 @@ public final class JsonEncoder extends DefaultStreamPipe> private String arrayMarker = ARRAY_MARKER; /** - * Default constructor initializes the JsonGenerator. The root value separator - * of the JsonGenerator is set to null. + * Constructs a JsonEncoder if no IOException occurs. The root value + * separator of the JsonGenerator is set to null. */ public JsonEncoder() { try { diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java index 481a93260..65d94c16e 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java @@ -62,7 +62,7 @@ public final class ObjectBatchLogger extends DefaultObjectPipe vars) { this.format = format; diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java index 1980368b4..8997fd863 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java @@ -71,10 +71,9 @@ public StreamBatchLogger(final String format) { } /** - * Constructs a StreamBatchLogger with a not changeable format and a map of - * variables. + * Constructs a StreamBatchLogger with a format and a map of variables. * - * @param format a not changeable format + * @param format a format * @param vars a map of variables */ public StreamBatchLogger(final String format, final Map vars) { diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java index b1e2ca5d3..1d8c9c750 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java @@ -41,7 +41,7 @@ public final class SortedTripleFileFacade { * Constructs a SortedTripleFileFacade with a file. Reads a Triple from the * file. * - * @param file the File to load a Triple from + * @param file the File to load Triples from * @throws IOException if Triple can't be loaded */ public SortedTripleFileFacade(final File file) throws IOException { @@ -66,7 +66,7 @@ private void next() throws IOException { } /** - * Closes the {@link ObjectInputStream} and deletes the {@link #file} it if it + * Closes the {@link ObjectInputStream} and deletes the {@link #file} if it * exists. */ public void close() { @@ -84,7 +84,7 @@ public void close() { /** * Peeks at a Triple at the top of the stack. * - * @return the Triple on top of the stack + * @return the Triple at the top of the stack */ public Triple peek() { if (isEmpty()) { diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java b/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java index a5c25df1a..c4caf8315 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/TripleCollect.java @@ -68,7 +68,7 @@ public void process(final Triple triple) { } /** - * Decodes a Triple. Passes the Predicate and the Object to the receiver. + * Decodes a Triple. Passes the predicate and the object to the receiver. * * @param triple the Triple */ diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java index e529cde2b..db2b86740 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java @@ -44,7 +44,7 @@ public final class GenericXmlHandler extends DefaultXmlPipe { private static final Pattern TABS = Pattern.compile("\t+"); - private static final String METAMORPH_RECORD_TAG = "org.culturegraph.metamorph.xml.recordtag"; + private static final String RECORD_TAG_PROPERTY = "org.culturegraph.metamorph.xml.recordtag"; private String attributeMarker = DEFAULT_ATTRIBUTE_MARKER; private String recordTagName = DEFAULT_RECORD_TAG; @@ -56,11 +56,11 @@ public final class GenericXmlHandler extends DefaultXmlPipe { private boolean emitNamespace = EMIT_NAMESPACE; /** - * Constructs a GenericXmlHandler by loading the system property - * {@value #METAMORPH_RECORD_TAG} if that system property was set. + * Constructs a GenericXmlHandler. Sets the record tag name to the value of + * the system property {@value #RECORD_TAG_PROPERTY} if it's present. */ public GenericXmlHandler() { - final String recordTagNameProperty = System.getProperty(METAMORPH_RECORD_TAG); + final String recordTagNameProperty = System.getProperty(RECORD_TAG_PROPERTY); if (recordTagNameProperty != null) { recordTagName = recordTagNameProperty; } @@ -70,7 +70,7 @@ public GenericXmlHandler() { * Creates a new {@code GenericXmlReader} with the given tag name as * marker for records. * - * @deprecated Use default constructor and set the tag name latter + * @deprecated Use default constructor and set the tag name later * with {@link #setRecordTagName(String)}. * * @param recordTagName tag name marking the start of a record. diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java index 199fc4ddb..ff0dac5e3 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/XmlDecoder.java @@ -51,8 +51,8 @@ public final class XmlDecoder extends DefaultObjectPipe { private final XMLReader saxReader; /** - * Constructs an XmlDecoder by obtaining a new instance of a {@link - * org.xml.sax.XMLReader}. + * Constructs an XmlDecoder by obtaining a new instance of an + * {@link org.xml.sax.XMLReader}. */ public XmlDecoder() { try { diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java index c65e334c0..723244924 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java @@ -83,8 +83,8 @@ public void setElementName(final String name) { /** * Sets the top-level XML document element. * - * @param newRoot the top level element. Don't set it to omit setting top level - * element. + * @param newRoot the top level element. Leave at default to omit the + * top-level element. */ public void setTopLevelElement(final String newRoot) { root = newRoot; diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueSource.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueSource.java index 2ed03aab0..511a47cff 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueSource.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueSource.java @@ -17,7 +17,7 @@ package org.metafacture.metamorph.api; /** - * Base interface for all classes in Metamorph which emit name-value-pairs. + * Base interface for all classes in Metamorph which emit name-value pairs. * * @author Markus Michael Geipel * @author Christoph Böhme diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java index 44471641e..74a65fbf4 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java @@ -50,15 +50,13 @@ public final String getMapName() { } /** - * Gets the {@link #localMap} or a Map with the name of {@link #mapName}. + * Gets the {@link #localMap} or, if unset, a Map with the name of {@link + * #mapName}. * * @return the Map */ public final Map getMap() { - if (localMap == null) { - return maps.getMap(mapName); - } - return localMap; + return localMap != null ? localMap : maps.getMap(mapName); } public final void setMap(final String newMapName) { diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java index 89a59c695..59806e772 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java @@ -111,7 +111,7 @@ public boolean isStrictRecordOrder() { /** * Sets strict record order. * - * @param strictRecordOrder "true" if the record order shall be strict or + * @param strictRecordOrder "true" if the record order should be strict, or * "false" otherwise */ public void setStrictRecordOrder(final boolean strictRecordOrder) { @@ -129,7 +129,8 @@ public boolean isStrictKeyOrder() { /** * Sets strict key order. * - * @param strictKeyOrder "true" if key order should be strict, otherwise "false" + * @param strictKeyOrder "true" if key order should be strict, or + * "false" otherwise */ public void setStrictKeyOrder(final boolean strictKeyOrder) { if (validating) { @@ -146,8 +147,8 @@ public boolean isStrictValueOrder() { /** * Sets strict value order. * - * @param strictValueOrder "true" if value order should be strict, otherwise - * "false" + * @param strictValueOrder "true" if value order should be strict, or + * "false" otherwise */ public void setStrictValueOrder(final boolean strictValueOrder) { if (validating) { diff --git a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java index e7705e9e7..e5babfebf 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java @@ -31,7 +31,7 @@ import java.util.Map; /** - * Builds a {@link Metamorph} from an xml description + * Builds a {@link Metamorph} from an XML description * * @author Markus Michael Geipel */ @@ -101,10 +101,10 @@ protected final MapFactory getMapFactory() { } /** - * Walks through the metamorph definition file. Respects the metamorph + * Walks through the Metamorph definition file. Respects the Metamorph * variables. * - * @param morphScript the InputSource of the metamorph definition file + * @param morphScript the InputSource of the Metamorph definition file * @param newVars the Map of Metamorph variables */ public final void walk(final InputSource morphScript, final Map newVars) { diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Filter.java b/metamorph/src/main/java/org/metafacture/metamorph/Filter.java index b83e8a35e..06d409241 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Filter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Filter.java @@ -46,9 +46,9 @@ public final class Filter extends DefaultStreamPipe { private final Metamorph metamorph; /** - * Constructs a Filter by a path to the metamorph definition. + * Constructs a Filter from the path to a Metamorph definition. * - * @param morphDef the path to the metamorph definition + * @param morphDef the path to the Metamorph definition */ public Filter(final String morphDef) { metamorph = new Metamorph(morphDef); @@ -56,7 +56,7 @@ public Filter(final String morphDef) { } /** - * Constructs a Filter by a Metamorph. + * Constructs a Filter from a Metamorph. * * @param metamorph the Metamorph */ @@ -66,11 +66,11 @@ public Filter(final Metamorph metamorph) { } /** - * Constructs a Filter by a path to the metamorph definition and a Map of + * Constructs a Filter from the path to a Metamorph definition and a Map of * Metamorph variables. * - * @param morphDef the path to the metamorph definition - * @param vars the Map of the metamorph variables + * @param morphDef the path to the Metamorph definition + * @param vars the Map of the Metamorph variables */ public Filter(final String morphDef, final Map vars) { metamorph = new Metamorph(morphDef, vars); @@ -78,10 +78,10 @@ public Filter(final String morphDef, final Map vars) { } /** - * Constructs a Filter by a path to the metamorph definition and an + * Constructs a Filter from the path to a Metamorph definition and an * InterceptorFactory. * - * @param morphDef the path to the metamorph definition + * @param morphDef the path to the Metamorph definition * @param interceptorFactory the InterceptorFactory */ public Filter(final String morphDef, final InterceptorFactory interceptorFactory) { @@ -144,4 +144,5 @@ protected void onCloseStream() { buffer.clear(); metamorph.closeStream(); } + } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java b/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java index 5e6fd3978..4d3eeb383 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Splitter.java @@ -45,9 +45,9 @@ public final class Splitter implements StreamPipe { private final Metamorph metamorph; /** - * Constructs a Splitter by setting a the path to a metamorph definition file. + * Constructs a Splitter from the path to a Metamorph definition file. * - * @param morphDef the name of the file of the metamorph definition + * @param morphDef the name of the file of the Metamorph definition */ public Splitter(final String morphDef) { metamorph = new Metamorph(morphDef); @@ -55,7 +55,7 @@ public Splitter(final String morphDef) { } /** - * Constructs a Splitter by setting a Reader of a metamorph definition. + * Constructs a Splitter from the Reader of a Metamorph definition. * * @param morphDef the Reader of the metamorph definition */ @@ -65,7 +65,7 @@ public Splitter(final Reader morphDef) { } /** - * Constructs a Splitter by setting the Metamorph. + * Constructs a Splitter from the Metamorph. * * @param metamorph the Metamoprh */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java index d034df0d6..262fcc93f 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java @@ -59,7 +59,7 @@ public void setTo(final String string) { } /** - * Sets the language if it's present in {@link #LANGUAGES}. + * Sets the language if it's included in {@link #LANGUAGES}. * * @param language the language */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java index cce89b750..48984bbd8 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java @@ -179,7 +179,7 @@ public final void setRemoveLeadingZeros(final boolean removeLeadingZeros) { } /** - * Sets the language if it's present in {@link #SUPPORTED_LANGUAGES}. + * Sets the language if it's included in {@link #SUPPORTED_LANGUAGES}. * * @param language the language */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java index a81db6195..eb6ac51f2 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java @@ -141,7 +141,7 @@ private static int charToInt(final char cha) { } /** - * Converts a ISBN-13 to ISBN-10. + * Converts an ISBN-13 to ISBN-10. * * @param isbn the ISBN-13 * @return the ISBN-10 @@ -157,7 +157,7 @@ public static String isbn13to10(final String isbn) { } /** - * Converts a ISBN-10 to ISBN-13. + * Converts an ISBN-10 to ISBN-13. * * @param isbn the ISBN-10 * @return the ISBN-13 @@ -174,7 +174,7 @@ public static String isbn10to13(final String isbn) { } /** - * Checks if a ISBN is valid. + * Checks if an ISBN is valid. * * @param isbn the ISBN * @return true if it's valid and false if not diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java index 9f0f243e1..bc685aa8d 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java @@ -28,7 +28,7 @@ import javax.script.ScriptException; /** - * A function which executes a javascript function. + * A function which executes a JavaScript function. * * @author Markus Michael Geipel */ @@ -45,12 +45,11 @@ public void setInvoke(final String invoke) { } /** - * Sets the filename of a JavaScript and loads it. + * Loads a JavaScript file. * - * @param file the file + * @param file the filename */ public void setFile(final String file) { - final ScriptEngineManager manager = new ScriptEngineManager(); final ScriptEngine engine = manager.getEngineByName("JavaScript"); try { @@ -61,8 +60,7 @@ public void setFile(final String file) { throw new MorphBuildException("Error in script", e); } catch (final FileNotFoundException e) { - throw new MorphBuildException("Error loading script '" + file + "'", - e); + throw new MorphBuildException("Error loading script '" + file + "'", e); } invocable = (Invocable) engine; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java index 9522e867a..4ce633415 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java @@ -90,7 +90,7 @@ public void setTimezone(final String timezone) { } /** - * Sets the language if supported in {@link #SUPPORTED_LANGUAGES}. + * Sets the language if it's included in {@link #SUPPORTED_LANGUAGES}. * * @param language the language */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java index 0b692f89e..033df9e62 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java @@ -72,8 +72,8 @@ public void setIn(final String scope) { } /** - * Sets the Unique part to be processed. Possible values are {@value #ENTITY}, - * {@value #NAME} and {@value #VALUE}. + * Sets the Unique part to be processed. Possible values are {@value #NAME} + * or {@value #VALUE}. * * @param part the part */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java index a8b047e3c..bf4dd8c8b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java @@ -36,8 +36,8 @@ /** * Provides a {@link Map} based on a file. The file is supposed to be UTF-8 - * encoded. The separator is by default \t. Important: Lines - * that are not split in two parts by the separator are ignored! + * encoded. The default separator is {@code \t}. Important: + * Lines that are not split in two parts by the separator are ignored! * * @author Markus Michael Geipel */ @@ -65,8 +65,8 @@ public void setFiles(final String files) { /** * Provides a {@link Map} based on a file. The file is supposed to be UTF-8 - * encoded. The separator is by default \t. Important: Lines - * that are not split in two parts by the separator are ignored! + * encoded. The default separator is {@code \t}. Important: + * Lines that are not split in two parts by the separator are ignored! * * @param file the file */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java index 758954643..abc83052d 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java @@ -49,7 +49,7 @@ public JndiSqlMap() { * * See {@link InitialContext} * - * @param name the name to be lookuped in the InitialContext. + * @param name the name to be looked up in the InitialContext. */ public void setDatasource(final String name) { try { diff --git a/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java b/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java index c09fd6cb3..e3a48242a 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/xml/DomLoader.java @@ -63,7 +63,7 @@ private DomLoader() { } /** - * Returns a Document build from an InputSpurce and a schema file. Removes all + * Returns a Document built from an InputSpurce and a schema file. Removes all * ignorable whitespace and all text nodes containing only whitespace. * * @param schemaFile the name of the file of the schema diff --git a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java index 8a59c3a7b..5b39b57a6 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java @@ -63,7 +63,7 @@ public Location(final Locator elementStart, final Locator elementEnd) { } /** - * Constructs a Location from an other Location. + * Constructs a Location from another Location. * * @param src the Location */ From ba79941308a3a7e95f2b4c4b56b36ecc0b29c189 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Sat, 23 Oct 2021 16:22:04 +0200 Subject: [PATCH 28/40] Fix Javadoc tag. (#396) metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java:103: warning - @code}. If an empty value is + * given, the XML declaration is skipped. * - * @param xmlDeclaration the xml declaration. Default is - * '{@code}'. - * If empty value is given, the xml declaration is - * skipped. + * @param xmlDeclaration the XML declaration */ public void setXmlDeclaration(final String xmlDeclaration) { this.xmlDeclaration = xmlDeclaration; From 39bd9e072116ab23f61f8cfbbd6737e2daea8ba5 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Sat, 23 Oct 2021 16:54:40 +0200 Subject: [PATCH 29/40] Fix Javadoc references. (#396) metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#CATALOGING_FORM_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#CATALOGING_FORM_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#CHARACTER_CODING_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#CHARACTER_CODING_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#CHARACTER_CODING_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#ENCODING_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#ENCODING_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#LEADER_ENTITY (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#LEADER_ENTITY (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#MULTIPART_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#MULTIPART_LEVEL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#RECORD_STATUS_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#RECORD_STATUS_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#RECORD_TYPE_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#RECORD_TYPE_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#TYPE_OF_CONTROL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java:138: warning - Marc21EventNames#TYPE_OF_CONTROL_LITERAL (referenced by @value tag) is an unknown reference. metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java:81: warning - StandardEventNames#ID (referenced by @value tag) is an unknown reference. metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java:101: warning - StandardEventNames#ID (referenced by @value tag) is an unknown reference. --- .../biblio/marc21/Marc21Decoder.java | 54 ++++++++++--------- .../javaintegration/MapToStream.java | 9 ++-- .../metafacture/mangling/RecordIdChanger.java | 31 +++++------ 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java index 29080313c..b17813905 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java @@ -41,8 +41,9 @@ *

  • data fields. * * This decoder only supports MARC 21 records with UTF-8 encoding. Other - * character coding schemes are not supported. A {@link FormatException} is - * thrown if a record with an unsupported coding scheme is encountered. + * character coding schemes are not supported. A + * {@link org.metafacture.framework.FormatException} is thrown if a record + * with an unsupported coding scheme is encountered. *

    * The bibliographic information in the record leader is *

      @@ -56,18 +57,18 @@ *
    • multipart resource record level. *
    * This information is emitted as an entity named - * "{@value Marc21EventNames#LEADER_ENTITY}". It is emitted directly - * after the start-record event. The entity contains the following - * literals: + * {@value org.metafacture.biblio.marc21.Marc21EventNames#LEADER_ENTITY}. It is + * emitted directly after the start-record event. The entity contains + * the following literals: *
      - *
    1. {@value Marc21EventNames#RECORD_STATUS_LITERAL} - *
    2. {@value Marc21EventNames#RECORD_TYPE_LITERAL} - *
    3. {@value Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL} - *
    4. {@value Marc21EventNames#TYPE_OF_CONTROL_LITERAL} - *
    5. {@value Marc21EventNames#CHARACTER_CODING_LITERAL} - *
    6. {@value Marc21EventNames#ENCODING_LEVEL_LITERAL} - *
    7. {@value Marc21EventNames#CATALOGING_FORM_LITERAL} - *
    8. {@value Marc21EventNames#MULTIPART_LEVEL_LITERAL} + *
    9. {@value org.metafacture.biblio.marc21.Marc21EventNames#RECORD_STATUS_LITERAL} + *
    10. {@value org.metafacture.biblio.marc21.Marc21EventNames#RECORD_TYPE_LITERAL} + *
    11. {@value org.metafacture.biblio.marc21.Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL} + *
    12. {@value org.metafacture.biblio.marc21.Marc21EventNames#TYPE_OF_CONTROL_LITERAL} + *
    13. {@value org.metafacture.biblio.marc21.Marc21EventNames#CHARACTER_CODING_LITERAL} + *
    14. {@value org.metafacture.biblio.marc21.Marc21EventNames#ENCODING_LEVEL_LITERAL} + *
    15. {@value org.metafacture.biblio.marc21.Marc21EventNames#CATALOGING_FORM_LITERAL} + *
    16. {@value org.metafacture.biblio.marc21.Marc21EventNames#MULTIPART_LEVEL_LITERAL} *
    * The literals are emitted in the order in which they are listed here. The * values of these literals are the characters at the corresponding @@ -75,9 +76,9 @@ * MARC 21 * Standard: Record Leader for a description of the allowed values). The * literal values are always only single characters. As this decoder only - * supports MARC 21 records with UTF-8 encoding, the value of the literal - * "{@value Marc21EventNames#CHARACTER_CODING_LITERAL}" will - * always be "a". + * supports MARC 21 records with UTF-8 encoding, the value of the literal + * {@value org.metafacture.biblio.marc21.Marc21EventNames#CHARACTER_CODING_LITERAL} + * will always be "a". *

    * For example, given a record with the leader *

    @@ -86,15 +87,15 @@
      * the following event stream will be emitted:
      * 
      * start-record "1"
    - * start-entity "{@value Marc21EventNames#LEADER_ENTITY}"
    - * literal "{@value Marc21EventNames#RECORD_STATUS_LITERAL}": n
    - * literal "{@value Marc21EventNames#RECORD_TYPE_LITERAL}": o
    - * literal "{@value Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL}": a
    - * literal "{@value Marc21EventNames#TYPE_OF_CONTROL_LITERAL}": " "
    - * literal "{@value Marc21EventNames#CHARACTER_CODING_LITERAL}": a
    - * literal "{@value Marc21EventNames#ENCODING_LEVEL_LITERAL}": z
    - * literal "{@value Marc21EventNames#CATALOGING_FORM_LITERAL}": u
    - * literal "{@value Marc21EventNames#MULTIPART_LEVEL_LITERAL}": " "
    + * start-entity {@value org.metafacture.biblio.marc21.Marc21EventNames#LEADER_ENTITY}
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#RECORD_STATUS_LITERAL}: n
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#RECORD_TYPE_LITERAL}: o
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#BIBLIOGRAPHIC_LEVEL_LITERAL}: a
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#TYPE_OF_CONTROL_LITERAL}: " "
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#CHARACTER_CODING_LITERAL}: a
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#ENCODING_LEVEL_LITERAL}: z
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#CATALOGING_FORM_LITERAL}: u
    + * literal {@value org.metafacture.biblio.marc21.Marc21EventNames#MULTIPART_LEVEL_LITERAL}: " "
      * end-entity
      * …
      * 
    @@ -124,7 +125,8 @@ * If the decoder receives an empty input string it is ignored and no stream * events are emitted. *

    - * If an error occurs during decoding, a {@link FormatException} is thrown. + * If an error occurs during decoding, a + * {@link org.metafacture.framework.FormatException} is thrown. * * @author Christoph Böhme * @see "ISO 2709:2008 Standard" diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java index a53936486..b5f653b91 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java @@ -31,7 +31,7 @@ * event is emitted. *

    * If the map contains an entry whose key value matches the one set as - * {@link #setIdKey(Object)}, this entry's value is used as the record id. + * {@link #setIdKey(Object)}, this entry's value is used as the record ID. *

    * The keys and values in the map can be of any type. They will be converted to * strings using their {@link Object#toString()} method. Neither key nor value @@ -68,14 +68,15 @@ public MapToStream() { } /** - * Sets the key of the map entry that is used for the record id. + * Sets the key of the map entry that is used for the record ID. *

    - * The default id key is "{@value StandardEventNames#ID}". + * The default ID key is + * {@value org.metafacture.framework.StandardEventNames#ID}. *

    * This parameter can be changed anytime during processing. The new value * becomes effective with the next record being processed. * - * @param idKey the id key. The object passed here is used in a call to + * @param idKey the ID key. The object passed here is used in a call to * {@link Map#get(Object)} to get the identifier value. */ public void setIdKey(final Object idKey) { diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java index 6513784f7..77af241ef 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java @@ -26,13 +26,13 @@ import org.metafacture.framework.helpers.DefaultStreamPipe; /** - * Replaces the record id with the value of a literal from the record. The name + * Replaces the record ID with the value of a literal from the record. The name * of the literal can be configured using {@link #setIdLiteral(String)}. *

    * If a record contains multiple matching literals, the value of the last - * literal is used as id. + * literal is used as ID. *

    - * This module can optionally remove records which do not have an id literal + * This module can optionally remove records which do not have an ID literal * from the stream. This is configured through the * {@link #setKeepRecordsWithoutIdLiteral(boolean)} parameter. *

    @@ -57,14 +57,14 @@ * end-record * }

    * - * By default, the id literals are removed from the record. This can be changed + * By default, the ID literals are removed from the record. This can be changed * through {@link #setKeepIdLiteral(boolean)}. * * @author Markus Michael Geipel * @author Christoph Böhme * */ -@Description("By default changes the record id to the value of the '_id' literal (if present). Use the contructor to choose another literal as id source.") +@Description("By default changes the record ID to the value of the '_id' literal (if present). Use the contructor to choose another literal as ID source.") @In(StreamReceiver.class) @Out(StreamReceiver.class) @FluxCommand("change-id") @@ -83,15 +83,16 @@ public RecordIdChanger() { } /** - * Sets the name of the literal that contains the new record id. This must be + * Sets the name of the literal that contains the new record ID. This must be * a qualified literal name including the entities in which the literal is * contained. *

    - * For instance, the id literal “metadata.id” matches only + * For instance, the ID literal “metadata.id” matches only * literals named “id” which are part of an entity named * “metadata”. *

    - * The default value is “{@value StandardEventNames#ID}”. + * The default value is + * {@value org.metafacture.framework.StandardEventNames#ID}. *

    * This parameter must only be changed between records otherwise the * behaviour of the module is undefined. @@ -107,15 +108,15 @@ public String getIdLiteral() { } /** - * Controls whether records without an id literal are kept in the stream or + * Controls whether records without an ID literal are kept in the stream or * removed from the stream. *

    - * By default records without an id literal are kept in the stream. + * By default records without an ID literal are kept in the stream. *

    * This parameter may be changed at any time it becomes effective with the * next end-record event. * - * @param keepRecordsWithoutIdLiteral true to keep records without id + * @param keepRecordsWithoutIdLiteral true to keep records without ID * literal, false to remove them */ public void setKeepRecordsWithoutIdLiteral( @@ -128,16 +129,16 @@ public boolean getKeepRecordsWithoutIdLiteral() { } /** - * Controls whether the id literal is kept in the record after changing the - * record id. If a record contains multiple id literals, all of them are + * Controls whether the ID literal is kept in the record after changing the + * record ID. If a record contains multiple ID literals, all of them are * removed. *

    - * By default the id literal is removed from the stream. + * By default the ID literal is removed from the stream. *

    * This parameter must only be changed between records otherwise the * behaviour of the module is undefined. * - * @param keepIdLiteral true to keep id literals in records, false to + * @param keepIdLiteral true to keep ID literals in records, false to * remove them */ public void setKeepIdLiteral(final boolean keepIdLiteral) { From 8b74457d5479ff1f09136523b5d50210d040e9f0 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Sat, 23 Oct 2021 17:26:22 +0200 Subject: [PATCH 30/40] Fix Javadoc value tags. (#396) --- .../biblio/marc21/Marc21EventNames.java | 17 ++++++++--------- .../metafacture/mangling/EntityPathTracker.java | 2 +- .../metafacture/mangling/RecordToEntity.java | 2 +- .../org/metafacture/strings/RegexDecoder.java | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21EventNames.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21EventNames.java index fa842b137..38f148d53 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21EventNames.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21EventNames.java @@ -41,7 +41,7 @@ public final class Marc21EventNames { /** * Name of the literal event emitted for the record status field. *

    - * The name of the literal is "{@value #RECORD_STATUS_LITERAL}". + * The name of the literal is {@value #RECORD_STATUS_LITERAL}. *

    * The record status is specified at position 5 in the record leader. * @@ -54,8 +54,7 @@ public final class Marc21EventNames { * Name of the literal event emitted for the bibliographic level * field. *

    - * The name of the literal is - * "{@value #BIBLIOGRAPHIC_LEVEL_LITERAL}". + * The name of the literal is {@value #BIBLIOGRAPHIC_LEVEL_LITERAL}. *

    * The bibliographic level is specified at position 7 in the record leader. * @@ -67,7 +66,7 @@ public final class Marc21EventNames { /** * Name of the literal event emitted for the type of control field. *

    - * The name of the literal is "{@value #TYPE_OF_CONTROL_LITERAL}". + * The name of the literal is {@value #TYPE_OF_CONTROL_LITERAL}. *

    * The type of control is specified at position 8 in the record leader. * @@ -80,7 +79,7 @@ public final class Marc21EventNames { * Name of the literal event emitted for the character coding scheme * field. *

    - * The name of the literal is "{@value #CHARACTER_CODING_LITERAL}". + * The name of the literal is {@value #CHARACTER_CODING_LITERAL}. *

    * The character coding scheme is specified at position 9 in the record * leader. @@ -93,7 +92,7 @@ public final class Marc21EventNames { /** * Name of the literal event emitted for the encoding level field. *

    - * The name of the literal is "{@value #ENCODING_LEVEL_LITERAL}". + * The name of the literal is {@value #ENCODING_LEVEL_LITERAL}. *

    * The encoding level is specified at position 17 in the record leader. * @@ -106,7 +105,7 @@ public final class Marc21EventNames { * Name of the literal event emitted for the descriptive cataloging * form field. *

    - * The name of the literal is "{@value #CATALOGING_FORM_LITERAL}". + * The name of the literal is {@value #CATALOGING_FORM_LITERAL}. *

    * The descriptive cataloging form is specified at position 18 in the record * leader. @@ -120,7 +119,7 @@ public final class Marc21EventNames { * Name of the literal event emitted for the multipart resource * record level field. *

    - * The name of the literal is "{@value #MULTIPART_LEVEL_LITERAL}". + * The name of the literal is {@value #MULTIPART_LEVEL_LITERAL}. *

    * The multipart resource record level is specified at position 19 in the * record leader. @@ -133,7 +132,7 @@ public final class Marc21EventNames { /** * Name of the literal event emitted for the type of record field. *

    - * The name of the literal is "{@value #RECORD_TYPE_LITERAL}". + * The name of the literal is {@value #RECORD_TYPE_LITERAL}. *

    * The type of record is specified at position 6 in the record leader. * diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java index afea4a39b..c3e966157 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/EntityPathTracker.java @@ -90,7 +90,7 @@ public String getEntitySeparator() { /** * Sets the separator between entity names in the path. The default separator - * is "{@value DEFAULT_ENTITY_SEPARATOR}". + * is {@value DEFAULT_ENTITY_SEPARATOR}. * *

    The separator must not be changed while processing a stream. * diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java index fac5938df..31d4fd235 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java @@ -57,7 +57,7 @@ public String getEntityName() { /** * Sets the name of the entity which replaces the record. The default name is - * "{@value DEFAULT_ENTITY_NAME}". + * {@value DEFAULT_ENTITY_NAME}. * *

    The entity name may be changed while processing an event stream. It * becomes effective with the next record. diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java b/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java index 5f90969d4..dbb64a130 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/RegexDecoder.java @@ -49,10 +49,10 @@ * The regular expression may contain unnamed capture groups. These are * ignored. *

    - * If the pattern contains a capture group named "{@value - * #ID_CAPTURE_GROUP}", the first match of this group will be used as - * record identifier. If there is no such capture group or if it does not - * match, the empty string is used as record identifier. + * If the pattern contains a capture group named {@value #ID_CAPTURE_GROUP}, + * the first match of this group will be used as record identifier. If there + * is no such capture group or if it does not match, the empty string is used + * as record identifier. *

    * Example: The regex *

    {@literal
    
    From f54e3fe5ae5ee14482546226824d2d3d9aad78e4 Mon Sep 17 00:00:00 2001
    From: Jens Wille 
    Date: Tue, 26 Oct 2021 13:06:02 +0200
    Subject: [PATCH 31/40] Validate Javadoc as part of the checks. (#396)
    
    metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java:398: warning - Tag @see: reference not found: AppendState#ID_FIELD
    metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java:56: warning - #STDOUT (referenced by @value tag) is an unknown reference.
    metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java:68: warning - #DEFAULT_FORMAT (referenced by @value tag) is an unknown reference.
    metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java:62: warning - #RECORD_TAG_PROPERTY (referenced by @value tag) is an unknown reference.
    metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java:93: warning - DEFAULT_RECORD_TAG (referenced by @value tag) is an unknown reference.
    metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java:101: warning - #ISBN10 (referenced by @value tag) is an unknown reference.
    metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java:101: warning - #ISBN13 (referenced by @value tag) is an unknown reference.
    metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java:80: warning - #NAME (referenced by @value tag) is an unknown reference.
    metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java:80: warning - #VALUE (referenced by @value tag) is an unknown reference.
    ---
     build.gradle                                               | 7 +++++++
     .../java/org/metafacture/biblio/iso2709/RecordBuilder.java | 2 --
     .../src/main/java/org/metafacture/io/ObjectWriter.java     | 3 ++-
     .../java/org/metafacture/monitoring/ObjectBatchLogger.java | 3 +--
     .../main/java/org/metafacture/xml/GenericXmlHandler.java   | 6 +++---
     .../java/org/metafacture/metamorph/functions/ISBN.java     | 5 +++--
     .../java/org/metafacture/metamorph/functions/Unique.java   | 6 +++---
     7 files changed, 19 insertions(+), 13 deletions(-)
    
    diff --git a/build.gradle b/build.gradle
    index 7e3d1e00c..bc11914d8 100644
    --- a/build.gradle
    +++ b/build.gradle
    @@ -58,6 +58,7 @@ subprojects {
       apply plugin: 'checkstyle'
     
       check.dependsOn(editorconfigCheck)
    +  check.dependsOn(javadoc)
     
       sourceCompatibility = 1.8
       targetCompatibility = 1.8
    @@ -81,6 +82,12 @@ subprojects {
         group 'build'
       }
     
    +  javadoc {
    +    options {
    +      addBooleanOption 'Xwerror', true
    +    }
    +  }
    +
       artifacts {
         archives sourceJar
         archives javadocJar
    diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java
    index 6380b6c25..a986b583e 100644
    --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java
    +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java
    @@ -392,8 +392,6 @@ private void require7BitAscii(final char charCode) {
         /**
          * Resets the label, directory and the fields. Sets the "append state" to "id
          * field".
    -     *
    -     * @see AppendState#ID_FIELD
          */
         public void reset() {
             label.reset();
    diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java
    index 34268166c..7f4a9ea75 100644
    --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java
    +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java
    @@ -40,7 +40,8 @@
     @FluxCommand("write")
     public final class ObjectWriter implements ConfigurableObjectWriter {
     
    -    private static final String STDOUT = "stdout";
    +    public static final String STDOUT = "stdout";
    +
         private static final List ARGUMENTS = Collections.unmodifiableList(Arrays.asList(STDOUT, "PATH"));
     
         private final ConfigurableObjectWriter objectWriter;
    diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java
    index 65d94c16e..0a206ba59 100644
    --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java
    +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java
    @@ -50,9 +50,9 @@ public final class ObjectBatchLogger extends DefaultObjectPipe vars = new HashMap();
         private final String format;
    @@ -67,7 +67,6 @@ public final class ObjectBatchLogger extends DefaultObjectPipe {
     
    +    public static final String RECORD_TAG_PROPERTY = "org.culturegraph.metamorph.xml.recordtag";
    +
         public static final boolean EMIT_NAMESPACE = false;
     
         private static final Pattern TABS = Pattern.compile("\t+");
     
    -    private static final String RECORD_TAG_PROPERTY = "org.culturegraph.metamorph.xml.recordtag";
    -
         private String attributeMarker = DEFAULT_ATTRIBUTE_MARKER;
         private String recordTagName = DEFAULT_RECORD_TAG;
         private String valueTagName = DEFAULT_VALUE_TAG;
    @@ -86,7 +86,7 @@ public GenericXmlHandler(final String recordTagName) {
          * This value may only be changed between records. If it is changed
          * while processing a record the behaviour of this module is undefined.
          * 

    - * Default value: {@value DEFAULT_RECORD_TAG} + * Default value: {@value org.metafacture.framework.helpers.DefaultXmlPipe#DEFAULT_RECORD_TAG} * * @param recordTagName the tag name which marks the start of a record. */ diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java index eb6ac51f2..40572c6e5 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java @@ -28,10 +28,11 @@ */ public final class ISBN extends AbstractSimpleStatelessFunction { + public static final String ISBN10 = "isbn10"; + public static final String ISBN13 = "isbn13"; + private static final String CHECK = "0123456789X0"; - private static final String ISBN10 = "isbn10"; - private static final String ISBN13 = "isbn13"; private static final Pattern ISBN_PATTERN = Pattern.compile("[\\dX]+"); private static final Pattern DIRT_PATTERN = Pattern.compile("[\\.\\-]"); private static final int ISBN10_SIZE = 10; diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java index 033df9e62..b3e903679 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java @@ -29,9 +29,9 @@ */ public final class Unique extends AbstractStatefulFunction { - private static final String ENTITY = "entity"; - private static final String NAME = "name"; - private static final String VALUE = "value"; + public static final String ENTITY = "entity"; + public static final String NAME = "name"; + public static final String VALUE = "value"; private final Set set = new HashSet(); From 87e602abbb53970524d43ebff9943254460906ca Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Oct 2021 14:31:31 +0200 Subject: [PATCH 32/40] Remove listing of enum values (#396) - shorten description and use plural --- .../java/org/metafacture/triples/AbstractTripleSort.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java index bea31d6a2..8c490541e 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java @@ -39,16 +39,14 @@ public abstract class AbstractTripleSort extends DefaultObjectPipe> implements MemoryWarningSystem.Listener { /** - * Specifies the comparator. Can be one of {@link #SUBJECT}, {@link #PREDICATE}, - * {@link #OBJECT}, {@link #ALL}. + * The comparator. */ public enum Compare { SUBJECT, PREDICATE, OBJECT, ALL } /** - * Specifies the sort order.Can be one of {@link #INCREASING}, - * {@link #DECREASING}. + * The sort order. */ public enum Order { INCREASING { From 6f88f0ced9f3e23d019ced887da9051d61f76342 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Oct 2021 14:37:30 +0200 Subject: [PATCH 33/40] Add NonEmptyAtclauseDescription (#396) --- config/checkstyle/checkstyle.xml | 1 + .../java/org/metafacture/commons/ResourceUtil.java | 12 ++++++------ .../commons/reflection/ConfigurableClass.java | 4 ++-- .../org/metafacture/commons/tries/SetReplacer.java | 2 +- .../org/metafacture/framework/objects/Triple.java | 4 ++-- .../org/metafacture/jdom/JDomDocumentToStream.java | 2 +- .../src/main/java/org/metafacture/runner/Flux.java | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 86deceec7..70babdd60 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -101,6 +101,7 @@ + diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java index 11ef87b4b..8290907d2 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java @@ -153,7 +153,7 @@ public static Properties loadProperties(final String location) * * @param stream properties as InputStream * @return Properties - * @throws IOException + * @throws IOException if an I/O error occurs */ public static Properties loadProperties(final InputStream stream) throws IOException { @@ -168,7 +168,7 @@ public static Properties loadProperties(final InputStream stream) * * @param url properties as URL * @return Properties - * @throws IOException + * @throws IOException if an I/O error occurs */ public static Properties loadProperties(final URL url) throws IOException { return loadProperties(url.openStream()); @@ -179,7 +179,7 @@ public static Properties loadProperties(final URL url) throws IOException { * * @param location the filename * @return the content of the file - * @throws IOException + * @throws IOException if an I/O error occurs */ public static String loadTextFile(final String location) throws IOException { final StringBuilder builder = new StringBuilder(); @@ -200,7 +200,7 @@ public static String loadTextFile(final String location) throws IOException { * @param location the filename * @param list a List of Strings to append the lines of the file to * @return the List of Strings with the lines of the file appended - * @throws IOException + * @throws IOException if an I/O error occurs */ public static List loadTextFile(final String location, final List list) throws IOException { @@ -221,7 +221,7 @@ public static List loadTextFile(final String location, * @param inputStream the InputStream * @param encoding the Charset * @return a String of the content of the InputStream - * @throws IOException + * @throws IOException if an I/O error occurs */ public static String readAll(final InputStream inputStream, final Charset encoding) throws IOException { @@ -235,7 +235,7 @@ public static String readAll(final InputStream inputStream, final Charset encodi * * @param reader the Reader * @return a String of the content of the Reader - * @throws IOException + * @throws IOException if an I/O error occurs */ public static String readAll(final Reader reader) throws IOException { final StringBuilder loadedText = new StringBuilder(); diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java index 74825cd5b..08a3a2b7e 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java @@ -109,8 +109,8 @@ public T newInstance() { * Creates an instance of the class using the first constructor that matches the * varargs argument of the methods. * - * @param setterValues - * @param constructorArgs + * @param setterValues the Map of setter values + * @param constructorArgs the Object of args of the constructor * @return the new instance */ public T newInstance(final Map setterValues, final Object... constructorArgs) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java index b72ff2656..02c88a91e 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java @@ -60,7 +60,7 @@ public void addReplacements(final Map replacements) { * Replaces the Strings defined with {@link #addReplacement(String, String)} in * the text. * - * @param text + * @param text the text * @return the text with the replacements */ public String replaceIn(final String text) { diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java index 7262bed7d..1e18b2010 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java @@ -82,7 +82,7 @@ public ObjectType getObjectType() { * * @param in the ObjectInputStream * @return the Triple - * @throws IOException + * @throws IOException if an I/O error occurs */ public static Triple read(final ObjectInputStream in) throws IOException { try { @@ -98,7 +98,7 @@ public static Triple read(final ObjectInputStream in) throws IOException { * Writes the Triple to an ObjectOutputStream. * * @param out the ObjectOutputStream. - * @throws IOException + * @throws IOException if an I/O error occurs */ public void write(final ObjectOutputStream out) throws IOException { out.writeUTF(subject); diff --git a/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java b/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java index 732c33915..e0bf9399e 100644 --- a/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java +++ b/metafacture-jdom/src/main/java/org/metafacture/jdom/JDomDocumentToStream.java @@ -44,7 +44,7 @@ public final class JDomDocumentToStream /** * Contructs a JDomDocumentToStream with a given XmlPipe. * - * @param xmlPipe + * @param xmlPipe the XmlPipe of type StreamReceiver */ public JDomDocumentToStream(final XmlPipe xmlPipe) { this.xmlPipe = xmlPipe; diff --git a/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java b/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java index 4cc1e4ece..9d889b450 100644 --- a/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java +++ b/metafacture-runner/src/main/java/org/metafacture/runner/Flux.java @@ -51,8 +51,8 @@ private Flux() { * Runs the Flux. * * @param args the pathname of the flux file to run - * @throws IOException - * @throws RecognitionException + * @throws IOException if an I/O error occurs + * @throws RecognitionException if an ANTLR error occurs */ public static void main(final String[] args) throws IOException, RecognitionException { loadCustomJars(); From 27599ca47ac73ec73de8fc5ba2148596a2476d5d Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Oct 2021 15:15:20 +0200 Subject: [PATCH 34/40] Use @see in javadoc (#396) --- .../main/java/org/metafacture/metamorph/maps/JndiSqlMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java index abc83052d..37edb3a70 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java @@ -47,7 +47,7 @@ public JndiSqlMap() { /** * Sets the {@link DataSource}. * - * See {@link InitialContext} + * @see InitialContext * * @param name the name to be looked up in the InitialContext. */ From 0630ffad631b50b0dad07d976000f9de45f89e00 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Oct 2021 18:00:22 +0200 Subject: [PATCH 35/40] Remove minLineCount from MissingJavadocMethod (#396) This will result in many javadoc errors which will be cared of in later commits. --- config/checkstyle/checkstyle.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 70babdd60..a68d6fd5a 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -82,9 +82,7 @@ - - - + From e568830804e086201be9faee2a34f7ddb61d4a28 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 26 Oct 2021 18:07:01 +0200 Subject: [PATCH 36/40] Fix javadoc for module "biblio" (#396) Result of 0630ffad631b50b0dad07d976000f9de45f89e00. --- .../biblio/AlephMabXmlHandler.java | 3 ++ .../org/metafacture/biblio/AseqDecoder.java | 3 ++ .../metafacture/biblio/ComarcXmlHandler.java | 3 ++ .../org/metafacture/biblio/MabDecoder.java | 3 ++ .../biblio/iso2709/FieldHandler.java | 28 +++++++++++ .../metafacture/biblio/iso2709/Record.java | 25 ++++++++++ .../biblio/iso2709/RecordBuilder.java | 24 ++++++++++ .../biblio/iso2709/RecordFormat.java | 25 ++++++++++ .../biblio/marc21/Marc21Decoder.java | 46 +++++++++++++------ .../biblio/marc21/Marc21Encoder.java | 5 ++ .../biblio/marc21/MarcXmlEncoder.java | 45 +++++++++++++++--- .../biblio/marc21/MarcXmlHandler.java | 26 ++++++++++- .../metafacture/biblio/pica/PicaDecoder.java | 38 +++++++++++++-- .../metafacture/biblio/pica/PicaEncoder.java | 28 +++++++++-- .../biblio/pica/PicaMultiscriptRemodeler.java | 3 ++ .../biblio/pica/PicaXmlHandler.java | 3 ++ 16 files changed, 277 insertions(+), 31 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/AlephMabXmlHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/AlephMabXmlHandler.java index 3904ed3a6..1a54a80e2 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/AlephMabXmlHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/AlephMabXmlHandler.java @@ -50,6 +50,9 @@ public final class AlephMabXmlHandler extends DefaultXmlPipe { private String currentTag = ""; private StringBuilder builder = new StringBuilder(); + /** + * Creates instance of {@link AlephMabXmlHandler}. + */ public AlephMabXmlHandler() { } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/AseqDecoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/AseqDecoder.java index 9c5d37977..bb6e70c4a 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/AseqDecoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/AseqDecoder.java @@ -42,6 +42,9 @@ public final class AseqDecoder extends DefaultObjectPipe private static final int RECORD_IDENTIFIER_BEGIN = 0; private static final int RECORD_IDENTIFIER_END = 9; + /** + * Creates an instance of {@link AseqDecoder}. + */ public AseqDecoder() { } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/ComarcXmlHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/ComarcXmlHandler.java index 625300a8d..2833064f1 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/ComarcXmlHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/ComarcXmlHandler.java @@ -63,6 +63,9 @@ public class ComarcXmlHandler extends DefaultXmlPipe { private String currentTag = ""; private StringBuilder builder = new StringBuilder(); + /** + * Creates an instance of {@link ComarcXmlHandler}. + */ public ComarcXmlHandler() { } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/MabDecoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/MabDecoder.java index 4804199b8..6cdbf1e56 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/MabDecoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/MabDecoder.java @@ -57,6 +57,9 @@ public final class MabDecoder extends DefaultObjectPipe private static final String ID_TAG = "001 "; private static final int TAG_LENGTH = 4; + /** + * Creates an instance of {@link MabDecoder}. + */ public MabDecoder() { } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/FieldHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/FieldHandler.java index 35c82f2ee..785aa9bfa 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/FieldHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/FieldHandler.java @@ -24,14 +24,42 @@ */ public interface FieldHandler { + /** + * Reference a field. + * + * @param tag the tag + * @param implDefinedPart the impl defined part + * @param value the value + */ void referenceField(char[] tag, char[] implDefinedPart, String value); + /** + * Starts a data field. + * + * @param tag the tag + * @param implDefinedPart the impl defined part + * @param indicators the indicators + */ void startDataField(char[] tag, char[] implDefinedPart, char[] indicators); + /** + * Ends the data field. + */ void endDataField(); + /** + * Sets the impl defined part. + * + * @param implDefinedPart he impl defined part + */ void additionalImplDefinedPart(char[] implDefinedPart); + /** + * Sets the identifier to a value. + * + * @param identifier the identifier + * @param value the value + */ void data(char[] identifier, String value); } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Record.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Record.java index c72b5b4e4..2fcb8241f 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Record.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Record.java @@ -91,22 +91,47 @@ private int findRecordIdFieldStart() { return RECORD_ID_MISSING; } + /** + * Gets the record format of the Label. + * + * @return the record format of the Label + */ public RecordFormat getRecordFormat() { return label.getRecordFormat(); } + /** + * Gets the record status of the Label. + * + * @return the record status of the Label + */ public char getRecordStatus() { return label.getRecordStatus(); } + /** + * Gets the impl codes. + * + * @return the impl codes + */ public char[] getImplCodes() { return label.getImplCodes(); } + /** + * Gets the systems chars of the Label. + * + * @return the system chars + */ public char[] getSystemChars() { return label.getSystemChars(); } + /** + * Gets the reserved char of the Label. + * + * @return the reserved char + */ public char getReservedChar() { return label.getReservedChar(); } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java index a986b583e..22d13b260 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordBuilder.java @@ -99,6 +99,11 @@ public void setCharset(final Charset charset) { fields.setCharset(Require.notNull(charset)); } + /** + * Gets the Charset of the FieldsBuilder. + * + * @return the Charset + */ public Charset getCharset() { return fields.getCharset(); } @@ -208,6 +213,13 @@ public void appendIdentifierField(final char[] currentImplDefinedPart, final Str appendReferenceField(ID_FIELD_TAG, currentImplDefinedPart, value); } + /** + * Appends a reference field in dependency of the current tag and of the default + * impl defined part. + * + * @param currentTag char array of the current tag + * @param value String that is appended as a reference field + */ public void appendReferenceField(final char[] currentTag, final String value) { appendReferenceField(currentTag, defaultImplDefinedPart, value); } @@ -249,10 +261,22 @@ private void checkValidReferenceFieldTag(final char[] currentTag) { } } + /** + * Starts a data field in dependency of the current tag and default indicators. + * + * @param currentTag char array of the current tag + */ public void startDataField(final char[] currentTag) { startDataField(currentTag, defaultIndicators); } + /** + * Starts a data field in dependency of the current tag, indicators and of the + * default impl defined part. + * + * @param currentTag char array of the current tag + * @param indicators char array of the current indicators + */ public void startDataField(final char[] currentTag, final char[] indicators) { startDataField(currentTag, indicators, defaultImplDefinedPart); } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java index 8a493351f..c302666df 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/RecordFormat.java @@ -109,22 +109,47 @@ public static Builder createFrom(final RecordFormat source) { .withImplDefinedPartLength(source.implDefinedPartLength); } + /** + * Gets the length of the indicator. + * + * @return the length of the indicator + */ public int getIndicatorLength() { return indicatorLength; } + /** + * Gets the length of the identifier. + * + * @return the length of the identifier + */ public int getIdentifierLength() { return identifierLength; } + /** + * Gets the length of the field length. + * + * @return the length of the field length + */ public int getFieldLengthLength() { return fieldLengthLength; } + /** + * Gets the length of the field start. + * + * @return length of the field start + */ public int getFieldStartLength() { return fieldStartLength; } + /** + * Gets the the length of the defined part. + * + * @return the length of the defined part + */ public int getImplDefinedPartLength() { return implDefinedPartLength; } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java index b17813905..401cdd3ce 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Decoder.java @@ -139,33 +139,45 @@ @FluxCommand("decode-marc21") public final class Marc21Decoder extends DefaultObjectPipe { + public static final boolean EMIT_LEADER_AS_WHOLE = false; + public static final boolean IGNORE_MISSING_ID = false; + private final FieldHandler fieldHandler = new Marc21Handler(); - private boolean ignoreMissingId; - private boolean emitLeaderAsWhole; + private boolean ignoreMissingId = IGNORE_MISSING_ID; + private boolean emitLeaderAsWhole = EMIT_LEADER_AS_WHOLE; + /** + * Creates an instance of {@link Marc21Decoder}. + */ public Marc21Decoder() { } /** - * Controls whether the decoder aborts processing if a record has no - * identifier. A {@link MissingIdException} is thrown in these cases. - * If this parameter is set to true then the identifier emitted with the - * start-record event of records without field "001" will - * be an empty string. + * Controls whether the decoder aborts processing if a record has no identifier. + * A {@link MissingIdException} is thrown in these cases. If this parameter is + * set to true then the identifier emitted with the start-record event of + * records without field "001" will be an empty string. *

    - * The default value of {@code ignoreMissingId} is false. + * Default value: {@value #IGNORE_MISSING_ID} *

    * This parameter can be changed anytime during processing. The new value * becomes effective with the next record being processed. * - * @param ignoreMissingId - * true if missing identifiers should be silently ignored. + * @param ignoreMissingId true if missing identifiers should be silently + * ignored. */ public void setIgnoreMissingId(final boolean ignoreMissingId) { this.ignoreMissingId = ignoreMissingId; } + /** + * Gets the flag to decide whether to abort the processing of a record if it has + * no identifier. + * + * @return true if a missing identifier shouldn't abort processing, otherwise + * false + */ public boolean getIgnoreMissingId() { return ignoreMissingId; } @@ -174,16 +186,22 @@ public boolean getIgnoreMissingId() { * Controls whether the Record Leader should be emitted as a whole instead of * extracting the bibliographic information in the record leader. * - * @see MARC 21 - * Standard: Record Leader + * Default value: {@value #EMIT_LEADER_AS_WHOLE} * - * @param emitLeaderAsWhole - * true if the leader should be emitted as a whole. + * @see MARC 21 + * Standard: Record Leader + * @param emitLeaderAsWhole true if the leader should be emitted as a whole. */ public void setEmitLeaderAsWhole(final boolean emitLeaderAsWhole) { this.emitLeaderAsWhole = emitLeaderAsWhole; } + /** + * Gets the flag to decide whether the Record Leader is emitted as whole instead + * of extracting the bibliographic information in the record leader. + * + * @return true if the Record Leader is emitted as whole, otherwise false + */ public boolean getEmitLeaderAsWhole() { return emitLeaderAsWhole; } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java index 5dc1be44a..04f330ec4 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/Marc21Encoder.java @@ -106,6 +106,11 @@ public void setGenerateIdField(final boolean generateIdField) { this.generateIdField = generateIdField; } + /** + * Gets the flag to decide whether the ID field is generated. + * + * @return true if the record ID is generated, otherwise false + */ public boolean getGenerateIdField() { return generateIdField; } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index 55ddeb3df..ce3a3b920 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -40,6 +40,11 @@ @FluxCommand("encode-marcxml") public final class MarcXmlEncoder extends DefaultStreamPipe> { + public static final String XML_ENCODING = "UTF-8"; + public static final String XML_VERSION = "1.0"; + public static final boolean PRETTY_PRINTED = true; + public static final boolean OMIT_XML_DECLARATION = false; + private static final String ROOT_OPEN = ""; private static final String ROOT_CLOSE = ""; @@ -78,36 +83,62 @@ public final class MarcXmlEncoder extends DefaultStreamPipeDefault value: {@value #OMIT_XML_DECLARATION} + * + * @param currentOmitXmlDeclaration true if the XML declaration is omitted, otherwise + * false + */ public void omitXmlDeclaration(final boolean currentOmitXmlDeclaration) { omitXmlDeclaration = currentOmitXmlDeclaration; } + /** + * Sets the XML version. + * + * Default value: {@value #XML_VERSION} + * + * @param xmlVersion the XML version + */ public void setXmlVersion(final String xmlVersion) { this.xmlVersion = xmlVersion; } + /** + * Sets the XML encoding. + * + * Default value: {@value #XML_ENCODING} + * + * @param xmlEncoding the XML encoding + */ public void setXmlEncoding(final String xmlEncoding) { this.xmlEncoding = xmlEncoding; } /** - * Formats the resulting xml, by indentation. + * Formats the resulting xml by indentation. Aka "pretty printing". + * + * Default value: {@value #PRETTY_PRINTED} * - * @param formatted - * True, if formatting is activated. + * @param formatted true if formatting is activated, otherwise false */ public void setFormatted(final boolean formatted) { this.formatted = formatted; diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java index 98d7d082e..a79ecce6d 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java @@ -38,11 +38,12 @@ @FluxCommand("handle-marcxml") public final class MarcXmlHandler extends DefaultXmlPipe { + public static final String NAMESPACE = "http://www.loc.gov/MARC21/slim"; + private static final String SUBFIELD = "subfield"; private static final String DATAFIELD = "datafield"; private static final String CONTROLFIELD = "controlfield"; private static final String RECORD = "record"; - private static final String NAMESPACE = "http://www.loc.gov/MARC21/slim"; private static final String LEADER = "leader"; private static final String TYPE = "type"; @@ -51,9 +52,19 @@ public final class MarcXmlHandler extends DefaultXmlPipe { private String namespace = NAMESPACE; private StringBuilder builder = new StringBuilder(); + /** + * Creates an instance of {@link MarcXmlHandler}. + */ public MarcXmlHandler() { } + /** + * Sets the namespace. + * + * Default value: {@value #NAMESPACE} + * + * @param namespace the namespace + */ public void setNamespace(final String namespace) { this.namespace = namespace; } @@ -62,10 +73,23 @@ private boolean checkNamespace(final String uri) { return namespace == null || namespace.equals(uri); } + /** + * Sets the attribute marker. + * + * Default value: + * {@value org.metafacture.framework.helpers.DefaultXmlPipe#DEFAULT_ATTRIBUTE_MARKER} + * + * @param attributeMarker the attribute marker + */ public void setAttributeMarker(final String attributeMarker) { this.attributeMarker = attributeMarker; } + /** + * Gets the attribute marker. + * + * @return the attribute marker + */ public String getAttributeMarker() { return attributeMarker; } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java index b5b0748d5..1b3c7cae2 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaDecoder.java @@ -108,14 +108,14 @@ * is removed). This can be changed by setting * {@link #setTrimFieldNames(boolean)} to false. *

    - * The record id emitted with the start-record event is extracted from + * The record ID emitted with the start-record event is extracted from * one of the following non-normalized pica+ fields: *

      *
    • 003@ $0 *
    • 107F $0 *
    • 203@ $0 (this field may have an optional occurrence marker) *
    - * The value of the first matching field is used as the record id. The $0 + * The value of the first matching field is used as the record ID. The $0 * subfield must be the first subfield in the field. If * {@link #setIgnoreMissingIdn(boolean)} is false and no matching field is not * found in the record a {@link MissingIdException} is thrown otherwise the @@ -168,10 +168,20 @@ public final class PicaDecoder extends DefaultObjectPipe private boolean ignoreMissingIdn; private boolean isNormalized; + /** + * Creates an instance of {@link PicaDecoder}. Sets the input to read as + * normalized pica+. + */ public PicaDecoder() { this(true); } + /** + * Creates an instance of {@link PicaDecoder}. Sets the input to read as + * normalized or non-normalized pica+. + * + * @param normalized true if input is read as normalized pica+, otherwiese false + */ public PicaDecoder(final boolean normalized) { setNormalizedSerialization(normalized); } @@ -197,7 +207,7 @@ public void setNormalizedSerialization(final boolean normalized) { } /** - * Controls whether records having no record id are reported as faulty. By + * Controls whether records having no record ID are reported as faulty. By * default such records are reported by the {@code PicaDecoder} by throwing * a {@link MissingIdException}. *

    @@ -206,7 +216,7 @@ public void setNormalizedSerialization(final boolean normalized) { *

    * Default value: {@code false} * - * @param ignoreMissingIdn if true, missing record ids do not trigger a + * @param ignoreMissingIdn if true, missing record IDs do not trigger a * {@link MissingIdException} but an empty string is * used as record identifier instead. */ @@ -214,6 +224,11 @@ public void setIgnoreMissingIdn(final boolean ignoreMissingIdn) { this.ignoreMissingIdn = ignoreMissingIdn; } + /** + * Gets the flag to decide whether records without a record ID are processed. + * + * @return true if the ID of a record can be absent, otherwise false + */ public boolean getIgnoreMissingIdn() { return ignoreMissingIdn; } @@ -236,6 +251,11 @@ public void setNormalizeUTF8(final boolean normalizeUTF8) { parserContext.setNormalizeUTF8(normalizeUTF8); } + /** + * Gets the flag to decide whether the record is UTF-8 normalized. + * + * @return true if the record is UTF-8 normalized, otherwise false + */ public boolean getNormalizeUTF8() { return parserContext.getNormalizeUTF8(); } @@ -255,6 +275,11 @@ public void setSkipEmptyFields(final boolean skipEmptyFields) { parserContext.setSkipEmptyFields(skipEmptyFields); } + /** + * Gets the flag to decide whether to skip empty fields. + * + * @return true if empty fields are ignored, otherwise false + */ public boolean getSkipEmptyFields() { return parserContext.getSkipEmptyFields(); } @@ -274,6 +299,11 @@ public void setTrimFieldNames(final boolean trimFieldNames) { parserContext.setTrimFieldNames(trimFieldNames); } + /** + * Gets the flag to decide whether the field names are trimmed. + * + * @return true if the field names are trimmed, otherwise false + */ public boolean getTrimFieldNames() { return parserContext.getTrimFieldNames(); } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaEncoder.java index ffba87888..b1e069251 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaEncoder.java @@ -54,6 +54,8 @@ @FluxCommand("encode-pica") public final class PicaEncoder extends DefaultStreamPipe> { + public static final boolean IGNORE_RECORD_ID = false; + private static final String FIELD_DELIMITER = "\u001e"; private static final String SUB_DELIMITER = "\u001f"; private static final String FIELD_IDN_INTERN = "003@"; @@ -62,12 +64,15 @@ public final class PicaEncoder extends DefaultStreamPipe> private static StringBuilder builder = new StringBuilder(); //Result of the encoding process - private boolean entityOpen; //Flag to inform whether an entity is opened. - private boolean idnControlSubField; //Flag to inform whether it is the 003@ field. - private boolean ignoreRecordId; //Flag to decide whether the record Id is checked. + private boolean entityOpen; // Flag to inform whether an entity is opened. + private boolean idnControlSubField; // Flag to inform whether it is the 003@ field. + private boolean ignoreRecordId = IGNORE_RECORD_ID; // Flag to decide whether the record ID is checked. private String id; + /** + * Creates an instance of {@link PicaEncoder}. + */ public PicaEncoder() { } @@ -81,10 +86,23 @@ public void startRecord(final String recordId) { this.entityOpen = false; } + /** + * Sets the flag to decide whether the record ID is checked. + * + * Default value: {@value #IGNORE_RECORD_ID} + * + * @param ignoreRecordId true if the record ID should be ignored, otherwise + * false + */ public void setIgnoreRecordId(final boolean ignoreRecordId) { this.ignoreRecordId = ignoreRecordId; } + /** + * Gets the flag to decide whether the record ID is checked. + * + * @return true if the record ID is ignored, otherwise false + */ public boolean getIgnoreRecordId() { return this.ignoreRecordId; } @@ -118,11 +136,11 @@ public void literal(final String name, final String value) { } final String valueNew = Normalizer.normalize(value, Form.NFD); if (idnControlSubField) { - // it is a 003@ field, the same record id delivered with record should follow + // it is a 003@ field, the same record ID delivered with record should follow if (!this.id.equals(value)) { throw new MissingIdException(value); } - idnControlSubField = false; //only one record Id will be checked. + idnControlSubField = false; //only one record ID will be checked. } builder.append(SUB_DELIMITER); builder.append(name); diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java index 5b8780c18..3551105f0 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaMultiscriptRemodeler.java @@ -124,6 +124,9 @@ public final class PicaMultiscriptRemodeler extends DefaultStreamPipe bufferedFields = new TreeMap(); + /** + * Creates an instance of {@link PicaMultiscriptRemodeler}. + */ public PicaMultiscriptRemodeler() { } diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaXmlHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaXmlHandler.java index f943250c3..4435aa4fa 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaXmlHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/pica/PicaXmlHandler.java @@ -50,6 +50,9 @@ public final class PicaXmlHandler extends DefaultXmlPipe { private String currentTag = ""; private StringBuilder builder = new StringBuilder(); + /** + * Creates an instance of {@link PicaXmlHandler}. + */ public PicaXmlHandler() { } From b3e9f38a05218f637514712b7849e2853494a0ca Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Fri, 29 Oct 2021 10:31:25 +0200 Subject: [PATCH 37/40] Fix javadoc for MarcXmlEncoder (#396) --- .../java/org/metafacture/biblio/marc21/MarcXmlEncoder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index b6bb131f2..e4afe44f0 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -127,6 +127,12 @@ public String close(final Object[] args) { public MarcXmlEncoder() { } + /** + * Sets the flag to decide whether to emit the {@value #NAMESPACE_NAME} + * namespace + * + * @param emitNamespace true if the namespace is emitted, otherwise false + */ public void setEmitNamespace(final boolean emitNamespace) { this.emitNamespace = emitNamespace; namespacePrefix = new Object[]{emitNamespace ? NAMESPACE_PREFIX : EMPTY}; From 398599cee058972c25fa20b24ab56103d4930379 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Sat, 30 Oct 2021 16:47:51 +0200 Subject: [PATCH 38/40] Fix all javadoc errors (#396) Result of 0630ffad631b50b0dad07d976000f9de45f89e00. --- .../org/metafacture/commons/ResourceUtil.java | 70 +++++++++- .../org/metafacture/commons/StringUtil.java | 35 ++++- .../java/org/metafacture/commons/XmlUtil.java | 12 ++ .../commons/reflection/ConfigurableClass.java | 16 +++ .../commons/reflection/ObjectFactory.java | 39 ++++++ .../commons/reflection/ReflectionUtil.java | 8 ++ .../metafacture/commons/tries/SetMatcher.java | 18 +++ .../commons/tries/SetReplacer.java | 3 + .../commons/tries/SimpleRegexTrie.java | 13 +- .../metafacture/commons/tries/SimpleTrie.java | 3 + .../commons/tries/WildcardTrie.java | 3 + .../metafacture/commons/types/ListMap.java | 28 +++- .../commons/types/ScopedHashMap.java | 13 ++ .../java/org/metafacture/csv/CsvDecoder.java | 28 +++- .../JsonToElasticsearchBulk.java | 52 ++++++-- .../java/org/metafacture/files/DirReader.java | 14 ++ .../flowcontrol/CloseSuppressor.java | 13 ++ .../flowcontrol/ObjectBatchResetter.java | 14 +- .../flowcontrol/ObjectExceptionCatcher.java | 31 +++++ .../flowcontrol/ObjectPipeDecoupler.java | 19 +++ .../flowcontrol/ObjectThreader.java | 3 + .../flowcontrol/StreamBatchResetter.java | 23 ++++ .../metafacture/flowcontrol/StreamBuffer.java | 8 ++ .../flowcontrol/StreamDeferrer.java | 3 + .../flowcontrol/StreamExceptionCatcher.java | 9 ++ .../org/metafacture/flux/FluxCompiler.java | 10 ++ .../metafacture/flux/FluxParseException.java | 12 ++ .../metafacture/flux/parser/FluxProgramm.java | 8 ++ .../metafacture/flux/parser/StringSender.java | 5 + .../formatting/ObjectTemplate.java | 9 +- .../formatting/PreambleEpilogueAdder.java | 13 ++ .../formatting/StreamLiteralFormatter.java | 8 ++ .../java/org/metafacture/formeta/Formeta.java | 6 + .../metafacture/formeta/FormetaDecoder.java | 3 + .../metafacture/formeta/FormetaEncoder.java | 10 +- .../formeta/FormetaRecordsReader.java | 3 + .../formeta/formatter/ConciseFormatter.java | 3 + .../formeta/formatter/Formatter.java | 17 +++ .../formeta/formatter/FormatterStyle.java | 7 + .../formeta/formatter/MultilineFormatter.java | 3 + .../formeta/formatter/VerboseFormatter.java | 3 + .../metafacture/formeta/parser/Emitter.java | 23 ++++ .../formeta/parser/FormetaParser.java | 13 ++ .../formeta/parser/FullRecordEmitter.java | 3 + .../formeta/parser/PartialRecordEmitter.java | 13 ++ .../framework/FormatException.java | 11 ++ .../framework/MetafactureException.java | 17 +++ .../framework/MissingIdException.java | 12 ++ .../framework/helpers/DefaultLifeCycle.java | 3 + .../framework/helpers/DefaultObjectPipe.java | 3 + .../helpers/DefaultObjectReceiver.java | 3 + .../framework/helpers/DefaultSender.java | 8 ++ .../framework/helpers/DefaultStreamPipe.java | 4 +- .../helpers/DefaultStreamReceiver.java | 4 +- .../framework/helpers/DefaultTee.java | 3 + .../framework/helpers/DefaultXmlPipe.java | 3 + .../framework/helpers/DefaultXmlReceiver.java | 3 + .../helpers/ForwardingStreamPipe.java | 3 + .../metafacture/framework/objects/Triple.java | 27 ++++ .../org/metafacture/html/HtmlDecoder.java | 3 + .../metafacture/io/ByteStreamFileWriter.java | 3 + .../java/org/metafacture/io/CloseFailed.java | 16 +++ .../org/metafacture/io/FileCompression.java | 21 +++ .../java/org/metafacture/io/FileOpener.java | 29 ++++ .../java/org/metafacture/io/HttpOpener.java | 3 + .../java/org/metafacture/io/IoFailed.java | 16 +++ .../org/metafacture/io/IoWriterFactory.java | 10 +- .../java/org/metafacture/io/LineReader.java | 3 + .../metafacture/io/ObjectStdoutWriter.java | 3 + .../java/org/metafacture/io/ObjectWriter.java | 5 + .../java/org/metafacture/io/OpenFailed.java | 16 +++ .../java/org/metafacture/io/RecordReader.java | 23 ++++ .../org/metafacture/io/ResourceOpener.java | 3 + .../java/org/metafacture/io/StdInOpener.java | 3 + .../java/org/metafacture/io/TarReader.java | 3 + .../java/org/metafacture/io/WriteFailed.java | 16 +++ .../javaintegration/Collector.java | 12 +- .../javaintegration/EventList.java | 28 ++++ .../javaintegration/MapToStream.java | 8 ++ .../javaintegration/NamedValueList.java | 3 + .../javaintegration/NamedValueSet.java | 3 + .../javaintegration/ObjectCollector.java | 13 ++ .../javaintegration/SingleValue.java | 16 ++- .../javaintegration/StringListMap.java | 61 +++++++++ .../StringListMapToStream.java | 3 + .../javaintegration/StringMap.java | 8 ++ .../metafacture/javaintegration/ValueSet.java | 3 + .../pojo/MetafactureSource.java | 6 +- .../javaintegration/pojo/PojoDecoder.java | 3 + .../javaintegration/pojo/PojoEncoder.java | 5 + .../org/metafacture/json/JsonDecoder.java | 66 +++++++++ .../org/metafacture/json/JsonEncoder.java | 20 +++ .../metafacture/linkeddata/BeaconReader.java | 20 ++- .../linkeddata/OreAggregationAdder.java | 3 + .../metafacture/linkeddata/RdfMacroPipe.java | 8 ++ .../mangling/DuplicateObjectFilter.java | 3 + .../mangling/EntityPathTracker.java | 8 ++ .../metafacture/mangling/LiteralToObject.java | 8 ++ .../org/metafacture/mangling/NullFilter.java | 13 ++ .../metafacture/mangling/ObjectToLiteral.java | 23 ++++ .../metafacture/mangling/RecordIdChanger.java | 18 +++ .../mangling/RecordPathFilter.java | 33 +++++ .../metafacture/mangling/RecordToEntity.java | 8 ++ .../mangling/StreamEventDiscarder.java | 3 + .../metafacture/mangling/StreamFlattener.java | 23 ++++ .../monitoring/ObjectBatchLogger.java | 12 +- .../metafacture/monitoring/ObjectLogger.java | 9 ++ .../metafacture/monitoring/ObjectTimer.java | 8 ++ .../monitoring/StreamBatchLogger.java | 33 ++++- .../metafacture/monitoring/StreamLogger.java | 9 ++ .../metafacture/monitoring/StreamTimer.java | 9 ++ .../org/metafacture/monitoring/TimerBase.java | 5 + .../plumbing/IdentityStreamPipe.java | 3 + .../org/metafacture/plumbing/ObjectTee.java | 3 + .../plumbing/StreamBatchMerger.java | 8 ++ .../metafacture/plumbing/StreamMerger.java | 3 + .../org/metafacture/plumbing/StreamTee.java | 3 + .../java/org/metafacture/plumbing/XmlTee.java | 3 + .../runner/util/DirectoryClassLoader.java | 6 + .../scripting/JScriptObjectPipe.java | 11 ++ .../org/metafacture/statistics/Counter.java | 3 + .../org/metafacture/statistics/Histogram.java | 43 +++++- .../statistics/UniformSampler.java | 17 ++- .../org/metafacture/strings/LineRecorder.java | 8 ++ .../org/metafacture/strings/LineSplitter.java | 3 + .../org/metafacture/strings/RegexDecoder.java | 5 + .../strings/StreamUnicodeNormalizer.java | 39 ++++-- .../strings/StringConcatenator.java | 19 ++- .../metafacture/strings/StringDecoder.java | 15 ++- .../org/metafacture/strings/StringFilter.java | 22 ++- .../metafacture/strings/StringMatcher.java | 23 ++++ .../org/metafacture/strings/StringReader.java | 3 + .../strings/UnicodeNormalizer.java | 8 ++ .../triples/AbstractTripleSort.java | 20 +++ .../triples/SortedTripleFileFacade.java | 7 + .../metafacture/triples/StreamToTriples.java | 23 ++++ .../metafacture/triples/TripleCollect.java | 3 + .../org/metafacture/triples/TripleCount.java | 13 ++ .../org/metafacture/triples/TripleFilter.java | 43 ++++++ .../triples/TripleObjectRetriever.java | 3 + .../triples/TripleObjectWriter.java | 6 + .../org/metafacture/triples/TripleReader.java | 5 + .../metafacture/triples/TripleReorder.java | 37 ++++- .../org/metafacture/triples/TripleSort.java | 18 +++ .../metafacture/triples/TriplesToStream.java | 3 + .../org/metafacture/xml/CGXmlHandler.java | 3 + .../metafacture/xml/GenericXmlHandler.java | 32 ++++- .../org/metafacture/xml/SimpleXmlEncoder.java | 65 ++++++++- .../org/metafacture/yaml/YamlDecoder.java | 49 +++++++ .../org/metafacture/yaml/YamlEncoder.java | 22 ++- .../metafacture/metamorph/api/Collect.java | 26 +++- .../metamorph/api/ConditionAware.java | 6 +- .../metamorph/api/FlushListener.java | 7 +- .../metafacture/metamorph/api/Function.java | 11 ++ .../org/metafacture/metamorph/api/Maps.java | 33 +++++ .../metamorph/api/MorphBuildException.java | 12 ++ .../metamorph/api/MorphErrorHandler.java | 6 +- .../api/MorphExecutionException.java | 12 ++ .../metamorph/api/NamedValueReceiver.java | 15 ++- .../metamorph/api/SourceLocation.java | 27 +++- .../api/helpers/AbstractCollect.java | 10 ++ .../metamorph/api/helpers/AbstractFilter.java | 5 + .../api/helpers/AbstractFlushingCollect.java | 5 + .../api/helpers/AbstractFunction.java | 15 +++ .../metamorph/test/reader/CGXmlReader.java | 3 + .../metamorph/test/reader/FormetaReader.java | 3 + .../test/reader/JsonLinesReader.java | 3 + .../metamorph/test/reader/JsonReader.java | 3 + .../metamorph/test/reader/MarcXmlReader.java | 3 + .../test/reader/MultiFormatReader.java | 5 + .../metamorph/test/reader/PicaReader.java | 3 + .../test/validators/StreamValidator.java | 20 +++ .../validators/WellformednessChecker.java | 8 ++ .../metamorph/AbstractMetamorphDomWalker.java | 10 ++ .../metamorph/DefaultErrorHandler.java | 3 + .../org/metafacture/metamorph/Entity.java | 11 ++ .../java/org/metafacture/metamorph/Flush.java | 7 +- .../org/metafacture/metamorph/Metamorph.java | 126 +++++++++++++++++- .../metamorph/MetamorphException.java | 7 + .../metafacture/metamorph/collectors/All.java | 3 + .../metafacture/metamorph/collectors/Any.java | 3 + .../metamorph/collectors/Choose.java | 5 +- .../metamorph/collectors/Combine.java | 3 + .../metamorph/collectors/Concat.java | 23 ++++ .../metamorph/collectors/EqualsFilter.java | 3 + .../metamorph/collectors/Group.java | 3 + .../metamorph/collectors/None.java | 3 + .../metamorph/collectors/Range.java | 13 ++ .../metamorph/collectors/Square.java | 18 +++ .../metamorph/collectors/Tuples.java | 18 ++- .../metamorph/functions/AbstractCompose.java | 20 ++- .../metamorph/functions/BlackList.java | 3 + .../metamorph/functions/Buffer.java | 3 + .../metafacture/metamorph/functions/Case.java | 10 +- .../metamorph/functions/Compose.java | 3 + .../metamorph/functions/Constant.java | 8 ++ .../metamorph/functions/Contains.java | 3 + .../metamorph/functions/Count.java | 3 + .../metamorph/functions/DateFormat.java | 25 ++++ .../metamorph/functions/Equals.java | 3 + .../metamorph/functions/HtmlAnchor.java | 8 ++ .../metafacture/metamorph/functions/ISBN.java | 13 ++ .../metamorph/functions/Lookup.java | 13 ++ .../metamorph/functions/NormalizeUTF8.java | 3 + .../metamorph/functions/NotContains.java | 3 + .../metamorph/functions/NotEquals.java | 3 + .../metamorph/functions/Occurrence.java | 31 ++++- .../metamorph/functions/Regexp.java | 13 ++ .../metamorph/functions/Replace.java | 13 ++ .../metamorph/functions/Script.java | 8 ++ .../metamorph/functions/SetReplace.java | 3 + .../metamorph/functions/Split.java | 8 ++ .../metamorph/functions/Substring.java | 14 +- .../metamorph/functions/SwitchNameValue.java | 3 + .../metamorph/functions/Timestamp.java | 13 ++ .../metafacture/metamorph/functions/Trim.java | 3 + .../metamorph/functions/URLEncode.java | 3 + .../metamorph/functions/Unique.java | 10 +- .../metamorph/functions/WhiteList.java | 3 + .../metafacture/metamorph/maps/FileMap.java | 12 +- .../metamorph/maps/JndiSqlMap.java | 3 + .../metafacture/metamorph/maps/RestMap.java | 22 ++- .../metafacture/metamorph/maps/SqlMap.java | 33 +++++ .../metafacture/metamorph/xml/Location.java | 20 +++ 224 files changed, 2781 insertions(+), 102 deletions(-) diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java index 8290907d2..d803f0470 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/ResourceUtil.java @@ -47,12 +47,12 @@ private ResourceUtil() { } /** - * First attempts to open open {@code name} as a file. On fail attempts to - * open resource with name {@code name}. On fail attempts to open {@code name} - * as a URL. + * First attempts to open a file with the provided name. On fail attempts to + * open a resource identified by the name. On fail attempts to open a URL + * identified by the name. * - * @param name name of the file or resource to open - * @return an input stream for reading the opened file or resource + * @param name name of the file, resource or the URL to open + * @return an input stream for reading the opened file, resource or URL * @throws FileNotFoundException if all attempts fail */ public static InputStream getStream(final String name) @@ -83,6 +83,13 @@ public static InputStream getStream(final String name) } + /** + * Gets an InputStream of a File. + * + * @param file the File. + * @return the InputStream + * @throws FileNotFoundException if the File couldn't be found + */ public static InputStream getStream(final File file) throws FileNotFoundException { return new FileInputStream(file); @@ -98,20 +105,53 @@ private static void throwFileNotFoundException(final String name, throw e; } + /** + * Gets a Reader. First attempts to open a file. On fail attempts to open the + * resource with name. On fail attempts to open name as a URL. + * + * @param name the name of the resource + * @return the Reader + * @throws FileNotFoundException if the File couldn't be found + */ public static Reader getReader(final String name) throws FileNotFoundException { return new InputStreamReader(getStream(name)); } + /** + * Gets a Reader from a File. + * + * @param file the File + * @return the Reader + * @throws FileNotFoundException if the File couldn't be found + */ public static Reader getReader(final File file) throws FileNotFoundException { return new InputStreamReader(getStream(file)); } + /** + * Gets a Reader. First attempts to open a file. On fail attempts to open the + * resource with name. On fail attempts to open name as a URL. Uses the given + * {@link java.nio.charset.Charset charset} as encoding. + * + * @param name the name of the resource + * @param encoding the Charset + * @return the Reader + * @throws IOException if an I/O error occurs + */ public static Reader getReader(final String name, final String encoding) throws IOException { return new InputStreamReader(getStream(name), encoding); } + /** + * Gets a Reader from a File using {@link java.nio.charset.Charset charset}. + * + * @param file the File + * @param encoding the Charset + * @return the Reader + * @throws IOException if an I/O error occurs + */ public static Reader getReader(final File file, final String encoding) throws IOException { return new InputStreamReader(getStream(file), encoding); @@ -139,10 +179,26 @@ public static URL getUrl(final String name) throws MalformedURLException { return resourceUrl != null ? resourceUrl : new URL(name); } + /** + * Gets an URL of a File. + * + * @param file the File + * @return the URL + * @throws MalformedURLException if malformed URL has occurred + */ public static URL getUrl(final File file) throws MalformedURLException { return file.toURI().toURL(); } + /** + * Creates Properties based upon a location. First attempts to open a file. On + * fail attempts to open the resource with name. On fail attempts to open name + * as a URL. + * + * @param location the location of the resource + * @return the Properties + * @throws IOException if an I/O error occurs + */ public static Properties loadProperties(final String location) throws IOException { return loadProperties(getStream(location)); @@ -152,7 +208,7 @@ public static Properties loadProperties(final String location) * Loads properties from an InputStream. * * @param stream properties as InputStream - * @return Properties + * @return the Properties * @throws IOException if an I/O error occurs */ public static Properties loadProperties(final InputStream stream) @@ -167,7 +223,7 @@ public static Properties loadProperties(final InputStream stream) * Loads properties from a URL. * * @param url properties as URL - * @return Properties + * @return the Properties * @throws IOException if an I/O error occurs */ public static Properties loadProperties(final URL url) throws IOException { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java index 6d5b2483b..cc3f13fc1 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java @@ -49,15 +49,48 @@ public static O fallback(final O value, final O fallbackValue) { return value; } + /** + * Formats a String. If a String has a variable it will be replaced based on a + * Map. The start and the end of indicating this variable must be defined. + * {@value #DEFAULT_VARSTART} indicates the start of a variable and + * {@value #DEFAULT_VAREND} the end of the variable . Unassigned variables are + * ignored. + * + * @param format the String to be formatted + * @param variables a Map of variable names and their values + * @return the formatted String + */ public static String format(final String format, final Map variables) { return format(format, DEFAULT_VARSTART, DEFAULT_VAREND, true, variables); } + /** + * Formats a String. If a String has a variable it will be replaced based on a + * Map. The start and the end of indicating this variable must be defined. + * Unassigned variables are ignored. + * + * @param format the String to be formatted + * @param varStartIndicator a String indicating the start of a variable + * @param varEndIndicator a String indicating the end of a variable + * @param variables a Map of variable names and their values + * @return the formatted String + */ public static String format(final String format, final String varStartIndicator, final String varEndIndicator, final Map variables) { return format(format, varStartIndicator, varEndIndicator, true, variables); } + /** + * Formats a String. If a String has a variable it will be replaced based on a + * Map. The start and the end of indicating this variable must be defined. + * {@value #DEFAULT_VARSTART} indicates the start of a variable and + * {@value #DEFAULT_VAREND} the end of the variable . + * + * @param format the String to be formatted + * @param ignoreMissingVars boolean if an unassigned variable should be ignored + * @param variables a Map of variable names and their values + * @return the formatted String + */ public static String format(final String format, final boolean ignoreMissingVars, final Map variables) { return format(format, DEFAULT_VARSTART, DEFAULT_VAREND, ignoreMissingVars, variables); @@ -72,7 +105,7 @@ public static String format(final String format, final boolean ignoreMissingVars * @param varEndIndicator a String indicating the end of a variable * @param ignoreMissingVars boolean if an unassigned variable should be ignored * @param variables a Map of variable names and their values - * @return a formatted String + * @return the formatted String */ public static String format(final String format, final String varStartIndicator, final String varEndIndicator, final boolean ignoreMissingVars, final Map variables) { diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java index 92af10965..c56d41757 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/XmlUtil.java @@ -45,6 +45,12 @@ private XmlUtil() { // No instances allowed } + /** + * Converts a Node to a String. + * + * @param node the Node + * @return the String represantation of the Node + */ public static String nodeToString(final Node node) { return nodeToString(node, false); } @@ -117,6 +123,12 @@ public static boolean isXmlMimeType(final String mimeType) { mimeType.endsWith(XML_BASE_MIME_TYPE); } + /** + * Escapes an unescaped String. + * + * @param unescaped the unescaped String + * @return the escaped String + */ public static String escape(final String unescaped) { return escape(unescaped, true); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java index 08a3a2b7e..c3d8f7121 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ConfigurableClass.java @@ -46,10 +46,21 @@ public final class ConfigurableClass { private Map settersCache; + /** + * + * Creates an instance of {@link ConfigurableClass} defined by a Class. + * + * @param plainClass the plain class of object type T + */ public ConfigurableClass(final Class plainClass) { this.plainClass = plainClass; } + /** + * Gets the plain class of the ConfigurableClass. + * + * @return the Class + */ public Class getPlainClass() { return plainClass; } @@ -101,6 +112,11 @@ public Map> getSetterTypes() { return setterTypes; } + /** + * Creates an empty instance of the class. + * + * @return a new instance + */ public T newInstance() { return newInstance(Collections.emptyMap()); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java index a6695fbd7..57e84f391 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ObjectFactory.java @@ -37,6 +37,9 @@ public class ObjectFactory { private final Map> classes = new HashMap<>(); + /** + * Creates an instance of {@link ObjectFactory}. + */ public ObjectFactory() { } @@ -55,14 +58,33 @@ public final void loadClassesFromMap(final Map classMap, final Class ba } } + /** + * Registers a Class as a ConfigurableClass. + * + * @param key the key associcated with the Class + * @param objectClass the Class + */ public final void registerClass(final String key, final Class objectClass) { registerClass(key, new ConfigurableClass<>(objectClass)); } + /** + * Registers a ConfigurableClass. + * + * @param key the key associcated with the ConfigurableClass + * @param objectClass the ConfigurableClass + */ public final void registerClass(final String key, final ConfigurableClass objectClass) { classes.put(key, objectClass); } + /** + * Returns a new instance of a ConfigurableClass with no setters. + * + * @param key the name of the class + * @param constructorArgs the args of the constructor + * @return a new instance + */ public final T newInstance(final String key, final Object... constructorArgs) { return newInstance(key, Collections.emptyMap(), constructorArgs); } @@ -83,14 +105,31 @@ public final T newInstance(final String key, final Map values, f return instanceClass.newInstance(values, constructorArgs); } + /** + * Checks wether a ConfigurableClass is asscociated with a key. + * + * @param key the key + * @return true if the key is associcated with a ConfigurableClass + */ public final boolean containsKey(final String key) { return classes.containsKey(key); } + /** + * Gets the key set of all {ConfigurableClass}es. + * + * @return all keys that identify the {ConfigurableClass}es + */ public final Set keySet() { return Collections.unmodifiableSet(classes.keySet()); } + /** + * Gets a ConfigurableClass. + * + * @param key the key that identifies the ConfigurableClass + * @return the ConfigurableClass + */ public final ConfigurableClass get(final String key) { return classes.get(key); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java index 798e0523b..0b09336c5 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/reflection/ReflectionUtil.java @@ -40,6 +40,14 @@ public static ClassLoader getContextClassLoader() { return loader; } + /** + * Loads a Class. + * + * @param the object type + * @param className the name of the class + * @param baseType the object type of the class to be wrapped + * @return the ConfigurableClass + */ public static ConfigurableClass loadClass(final String className, final Class baseType) { return loadClass(getContextClassLoader(), className, baseType); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java index dcbeffe6c..e77e16ff9 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetMatcher.java @@ -33,6 +33,9 @@ public final class SetMatcher { private final ACNode root = new ACNode<>(null, 0); private boolean isPrepared; + /** + * Creates an instance of {@link SetMatcher}. + */ public SetMatcher() { } @@ -198,14 +201,29 @@ public Match(final T value, final int start, final int length) { this.length = length; } + /** + * Gets the value. + * + * @return the value + */ public T getValue() { return value; } + /** + * Gets the start position. + * + * @return the start position + */ public int getStart() { return start; } + /** + * Gets the length. + * + * @return the length + */ public int getLength() { return length; } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java index 02c88a91e..17530c3f4 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SetReplacer.java @@ -32,6 +32,9 @@ public final class SetReplacer { private final SetMatcher matcher = new SetMatcher(); + /** + * Creates an instance of {@link SetReplacer}. + */ public SetReplacer() { } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java index c871f6d11..8514c3f9b 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleRegexTrie.java @@ -33,10 +33,12 @@ public class SimpleRegexTrie

    { // matches: `lit-[A]`, `lit-[AB]`, does not match: `a[].1`, `a[].1.b[].1` public static final String SIMPLE_CHARACTER_CLASS = ".*\\[[^\\[\\]]+\\].*"; - private final WildcardTrie

    trie; + private final WildcardTrie

    trie = new WildcardTrie

    (); + /** + * Creates an instance of {@link SimpleRegexTrie}. + */ public SimpleRegexTrie() { - trie = new WildcardTrie

    (); } /** @@ -62,6 +64,13 @@ public void put(final String keys, final P value) { } } + /** + * Gets the List of values identified by a key. + * + * @see WildcardTrie + * @param key the key + * @return the List of the key if the key exists, otherwise an empty List + */ public List

    get(final String key) { return trie.get(key); } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java index 01acdbc9d..9494b11ed 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/SimpleTrie.java @@ -25,6 +25,9 @@ public final class SimpleTrie

    { private final Node

    root = new Node<>(null); + /** + * Creates an instance of {@link SimpleTrie}. + */ public SimpleTrie() { } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java index 52d66a990..7efb6edac 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/tries/WildcardTrie.java @@ -43,6 +43,9 @@ public final class WildcardTrie

    { private Set> nodes = new HashSet>(); private Set> nextNodes = new HashSet>(); + /** + * Creates an instance of {@link WildcardTrie}. + */ public WildcardTrie() { } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java index e46825dcd..9f464980f 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/ListMap.java @@ -37,10 +37,18 @@ public class ListMap implements Map> { private String identifier; private final Map> map; + /** + * Creates an empty instance of an empty ListMap. + */ public ListMap() { map = new HashMap>(); } + /** + * Creates an instance of a ListMap with the given Map. + * + * @param map the Map + */ public ListMap(final Map> map) { this.map = map; } @@ -120,15 +128,21 @@ public final List get(final Object name) { return values; } + /** + * Checks is a key exists in ListMap. + * + * @param name the name of the key + * @return true if the key exists, otherwise false + */ public final boolean existsKey(final K name) { return getFirst(name) != null; } /** - * Gets the first element of the List of values of the key in the map. + * Gets the first element of the List of values of the key in the map or null. * * @param name the key - * @return first element of the values of the key + * @return first element of the values of the key or null */ public final V getFirst(final K name) { final List values = map.get(name); @@ -143,10 +157,20 @@ public final String toString() { return map.toString(); } + /** + * Sets the ID of the ListMap. + * + * @param newIdentifier the ID of the ListMap + */ public final void setId(final String newIdentifier) { identifier = newIdentifier; } + /** + * Gets the ID of the ListMap. + * + * @return the ID of the ListMap + */ public final String getId() { return identifier; } diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/types/ScopedHashMap.java b/metafacture-commons/src/main/java/org/metafacture/commons/types/ScopedHashMap.java index a7031c65e..d22d2c603 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/types/ScopedHashMap.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/types/ScopedHashMap.java @@ -32,10 +32,18 @@ public final class ScopedHashMap extends HashMap { // checkstyle-dis private static final long serialVersionUID = -7184066609960144713L; private final ScopedHashMap outerScope; + /** + * Creates an instance of {@link ScopedHashMap} and sets the outer scope. + * + * @param outerScope outer scope + */ public ScopedHashMap(final ScopedHashMap outerScope) { this.outerScope = outerScope; } + /** + * Creates an empty instance of {@link ScopedHashMap}. + */ public ScopedHashMap() { outerScope = null; } @@ -65,6 +73,11 @@ public V get(final Object key) { return ret; } + /** + * Gets the outer scope. + * + * @return the outer scope + */ public ScopedHashMap getOuterScope() { return outerScope; } diff --git a/metafacture-csv/src/main/java/org/metafacture/csv/CsvDecoder.java b/metafacture-csv/src/main/java/org/metafacture/csv/CsvDecoder.java index 39de4d4f9..06bd6a690 100644 --- a/metafacture-csv/src/main/java/org/metafacture/csv/CsvDecoder.java +++ b/metafacture-csv/src/main/java/org/metafacture/csv/CsvDecoder.java @@ -30,26 +30,28 @@ import java.util.List; /** - * Decodes lines of CSV files. First line is interpreted as header. + * Decodes lines of CSV files. First line may be interpreted as header. * * @author Markus Michael Geipel * @author Fabian Steeg (fsteeg) * */ -@Description("Decodes lines of CSV files. First line is interpreted as header.") +@Description("Decodes lines of CSV files. First line may be interpreted as header.") @In(String.class) @Out(StreamReceiver.class) @FluxCommand("decode-csv") public final class CsvDecoder extends DefaultObjectPipe { - private static final char DEFAULT_SEP = ','; - private char separator; + public static final char DEFAULT_SEP = ','; + private char separator = DEFAULT_SEP; private String[] header = new String[0]; private int count; private boolean hasHeader; /** + * Creates an instance of {@link CsvDecoder} with a given separator. + * * @param separator to split lines */ public CsvDecoder(final String separator) { @@ -57,14 +59,19 @@ public CsvDecoder(final String separator) { } /** + * Creates an instance of {@link CsvDecoder} with a given separator. + * * @param separator to split lines */ public CsvDecoder(final char separator) { this.separator = separator; } + /** + * Creates an instance of {@link CsvDecoder}. The default separator is + * {@value #DEFAULT_SEP}. + */ public CsvDecoder() { - this.separator = DEFAULT_SEP; } @Override @@ -115,10 +122,21 @@ private String[] parseCsv(final String string) { return parts; } + /** + * Flags if the CSV has a header or comes without a header. + * + * @param hasHeader true if the CSV has a header, otherwise false + */ public void setHasHeader(final boolean hasHeader) { this.hasHeader = hasHeader; } + /** + * Sets the separator. + * + * @param separator the separator as a String. The first character is used as + * the separator. + */ public void setSeparator(final String separator) { this.separator = separator.charAt(0); } diff --git a/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java b/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java index c314a723a..3dca1f339 100644 --- a/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java +++ b/metafacture-elasticsearch/src/main/java/org/metafacture/elasticsearch/JsonToElasticsearchBulk.java @@ -50,13 +50,17 @@ public class JsonToElasticsearchBulk extends DefaultObjectPipe private final int numCloses; private int count; + /** + * Creates an instance of {@link CloseSuppressor} with a number defining the + * number of events to block before closing the stream. + * + * @param numCloses the number of events to block before closing the stream. The + * String is parsed to an integer. + */ public CloseSuppressor(final String numCloses) { this(Integer.parseInt(numCloses)); } + /** + * Creates an instance of {@link CloseSuppressor} with a number defining the + * number of events to block before closing the stream. + * + * @param numCloses the number of events to block before closing the stream + */ public CloseSuppressor(final int numCloses) { this.numCloses = numCloses; } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectBatchResetter.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectBatchResetter.java index 70137a785..8a5efdd78 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectBatchResetter.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectBatchResetter.java @@ -42,16 +42,19 @@ public class ObjectBatchResetter extends DefaultObjectPipereset-stream event is triggered. *

    - * The default value is {@value DEFAULT_BATCH_SIZE}. + * The default value is {@value #DEFAULT_BATCH_SIZE}. *

    - * This parameter can be changed anytime during processing. If the new value - * is less than the number of received objects a reset-stream event is + * This parameter can be changed anytime during processing. If the new value is + * less than the number of received objects a reset-stream event is * emitted when the next object is received. * * @param batchSize number of objects before a reset-stream event is @@ -61,6 +64,11 @@ public void setBatchSize(final int batchSize) { this.batchSize = batchSize; } + /** + * Gets the size of the batch. + * + * @return the size of the batch + */ public int getBatchSize() { return batchSize; } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectExceptionCatcher.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectExceptionCatcher.java index 3b440b445..9bf50f748 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectExceptionCatcher.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectExceptionCatcher.java @@ -53,26 +53,57 @@ public final class ObjectExceptionCatcher extends private String logPrefix; private boolean logStackTrace; + /** + * Creates an instance of {@link ObjectExceptionCatcher} without a log message + * prefix. + */ public ObjectExceptionCatcher() { this(""); } + /** + * Creates an instance of {@link ObjectExceptionCatcher} with a given prefix of + * the log messages. + * + * @param logPrefix the prefix of the log messages + */ public ObjectExceptionCatcher(final String logPrefix) { this.logPrefix = logPrefix; } + /** + * Sets the log prefix. + * + * @param logPrefix the log message prefix + */ public void setLogPrefix(final String logPrefix) { this.logPrefix = logPrefix; } + /** + * Gets the log messages prefix. + * + * @return the log message prefix + */ public String getLogPrefix() { return logPrefix; } + /** + * Sets the log messages to stack trace level. + * + * @param logStackTrace true if the log messages should be set to stack trace + * level. + */ public void setLogStackTrace(final boolean logStackTrace) { this.logStackTrace = logStackTrace; } + /** + * Checks wether the log messages should be in stack trace level. + * + * @return true if the log messages are in stack trace level + */ public boolean isLogStackTrace() { return logStackTrace; } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectPipeDecoupler.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectPipeDecoupler.java index 38f275ca0..b801d7097 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectPipeDecoupler.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectPipeDecoupler.java @@ -51,18 +51,37 @@ public final class ObjectPipeDecoupler implements ObjectPipe receiver; private boolean debug; + /** + * Creates an instance of {@link ObjectPipeDecoupler} by setting a default + * capacity of {@value #DEFAULT_CAPACITY}. + */ public ObjectPipeDecoupler() { queue = new LinkedBlockingQueue<>(DEFAULT_CAPACITY); } + /** + * Creates an instance of {@link ObjectPipeDecoupler} by setting a capacity. + * + * @param capacity the capacity + */ public ObjectPipeDecoupler(final int capacity) { queue = new LinkedBlockingQueue<>(capacity); } + /** + * Creates an instance of {@link ObjectPipeDecoupler} by setting a capacity. + * + * @param capacity the capacity as String. Will be parsed as integer. + */ public ObjectPipeDecoupler(final String capacity) { queue = new LinkedBlockingQueue<>(Integer.parseInt(capacity)); } + /** + * Sets the log messages to be more verbose. + * + * @param debug true if the log messages should be more verbose + */ public void setDebug(final boolean debug) { this.debug = debug; } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java index 63aacc3ea..e4aa872d6 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/ObjectThreader.java @@ -51,6 +51,9 @@ public class ObjectThreader implements Tee>, ObjectPipe> receivers = new ArrayList>(); private int objectNumber; + /** + * Creates an instance of {@link ObjectThreader}. + */ public ObjectThreader() { } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBatchResetter.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBatchResetter.java index d6def5222..dcad1b38b 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBatchResetter.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBatchResetter.java @@ -41,21 +41,44 @@ public final class StreamBatchResetter extends ForwardingStreamPipe { private long recordCount; private long batchCount; + /** + * Creates an instance of {@link StreamBatchResetter}. + */ public StreamBatchResetter() { } + /** + * Sets the size of the batch. + * + * @param batchSize the size of the batch + */ public void setBatchSize(final int batchSize) { this.batchSize = batchSize; } + /** + * Gets the size of the batch. + * + * @return the size of the batch + */ public long getBatchSize() { return batchSize; } + /** + * Gets the batch count. + * + * @return the number of counted batches. + */ public long getBatchCount() { return batchCount; } + /** + * Gets the record count. + * + * @return the number of counted records + */ public long getRecordCount() { return recordCount; } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java index f87ce2772..94732aa30 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamBuffer.java @@ -42,9 +42,17 @@ private enum MessageType { private final List typeBuffer = new ArrayList(); private final List valueBuffer = new ArrayList(); + /** + * Creates an instance of {@link StreamBuffer}. + */ public StreamBuffer() { } + /** + * Checks wether there are messages stored. + * + * @return true if messages are empty, otherwise false + */ public boolean isEmpty() { return typeBuffer.isEmpty(); } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamDeferrer.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamDeferrer.java index f9ce9d702..b03888670 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamDeferrer.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamDeferrer.java @@ -45,6 +45,9 @@ public class StreamDeferrer extends DefaultStreamPipe { private final StreamBuffer buffer = new StreamBuffer(); + /** + * Creates an instance of {@link StreamDeferrer}. + */ public StreamDeferrer() { } diff --git a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamExceptionCatcher.java b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamExceptionCatcher.java index e0fe7aaad..20c7b684d 100644 --- a/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamExceptionCatcher.java +++ b/metafacture-flowcontrol/src/main/java/org/metafacture/flowcontrol/StreamExceptionCatcher.java @@ -44,10 +44,19 @@ public final class StreamExceptionCatcher extends private final String logPrefix; + /** + * Creates an instance of {@link StreamExceptionCatcher}. + */ public StreamExceptionCatcher() { this(""); } + /** + * Creates an instance of {@link StreamExceptionCatcher} setting a prefix for + * the logs messages. + * + * @param logPrefix the prefix of the log messages + */ public StreamExceptionCatcher(final String logPrefix) { this.logPrefix = logPrefix; } diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/FluxCompiler.java b/metafacture-flux/src/main/java/org/metafacture/flux/FluxCompiler.java index 0805ddec3..2dd718b78 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/FluxCompiler.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/FluxCompiler.java @@ -40,6 +40,16 @@ private FluxCompiler() { // no instances } + /** + * Compiles the flux to a flow. + * + * @see FluxProgramm + * @param flux the flux + * @param vars the variables of the flux + * @return the flow + * @throws RecognitionException if an ANTLR exception occurs + * @throws IOException if an I/O error occurs + */ public static FluxProgramm compile(final InputStream flux, final Map vars) throws RecognitionException, IOException { return compileFlow(compileAst(flux), vars); } diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/FluxParseException.java b/metafacture-flux/src/main/java/org/metafacture/flux/FluxParseException.java index ee1e331e6..576d31711 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/FluxParseException.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/FluxParseException.java @@ -26,10 +26,22 @@ public final class FluxParseException extends MetafactureException { private static final long serialVersionUID = -5728526458760884738L; + /** + * Creates an instance of {@link FluxParseException} by a given message and the + * cause of the exception. + * + * @param message the message + * @param cause the cause + */ public FluxParseException(final String message, final Throwable cause) { super(message, cause); } + /** + * Creates an instance of {@link FluxParseException} by a given message. + * + * @param message the message + */ public FluxParseException(final String message) { super(message); } diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java b/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java index 55de12cb2..6c3aa98ad 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/parser/FluxProgramm.java @@ -64,6 +64,9 @@ public final class FluxProgramm { private final Map wormholeNameMapping = new HashMap(); private final Map wormholeInFlowMapping = new Hashtable(); + /** + * Creates an instance of {@link FluxProgramm}. + */ public FluxProgramm() { } @@ -172,6 +175,11 @@ public void start() { } } + /** + * Prints the help to the given PrintStream. + * + * @param out the PrintStream to orint to + */ public static void printHelp(final PrintStream out) { HelpPrinter.print(COMMAND_FACTORY, out); } diff --git a/metafacture-flux/src/main/java/org/metafacture/flux/parser/StringSender.java b/metafacture-flux/src/main/java/org/metafacture/flux/parser/StringSender.java index 095f8b830..90260f38a 100644 --- a/metafacture-flux/src/main/java/org/metafacture/flux/parser/StringSender.java +++ b/metafacture-flux/src/main/java/org/metafacture/flux/parser/StringSender.java @@ -28,6 +28,11 @@ public final class StringSender extends DefaultObjectPipe extends DefaultObjectPipe vars = new HashMap(); + private final Map vars = new HashMap<>(); private final String template; + /** + * Creates an instance of {@link ObjectTemplate} with a given template. + * + * @param template the template + */ public ObjectTemplate(final String template) { this.template = template; } diff --git a/metafacture-formatting/src/main/java/org/metafacture/formatting/PreambleEpilogueAdder.java b/metafacture-formatting/src/main/java/org/metafacture/formatting/PreambleEpilogueAdder.java index 369d43312..c740e9edf 100644 --- a/metafacture-formatting/src/main/java/org/metafacture/formatting/PreambleEpilogueAdder.java +++ b/metafacture-formatting/src/main/java/org/metafacture/formatting/PreambleEpilogueAdder.java @@ -46,6 +46,9 @@ public final class PreambleEpilogueAdder extends DefaultObjectPipe -1; } diff --git a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaDecoder.java b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaDecoder.java index 5e74f080a..315cd52cb 100644 --- a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaDecoder.java +++ b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaDecoder.java @@ -42,6 +42,9 @@ public final class FormetaDecoder extends private final FormetaParser parser = new FormetaParser(); private final Emitter emitter = new FullRecordEmitter(); + /** + * Creates an instance of {@link FormetaDecoder}. + */ public FormetaDecoder() { parser.setEmitter(emitter); } diff --git a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java index a1db1137f..440686f50 100644 --- a/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java +++ b/metafacture-formeta/src/main/java/org/metafacture/formeta/FormetaEncoder.java @@ -41,9 +41,17 @@ public final class FormetaEncoder extends DefaultStreamPipe extends DefaultSender implements ObjectPipe { + /** + * Creates an instance of {@link DefaultObjectPipe}. + */ public DefaultObjectPipe() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultObjectReceiver.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultObjectReceiver.java index 6c9999b77..dd23ae754 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultObjectReceiver.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultObjectReceiver.java @@ -34,6 +34,9 @@ */ public class DefaultObjectReceiver extends DefaultLifeCycle implements ObjectReceiver { + /** + * Creates an instance of {@link DefaultObjectReceiver}. + */ public DefaultObjectReceiver() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultSender.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultSender.java index a785fa213..e2dd4c27b 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultSender.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultSender.java @@ -39,9 +39,17 @@ public class DefaultSender implements Sender { private T receiver; private boolean isClosed; + /** + * Creates an instance of {@link DefaultSender}. + */ public DefaultSender() { } + /** + * Checks wether the DefaultSender is closed. + * + * @return true if the DefaultSender is closed + */ public final boolean isClosed() { return isClosed; } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamPipe.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamPipe.java index ac31632f6..913bc4ea2 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamPipe.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamPipe.java @@ -29,7 +29,9 @@ * @see ForwardingStreamPipe */ public class DefaultStreamPipe extends DefaultSender implements StreamPipe { - + /** + * Creates an instance of {@link DefaultStreamPipe}. + */ public DefaultStreamPipe() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamReceiver.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamReceiver.java index 88781c78b..fa4bf651b 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamReceiver.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultStreamReceiver.java @@ -31,7 +31,9 @@ * */ public class DefaultStreamReceiver extends DefaultLifeCycle implements StreamReceiver { - + /** + * Creates an instance of {@link DefaultStreamReceiver}. + */ public DefaultStreamReceiver() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultTee.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultTee.java index 6d73fe074..d7ee4843e 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultTee.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultTee.java @@ -34,6 +34,9 @@ public class DefaultTee implements Tee { private final List receivers = new ArrayList(); + /** + * Creates an instance of {@link DefaultTee}. + */ public DefaultTee() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java index a429fd094..894fea7fa 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java @@ -43,6 +43,9 @@ public class DefaultXmlPipe extends DefaultSender impleme public static final String DEFAULT_ROOT_TAG = "records"; public static final String DEFAULT_VALUE_TAG = "value"; + /** + * Creates an instance of {@link DefaultXmlPipe}. + */ public DefaultXmlPipe() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlReceiver.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlReceiver.java index 07bb1c0a6..00b1f3bf7 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlReceiver.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlReceiver.java @@ -40,6 +40,9 @@ */ public class DefaultXmlReceiver extends DefaultLifeCycle implements XmlReceiver { + /** + * Creates an instance of {@link DefaultXmlReceiver}. + */ public DefaultXmlReceiver() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/ForwardingStreamPipe.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/ForwardingStreamPipe.java index 2bffeb8c3..3e38ed59a 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/ForwardingStreamPipe.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/ForwardingStreamPipe.java @@ -29,6 +29,9 @@ */ public class ForwardingStreamPipe extends DefaultStreamPipe { + /** + * Creates an instance of {@link ForwardingStreamPipe}. + */ public ForwardingStreamPipe() { } diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java index 1e18b2010..e6edd8205 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/objects/Triple.java @@ -35,6 +35,13 @@ public final class Triple implements Comparable { private final int preCompHashCode; + /** + * Creates an instance of {@link Triple}. + * + * @param subject the subject + * @param predicate the predicate + * @param object the object + */ public Triple(final String subject, final String predicate, final String object) { this(subject, predicate, object, ObjectType.STRING); @@ -61,18 +68,38 @@ private int computeHashCode() { return Objects.hash(subject, predicate, object, objectType); } + /** + * Gets the subject. + * + * @return the subject + */ public String getSubject() { return subject; } + /** + * Gets the predicate + * + * @return the predicate + */ public String getPredicate() { return predicate; } + /** + * Gets the object. + * + * @return the object + */ public String getObject() { return object; } + /** + * Gets the object type. + * + * @return the {@link ObjectType} + */ public ObjectType getObjectType() { return objectType; } diff --git a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java index cf90248f4..eeb1e4397 100644 --- a/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java +++ b/metafacture-html/src/main/java/org/metafacture/html/HtmlDecoder.java @@ -68,6 +68,9 @@ public class HtmlDecoder extends DefaultObjectPipe { private Map attrValsAsSubfields; + /** + * Creates an instance of {@link HtmlDecoder}. + */ public HtmlDecoder() { setAttrValsAsSubfields(DEFAULT_ATTR_VALS_AS_SUBFIELDS); } diff --git a/metafacture-io/src/main/java/org/metafacture/io/ByteStreamFileWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ByteStreamFileWriter.java index 6032d860c..ff49334bd 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ByteStreamFileWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ByteStreamFileWriter.java @@ -27,6 +27,9 @@ public class ByteStreamFileWriter extends DefaultObjectReceiver { private OutputStream outputStream; + /** + * Creates an instance of {@link ByteStreamFileWriter}. + */ public ByteStreamFileWriter() { } diff --git a/metafacture-io/src/main/java/org/metafacture/io/CloseFailed.java b/metafacture-io/src/main/java/org/metafacture/io/CloseFailed.java index 53c60c42a..1a27a62ee 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/CloseFailed.java +++ b/metafacture-io/src/main/java/org/metafacture/io/CloseFailed.java @@ -2,14 +2,30 @@ public class CloseFailed extends IoFailed { + /** + * Creates an instance of {@link CloseFailed} by a given message. + * + * @param message the message + */ public CloseFailed(final String message) { super(message); } + /** + * Creates an instance of {@link CloseFailed} by a given cause. + * + * @param cause the {@link Throwable} + */ public CloseFailed(final Throwable cause) { super(cause); } + /** + * Creates an instance of {@link CloseFailed} by a given message and a cause. + * + * @param message the message + * @param cause the {@link Throwable} + */ public CloseFailed(final String message, final Throwable cause) { super(message, cause); } diff --git a/metafacture-io/src/main/java/org/metafacture/io/FileCompression.java b/metafacture-io/src/main/java/org/metafacture/io/FileCompression.java index 116fc3367..9f5cfa956 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/FileCompression.java +++ b/metafacture-io/src/main/java/org/metafacture/io/FileCompression.java @@ -202,10 +202,31 @@ public InputStream createDecompressor(final InputStream readFrom, final boolean private static final int BUFFER_SIZE = 8 * 1024 * 1024; + /** + * Creates a compressor. + * + * @param writeTo the {@link OutputStream} to write to + * @param fileName the filename + * @return the {@link OutputStream} + */ public abstract OutputStream createCompressor(OutputStream writeTo, String fileName); + /** + * Creates a decompressor. + * + * @param readFrom {the @link InputStream} to read from. + * @param decompressConcatenated true if decompress concatenated, otherwise + * false + * @return the {@link InputStream} + */ public abstract InputStream createDecompressor(InputStream readFrom, boolean decompressConcatenated); + /** + * Creates a decompressor. + * + * @param readFrom {the @link InputStream} to read from. + * @return the {@link InputStream} + */ public InputStream createDecompressor(final InputStream readFrom) { return createDecompressor(readFrom, DEFAULT_DECOMPRESS_CONCATENATED); } diff --git a/metafacture-io/src/main/java/org/metafacture/io/FileOpener.java b/metafacture-io/src/main/java/org/metafacture/io/FileOpener.java index 55abf99b4..b4104b119 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/FileOpener.java +++ b/metafacture-io/src/main/java/org/metafacture/io/FileOpener.java @@ -48,6 +48,9 @@ public final class FileOpener extends DefaultObjectPipe extends AbstractObjectWriter { private boolean firstObject = true; private boolean closed; + /** + * Creates an instance of {@link ObjectStdoutWriter}. + */ public ObjectStdoutWriter() { } diff --git a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java index 7f4a9ea75..6ce1c4436 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java +++ b/metafacture-io/src/main/java/org/metafacture/io/ObjectWriter.java @@ -63,6 +63,11 @@ public ObjectWriter(final String destination) { } } + /** + * Returns the available arguments. + * + * @return arguments + */ @ReturnsAvailableArguments public static Collection getArguments() { return ARGUMENTS; diff --git a/metafacture-io/src/main/java/org/metafacture/io/OpenFailed.java b/metafacture-io/src/main/java/org/metafacture/io/OpenFailed.java index 58e47ae2c..fd0be1032 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/OpenFailed.java +++ b/metafacture-io/src/main/java/org/metafacture/io/OpenFailed.java @@ -2,14 +2,30 @@ public class OpenFailed extends IoFailed { + /** + * Creates an instance of {@link OpenFailed} by a given message. + * + * @param message the message + */ public OpenFailed(final String message) { super(message); } + /** + * Creates an instance of {@link OpenFailed} by a given cause. + * + * @param cause the {@link Throwable} + */ public OpenFailed(final Throwable cause) { super(cause); } + /** + * Creates an instance of {@link OpenFailed} by a given message and a cause. + * + * @param message the message + * @param cause the {@link Throwable} + */ public OpenFailed(final String message, final Throwable cause) { super(message, cause); } diff --git a/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java b/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java index 8014b23a1..cbde07f82 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java +++ b/metafacture-io/src/main/java/org/metafacture/io/RecordReader.java @@ -53,6 +53,9 @@ public final class RecordReader extends DefaultObjectPipe> { + /** + * Creates an instance of {@link StdInOpener}. + */ public StdInOpener() { } diff --git a/metafacture-io/src/main/java/org/metafacture/io/TarReader.java b/metafacture-io/src/main/java/org/metafacture/io/TarReader.java index d3e3e9c49..07d7ccb4e 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/TarReader.java +++ b/metafacture-io/src/main/java/org/metafacture/io/TarReader.java @@ -47,6 +47,9 @@ @FluxCommand("open-tar") public class TarReader extends DefaultObjectPipe> { + /** + * Creates an instance of {@link TarReader}. + */ public TarReader() { } diff --git a/metafacture-io/src/main/java/org/metafacture/io/WriteFailed.java b/metafacture-io/src/main/java/org/metafacture/io/WriteFailed.java index 606de11ae..0bffa780d 100644 --- a/metafacture-io/src/main/java/org/metafacture/io/WriteFailed.java +++ b/metafacture-io/src/main/java/org/metafacture/io/WriteFailed.java @@ -2,14 +2,30 @@ public class WriteFailed extends IoFailed { + /** + * Creates an instance of {@link WriteFailed} by given message. + * + * @param message the message + */ public WriteFailed(final String message) { super(message); } + /** + * Creates an instance of {@link WriteFailed} by given cause. + * + * @param cause the {@link Throwable} + */ public WriteFailed(final Throwable cause) { super(cause); } + /** + * Creates an instance of {@link WriteFailed} by given message and cause. + * + * @param message the message + * @param cause the {@link Throwable} + */ public WriteFailed(final String message, final Throwable cause) { super(message, cause); } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/Collector.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/Collector.java index df463fe32..69dc770ae 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/Collector.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/Collector.java @@ -27,9 +27,19 @@ * */ public interface Collector { - + /** + * + * Gets the Collection. + * + * @return the Collection of collected data + */ Collection getCollection(); + /** + * Sets collection. + * + * @param collection the collection + */ void setCollection(Collection collection); } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/EventList.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/EventList.java index 72e250617..96ace4fc9 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/EventList.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/EventList.java @@ -34,13 +34,26 @@ public final class EventList implements StreamReceiver { private boolean closed; + /** + * Creates an instance of {@link EventList}. + */ public EventList() { } + /** + * Get events. + * + * @return the List of {@link Event} + */ public List getEvents() { return Collections.unmodifiableList(events); } + /** + * Check wether EventList is closed. + * + * @return true if EventList is closed. + */ public boolean isClosed() { return closed; } @@ -118,14 +131,29 @@ public enum Type { this.value = value; } + /** + * Gets the type. + * + * @return the type + */ public Type getType() { return type; } + /** + * Gets the name. + * + * @return the name + */ public String getName() { return name; } + /** + * Gets the value. + * + * @return the value + */ public String getValue() { return value; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java index b5f653b91..4d6f62557 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/MapToStream.java @@ -64,6 +64,9 @@ public final class MapToStream extends DefaultObjectPipe, StreamReceiv private Object idKey = StandardEventNames.ID; + /** + * Creates an instance of {@link MapToStream}. + */ public MapToStream() { } @@ -83,6 +86,11 @@ public void setIdKey(final Object idKey) { this.idKey = idKey; } + /** + * Gets the ID. + * + * @return the ID + */ public Object getIdKey() { return idKey; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java index 185439e78..c7a81d334 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueList.java @@ -36,6 +36,9 @@ public final class NamedValueList extends DefaultStreamReceiver implements List< private Collection> collection; private List list = new ArrayList<>(); + /** + * Creates an instance of {@link NamedValueList}. + */ public NamedValueList() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java index d2d9106d0..b89bf564c 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/NamedValueSet.java @@ -35,6 +35,9 @@ public final class NamedValueSet extends DefaultStreamReceiver implements Set> collection; private Set set = new HashSet<>(); + /** + * Creates an instance of {@link NamedValueSet}. + */ public NamedValueSet() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ObjectCollector.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ObjectCollector.java index a432afd8d..6b3764d0e 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ObjectCollector.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ObjectCollector.java @@ -36,14 +36,27 @@ public final class ObjectCollector implements ObjectReceiver { private boolean closed; + /** + * Creates an instance of {@link ObjectCollector}. + */ public ObjectCollector() { this(-1); } + /** + * Creates an instance of {@link ObjectCollector} by a given capacity. + * + * @param maxCapacity the maximal capacity + */ public ObjectCollector(final int maxCapacity) { this.maxCapacity = maxCapacity; } + /** + * Check wether ObjectCollector is closed. + * + * @return true if ObjectCollector is closed. + */ public boolean isClosed() { return closed; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/SingleValue.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/SingleValue.java index bb94b3d03..4d0c46d13 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/SingleValue.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/SingleValue.java @@ -21,7 +21,7 @@ import java.util.Collection; /** - * just records the value of the last received literal. + * Just records the value of the last received literal. * @author Markus Michael Geipel * */ @@ -31,14 +31,26 @@ public final class SingleValue extends DefaultStreamReceiver implements Collecto private String value = ""; private Collection collection; + /** + * Creates an instance of {@link SingleValue}. + */ public SingleValue() { - collection = null; } + /** + * Creates an instance of {@link SingleValue} by a given Collection. + * + * @param collection the Collection + */ public SingleValue(final Collection collection) { this.collection = collection; } + /** + * Check wether SingleValue is closed. + * + * @return true if SingleValue is closed. + */ public boolean isClosed() { return closed; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMap.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMap.java index 39f78f34c..2e075f8bd 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMap.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMap.java @@ -36,13 +36,26 @@ public final class StringListMap extends DefaultStreamReceiver implements Collec private Collection> collection; private ListMap listMap = new ListMap(); + /** + * Creates an instance of {@link StringListMap}. + */ public StringListMap() { } + /** + * Creates an instance of {@link StringListMap} by a given Collection. + * + * @param collection the Collection + */ public StringListMap(final Collection> collection) { this.collection = collection; } + /** + * Checks if StringListMap is closed. + * + * @return true if it is closed + */ public boolean isClosed() { return closed; } @@ -52,14 +65,27 @@ public void clear() { listMap.clear(); } + /** + * Removes a key in the map. + * + * @param key the key + */ public void removeKey(final String key) { listMap.removeKey(key); } + /** + * Clears a key in the map. + * + * @param key the key + */ public void clearKey(final String key) { listMap.clearKey(key); } + /** + * Clears all keys in the map. + */ public void clearAllKeys() { listMap.clearAllKeys(); } @@ -74,10 +100,22 @@ public Set keySet() { return listMap.keySet(); } + /** + * Adds a value to the List of values of the key in the map. + * + * @param name the key + * @param value the value + */ public void add(final String name, final String value) { listMap.add(name, value); } + /** + * Adds a List of values to a key in the map + * + * @param name the key + * @param addValues the {@link Collection} of values + */ public void putAll(final String name, final Collection addValues) { listMap.putAll(name, addValues); } @@ -97,10 +135,23 @@ public List get(final Object name) { return listMap.get(name); } + /** + * Checks wether a key exists. + * + * @param name the key + * @return true if the key exists, otherwise false + */ public boolean existsKey(final String name) { return listMap.existsKey(name); } + /** + * Gets the first element of the List of values of the key in the map or null + * + * @param name the name + * @return the first element of the List of values of the key in the map or + * null. + */ public String getFirst(final String name) { return listMap.getFirst(name); } @@ -110,10 +161,20 @@ public String toString() { return listMap.toString(); } + /** + * Sets the ID. + * + * @param identifier the ID + */ public void setId(final String identifier) { listMap.setId(identifier); } + /** + * Gets the ID. + * + * @return the ID + */ public String getId() { return listMap.getId(); } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java index 625cd2496..e776e5001 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringListMapToStream.java @@ -37,6 +37,9 @@ @FluxCommand("string-list-map-to-stream") public final class StringListMapToStream extends DefaultObjectPipe, StreamReceiver> { + /** + * Creates an instance of {@link StringListMapToStream}. + */ public StringListMapToStream() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java index e51557cce..5223551e3 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/StringMap.java @@ -35,6 +35,9 @@ public final class StringMap extends DefaultStreamReceiver implements Map> collection; private Map map = new HashMap<>(); + /** + * Creates an instance of {@link StringMap}. + */ public StringMap() { } @@ -58,6 +61,11 @@ protected void setMap(final Map map) { this.map = map; } + /** + * Checks if the StringMap is closed. + * + * @return true if StringMap is closed. + */ public boolean isClosed() { return closed; } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java index 23a2cd6fe..6b39b2f85 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/ValueSet.java @@ -34,6 +34,9 @@ public final class ValueSet extends DefaultStreamReceiver implements Set private Collection> collection = new HashSet<>(); private Set set; + /** + * Creates an instance of {@link ValueSet}. + */ public ValueSet() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/MetafactureSource.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/MetafactureSource.java index 6b5280924..0b3c271eb 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/MetafactureSource.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/MetafactureSource.java @@ -27,7 +27,11 @@ * */ public interface MetafactureSource { - + /** + * Sends received events to this stream. + * + * @param streamReceiver the {@link StreamReceiver} + */ void sendToStream(StreamReceiver streamReceiver); } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoDecoder.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoDecoder.java index 1a473dfe9..71a594962 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoDecoder.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoDecoder.java @@ -80,6 +80,9 @@ public class PojoDecoder extends DefaultObjectPipe { private final TypeDecoderFactory typeDecoderFactory = new TypeDecoderFactory(); + /** + * Creates an instance of {@link PojoDecoder}. + */ public PojoDecoder() { } diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java index 6f72ba333..b7396da2f 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java @@ -54,6 +54,11 @@ public class PojoEncoder extends DefaultStreamPipe> { private final Deque typeEncoderStack = new ArrayDeque<>(); private final Class pojoClass; + /** + * Creates an instance of {@link PojoEncoder} by a given Class. + * + * @param pojoClass the Class + */ public PojoEncoder(final Class pojoClass) { this.pojoClass = pojoClass; } diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java b/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java index 8bf937c91..934a39938 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonDecoder.java @@ -67,57 +67,123 @@ public final class JsonDecoder extends DefaultObjectPipe private int recordCount; + /** + * Creates an instance of {@link JsonDecoder}. + */ public JsonDecoder() { } + /** + * Flags wether to allow comments. + * + * @param allowComments true if comments should be allowed + */ public void setAllowComments(final boolean allowComments) { jsonFactory.configure(JsonParser.Feature.ALLOW_COMMENTS, allowComments); } + /** + * Checks if comments are allowed. + * + * @return true if comments are allowed + */ public boolean getAllowComments() { return jsonFactory.isEnabled(JsonParser.Feature.ALLOW_COMMENTS); } + /** + * Sets the array marker. + * + * @param arrayMarker the array marker + */ public void setArrayMarker(final String arrayMarker) { this.arrayMarker = arrayMarker; } + /** + * Gets the array marker. + * + * @return the array marker + */ public String getArrayMarker() { return arrayMarker; } + /** + * Sets the name of the array. + * + * @param arrayName the name of the array + */ public void setArrayName(final String arrayName) { this.arrayName = arrayName; } + /** + * Gets the name of the array. + * + * @return the name of the array + */ public String getArrayName() { return arrayName; } + /** + * Sets the ID of the record. + * + * @param recordId the ID of the record + */ public void setRecordId(final String recordId) { this.recordId = recordId; } + /** + * Gets the ID of the record. + * + * @return the ID of the record + */ public String getRecordId() { return recordId; } + /** + * Sets the record count. + * + * @param recordCount the record count + */ public void setRecordCount(final int recordCount) { this.recordCount = recordCount; } + /** + * Gets the record count. + * + * @return the record count + */ public int getRecordCount() { return recordCount; } + /** + * Sets the record path. + * + * @param recordPath the record path + */ public void setRecordPath(final String recordPath) { this.recordPath = recordPath; } + /** + * Gets the record path. + * + * @return the record path + */ public String getRecordPath() { return recordPath; } + /** + * Resets the record count. + */ public void resetRecordCount() { setRecordCount(0); } diff --git a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java index 8947662e5..919fdd3f0 100644 --- a/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java +++ b/metafacture-json/src/main/java/org/metafacture/json/JsonEncoder.java @@ -76,18 +76,38 @@ public JsonEncoder() { } } + /** + * Sets the array marker. + * + * @param arrayMarker the array marker + */ public void setArrayMarker(final String arrayMarker) { this.arrayMarker = arrayMarker; } + /** + * Gets the array marker. + * + * @return the array marker + */ public String getArrayMarker() { return arrayMarker; } + /** + * Flags wether to use pretty printing. + * + * @param prettyPrinting true if pretty printing should be used + */ public void setPrettyPrinting(final boolean prettyPrinting) { jsonGenerator.setPrettyPrinter(prettyPrinting ? new DefaultPrettyPrinter((SerializableString) null) : null); } + /** + * Checks if the {@link JsonGenerator} has a pretty printer. + * + * @return true if {@link JsonGenerator} has a pretty printer. + */ public boolean getPrettyPrinting() { return jsonGenerator.getPrettyPrinter() != null; } diff --git a/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/BeaconReader.java b/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/BeaconReader.java index 9a9ce94ae..50464b24b 100644 --- a/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/BeaconReader.java +++ b/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/BeaconReader.java @@ -43,6 +43,7 @@ @Out(StreamReceiver.class) @FluxCommand("read-beacon") public final class BeaconReader extends DefaultObjectPipe { + public static final String DEFAULT_RELATION = "seeAlso"; private static final int MB = 1024 * 1024; private static final int BUFFER_SIZE = MB * 2; @@ -51,27 +52,40 @@ public final class BeaconReader extends DefaultObjectPipe } } + /** + * Creates an instance of {@link OreAggregationAdder}. + */ public OreAggregationAdder() { } diff --git a/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/RdfMacroPipe.java b/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/RdfMacroPipe.java index 0f947bfe8..870a26847 100644 --- a/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/RdfMacroPipe.java +++ b/metafacture-linkeddata/src/main/java/org/metafacture/linkeddata/RdfMacroPipe.java @@ -42,9 +42,17 @@ public final class RdfMacroPipe extends DefaultStreamPipe { public static final String XML_LANG = "~xml:lang"; private String autoAddedSubject = ""; + /** + * Creates an instance of {@link RdfMacroPipe}. + */ public RdfMacroPipe() { } + /** + * Flas wether to auto add the subject. + * + * @param autoAddedSubject true if subject shoudl be auto added + */ public void setAutoAddedSubject(final String autoAddedSubject) { this.autoAddedSubject = autoAddedSubject; } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/DuplicateObjectFilter.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/DuplicateObjectFilter.java index d8f40b58a..9c11585df 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/DuplicateObjectFilter.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/DuplicateObjectFilter.java @@ -39,6 +39,9 @@ public final class DuplicateObjectFilter extends DefaultObjectPipe extends private String recordId = DEFAULT_RECORD_ID; private int recordCount; + /** + * Creates an instance of {@link ObjectToLiteral}. + */ public ObjectToLiteral() { } + /** + * Sets the literal name. + * + * @param literalName the literal name + */ public void setLiteralName(final String literalName) { this.literalName = literalName; } + /** + * Sets the record ID. + * + * @param recordId the record ID + */ public void setRecordId(final String recordId) { this.recordId = recordId; } + /** + * Gets the literal name. + * + * @return the literal name + */ public String getLiteralName() { return literalName; } + /** + * Gets the record ID. + * + * @return the record ID + */ public String getRecordId() { return recordId; } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java index 77af241ef..43212622c 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java @@ -79,6 +79,9 @@ public final class RecordIdChanger extends DefaultStreamPipe { private boolean keepRecordsWithoutIdLiteral = true; private boolean keepIdLiteral; + /** + * Creates an instance of {@link RecordIdChanger}. + */ public RecordIdChanger() { } @@ -103,6 +106,11 @@ public void setIdLiteral(final String idLiteral) { this.idLiteral = idLiteral; } + /** + * Gets the ID literal. + * + * @return the ID literal. + */ public String getIdLiteral() { return idLiteral; } @@ -124,6 +132,11 @@ public void setKeepRecordsWithoutIdLiteral( this.keepRecordsWithoutIdLiteral = keepRecordsWithoutIdLiteral; } + /** + * Checks wether to keep records without ID literal. + * + * @return true if records without ID literal should be kept + */ public boolean getKeepRecordsWithoutIdLiteral() { return keepRecordsWithoutIdLiteral; } @@ -145,6 +158,11 @@ public void setKeepIdLiteral(final boolean keepIdLiteral) { this.keepIdLiteral = keepIdLiteral; } + /** + * Checks wether the ID literal should be kept. + * + * @return true if the ID literal should be kept + */ public boolean getKeepIdLiteral() { return keepIdLiteral; } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java index 6700223cf..44b017b60 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java @@ -45,6 +45,9 @@ public final class RecordPathFilter extends DefaultStreamPipe { private boolean recordStarted; private int recordCount; + /** + * Creates an instance of {@link RecordPathFilter}. + */ public RecordPathFilter() { } @@ -57,26 +60,56 @@ public RecordPathFilter(final String path) { setPath(path); } + /** + * Sets the entity separator. + * + * @param entitySeparator the entity separator + */ public void setEntitySeparator(final String entitySeparator) { entityPathTracker.setEntitySeparator(entitySeparator); } + /** + * Get the entity separator. + * + * @return the entity separator + */ public String getEntitySeparator() { return entityPathTracker.getEntitySeparator(); } + /** + * Sets the path. + * + * @param path the path + */ public void setPath(final String path) { this.path = path; } + /** + * Gets the path. + * + * @return the path + */ public String getPath() { return path; } + /** + * Sets the record ID format. + * + * @param recordIdFormat the record ID format + */ public void setRecordIdFormat(final String recordIdFormat) { this.recordIdFormat = recordIdFormat; } + /** + * Gets the record ID format. + * + * @return the record ID format + */ public String getRecordIdFormat() { return recordIdFormat; } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java index 31d4fd235..b1c0e18e0 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordToEntity.java @@ -48,9 +48,17 @@ public class RecordToEntity extends ForwardingStreamPipe { private String entityName = DEFAULT_ENTITY_NAME; private String idLiteralName; + /** + * Creates an instance of {@link RecordToEntity}. + */ public RecordToEntity() { } + /** + * Gets the entity name. + * + * @return the entity name + */ public String getEntityName() { return entityName; } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamEventDiscarder.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamEventDiscarder.java index f94f88589..0500bb5ce 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamEventDiscarder.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamEventDiscarder.java @@ -49,6 +49,9 @@ public class StreamEventDiscarder implements StreamPipe { private EnumSet discardedEvents = EnumSet.noneOf(EventType.class); + /** + * Creates an instance of {@link StreamEventDiscarder}. + */ public StreamEventDiscarder() { } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamFlattener.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamFlattener.java index aabf055f5..d2022c440 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamFlattener.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/StreamFlattener.java @@ -62,14 +62,27 @@ public final class StreamFlattener extends DefaultStreamPipe { private final EntityPathTracker pathTracker = new EntityPathTracker(); + /** + * Creates an instance of {@link StreamFlattener}. + */ public StreamFlattener() { setEntityMarker(DEFAULT_ENTITY_MARKER); } + /** + * Gets the entity marker. + * + * @return the entity marker + */ public String getEntityMarker() { return pathTracker.getEntitySeparator(); } + /** + * Sets the entity marker. + * + * @param entityMarker the entity marker + */ public void setEntityMarker(final String entityMarker) { pathTracker.setEntitySeparator(entityMarker); } @@ -106,10 +119,20 @@ public void literal(final String name, final String value) { getReceiver().literal(pathTracker.getCurrentPathWith(name), value); } + /** + * Gets the current entity name. + * + * @return the current entity name + */ public String getCurrentEntityName() { return pathTracker.getCurrentEntityName(); } + /** + * Gets the current path. + * + * @return the current path + */ public String getCurrentPath() { return pathTracker.getCurrentPath(); } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java index 0a206ba59..fe6b89730 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectBatchLogger.java @@ -62,13 +62,18 @@ public final class ObjectBatchLogger extends DefaultObjectPipe private final String logPrefix; + /** + * Creates an instance of {@link ObjectLogger}. + */ public ObjectLogger() { this(""); } + /** + * Creates an instance of {@link ObjectLogger} by a given prefix of the log + * messages. + * + * @param logPrefix the prefix of the log messages + */ public ObjectLogger(final String logPrefix) { this.logPrefix = logPrefix; } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectTimer.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectTimer.java index 40021a5c5..52f565006 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectTimer.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/ObjectTimer.java @@ -38,10 +38,18 @@ public final class ObjectTimer extends TimerBase> implements ObjectPipe> { + /** + * Creates an instance of {@link ObjectTimer}. + */ public ObjectTimer() { this(""); } + /** + * Creates an instance of {@link ObjectTimer} by a given log messages prefix. + * + * @param logPrefix the prefix of the log messages + */ public ObjectTimer(final String logPrefix) { super(logPrefix); } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java index 8997fd863..2536f8d34 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamBatchLogger.java @@ -46,15 +46,13 @@ public final class StreamBatchLogger extends ForwardingStreamPipe { public static final String BATCH_COUNT_VAR = "batches"; public static final String BATCH_SIZE_VAR = "batchSize"; public static final String TOTAL_RECORD_COUNT_VAR = "totalRecords"; + public static final String DEFAULT_FORMAT = "records processed: ${totalRecords}"; public static final long DEFAULT_BATCH_SIZE = 1000; private static final Logger LOG = LoggerFactory.getLogger(StreamBatchLogger.class); - private static final String DEFAULT_FORMAT = - "records processed: ${totalRecords}"; - private final Map vars = new HashMap<>(); private final String format; @@ -62,10 +60,19 @@ public final class StreamBatchLogger extends ForwardingStreamPipe { private long recordCount; private long batchCount; + /** + * Creates an instance of {@link StreamBatchLogger} by a given format. The + * default format: {@value #DEFAULT_FORMAT} + */ public StreamBatchLogger() { this.format = DEFAULT_FORMAT; } + /** + * Creates an instance of {@link StreamBatchLogger} by a given format. + * + * @param format the format + */ public StreamBatchLogger(final String format) { this.format = format; } @@ -81,18 +88,38 @@ public StreamBatchLogger(final String format, final Map vars) { this.vars.putAll(vars); } + /** + * Sets the batch size. + * + * @param batchSize the batch size + */ public void setBatchSize(final int batchSize) { this.batchSize = batchSize; } + /** + * Gets the batch size. + * + * @return the batch size + */ public long getBatchSize() { return batchSize; } + /** + * Gets the batch count. + * + * @return the batch count + */ public long getBatchCount() { return batchCount; } + /** + * Gets the record count. + * + * @return the record count + */ public long getRecordCount() { return recordCount; } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamLogger.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamLogger.java index db6960e9a..071c97d63 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamLogger.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamLogger.java @@ -45,10 +45,19 @@ public final class StreamLogger private final String logPrefix; + /** + * Creates an instance of {@link StreamLogger}. + */ public StreamLogger() { this(""); } + /** + * Creates an instance of {@link StreamLogger} by a given prefix used when log + * messages. + * + * @param logPrefix the prefix of the log messages + */ public StreamLogger(final String logPrefix) { this.logPrefix = logPrefix; } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamTimer.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamTimer.java index 9a6690873..bfe59559f 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamTimer.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/StreamTimer.java @@ -35,10 +35,19 @@ public final class StreamTimer extends TimerBase implements StreamPipe { + /** + * Creates an instance of {@link StreamTimer}. + */ public StreamTimer() { this(""); } + /** + * Creates an instance of {@link StreamTimer} by a given prefix used when log + * messages. + * + * @param logPrefix the prefix of the log messages + */ public StreamTimer(final String logPrefix) { super(logPrefix); } diff --git a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/TimerBase.java b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/TimerBase.java index bfaeb9e2a..02201201d 100644 --- a/metafacture-monitoring/src/main/java/org/metafacture/monitoring/TimerBase.java +++ b/metafacture-monitoring/src/main/java/org/metafacture/monitoring/TimerBase.java @@ -51,6 +51,11 @@ public final S setReceiver(final S newReceiver) { return newReceiver; } + /** + * Gets the receiver. + * + * @return the receiver + */ public final R getReceiver() { return receiver; } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/IdentityStreamPipe.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/IdentityStreamPipe.java index 89f6a26f5..e68909440 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/IdentityStreamPipe.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/IdentityStreamPipe.java @@ -34,6 +34,9 @@ @FluxCommand("pass-through") public final class IdentityStreamPipe extends ForwardingStreamPipe { + /** + * Creates an instance of {@link IdentityStreamPipe}. + */ public IdentityStreamPipe() { } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/ObjectTee.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/ObjectTee.java index 53e1bee0f..41fbfac8b 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/ObjectTee.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/ObjectTee.java @@ -38,6 +38,9 @@ @FluxCommand("object-tee") public final class ObjectTee extends DefaultTee> implements ObjectPipe> { + /** + * Creates an instance of {@link ObjectTee}. + */ public ObjectTee() { } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamBatchMerger.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamBatchMerger.java index 7b5245c3e..c422ab23a 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamBatchMerger.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamBatchMerger.java @@ -45,6 +45,9 @@ public final class StreamBatchMerger extends DefaultStreamPipe { private long batchSize = DEFAULT_BATCH_SIZE; private long recordCount; + /** + * Creates an instance of {@link StreamBatchMerger}. + */ public StreamBatchMerger() { } @@ -61,6 +64,11 @@ public void setBatchSize(final long batchSize) { this.batchSize = batchSize; } + /** + * Gets the batch size. + * + * @return the batch size. + */ public long getBatchSize() { return batchSize; } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamMerger.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamMerger.java index b6876f46c..ee6823988 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamMerger.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamMerger.java @@ -43,6 +43,9 @@ public final class StreamMerger extends DefaultStreamPipe { private boolean hasRecordsReceived; private String currentId = ""; + /** + * Creates an instance of {@link StreamMerger}. + */ public StreamMerger() { } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamTee.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamTee.java index cc82f257c..9dc76b1ae 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamTee.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/StreamTee.java @@ -36,6 +36,9 @@ @FluxCommand("stream-tee") public final class StreamTee extends DefaultTee implements StreamPipe { + /** + * Creates an instance of {@link StreamTee}. + */ public StreamTee() { } diff --git a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/XmlTee.java b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/XmlTee.java index cae1bed57..1ea7059b7 100644 --- a/metafacture-plumbing/src/main/java/org/metafacture/plumbing/XmlTee.java +++ b/metafacture-plumbing/src/main/java/org/metafacture/plumbing/XmlTee.java @@ -44,6 +44,9 @@ @FluxCommand("xml-tee") public final class XmlTee extends DefaultTee implements XmlPipe { + /** + * Creates an instance of {@link XmlTee}. + */ public XmlTee() { } diff --git a/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java b/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java index 625a453f4..2620dbcb1 100644 --- a/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java +++ b/metafacture-runner/src/main/java/org/metafacture/runner/util/DirectoryClassLoader.java @@ -45,6 +45,12 @@ public boolean accept(final File dir, final String name) { } }; + /** + * Creates an instance of {@link DirectoryClassLoader} by a given parent + * ClassLoader. + * + * @param parent the {@link ClassLoader} + */ public DirectoryClassLoader(final ClassLoader parent) { super(new URL[0], parent); } diff --git a/metafacture-scripting/src/main/java/org/metafacture/scripting/JScriptObjectPipe.java b/metafacture-scripting/src/main/java/org/metafacture/scripting/JScriptObjectPipe.java index 80f681cb1..223e9cd11 100644 --- a/metafacture-scripting/src/main/java/org/metafacture/scripting/JScriptObjectPipe.java +++ b/metafacture-scripting/src/main/java/org/metafacture/scripting/JScriptObjectPipe.java @@ -47,10 +47,21 @@ public final class JScriptObjectPipe extends DefaultObjectPipe { private int numEntities; private int numLiterals; + /** + * Creates an instance of {@link Counter}. + */ public Counter() { } diff --git a/metafacture-statistics/src/main/java/org/metafacture/statistics/Histogram.java b/metafacture-statistics/src/main/java/org/metafacture/statistics/Histogram.java index 56e99ba03..aad68b840 100644 --- a/metafacture-statistics/src/main/java/org/metafacture/statistics/Histogram.java +++ b/metafacture-statistics/src/main/java/org/metafacture/statistics/Histogram.java @@ -29,17 +29,21 @@ */ public final class Histogram extends DefaultStreamReceiver { - private final Map histogram = new HashMap(); + private final Map histogram = new HashMap<>(); private boolean countEntities; private boolean countLiterals; private String countField; + /** + * Creates an instance of {@link Histogram}. + */ public Histogram() { } /** - * Initialises the module with a countField. + * Creates an instance of {@link Histogram} with a field whose content is + * counted. * * @param countField name of the field whose content is counted */ @@ -47,30 +51,65 @@ public Histogram(final String countField) { setCountField(countField); } + /** + * Gets the histogram. + * + * @return the histogram + */ public Map getHistogram() { return Collections.unmodifiableMap(histogram); } + /** + * Checks wether entities are counted. + * + * @return true if entities are counted. + */ public boolean isCountEntities() { return countEntities; } + /** + * Flags wether entities should be counted. + * + * @param countEntities true if entities should be counted. + */ public void setCountEntities(final boolean countEntities) { this.countEntities = countEntities; } + /** + * Checks wether literals are counted. + * + * @return true if literals are counted + */ public boolean isCountLiterals() { return countLiterals; } + /** + * Flags wether to count literals. + * + * @param countLiterals true if literals should be counted + */ public void setCountLiterals(final boolean countLiterals) { this.countLiterals = countLiterals; } + /** + * Gets the name of the field whose content is counted. + * + * @return the name of the field whose content is counted + */ public String getCountField() { return countField; } + /** + * Set the name of the field whose content is counted. + * + * @param countField the name of the field whose content is counted + */ public void setCountField(final String countField) { this.countField = countField; } diff --git a/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java b/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java index 7eddc8f7d..51cad1b0e 100644 --- a/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java +++ b/metafacture-statistics/src/main/java/org/metafacture/statistics/UniformSampler.java @@ -50,7 +50,7 @@ public final class UniformSampler extends private long count; /** - * Constructs a UniformSampler with a given sample size. + * Creates an instance of {@link UniformSampler} with a given sample size. * * @param sampleSize the size of the sample */ @@ -59,14 +59,29 @@ public UniformSampler(final int sampleSize) { sample = new ArrayList(sampleSize); } + /** + * Creates an instance of {@link UniformSampler} with a given sample size. + * + * @param sampleSize the sample size + */ public UniformSampler(final String sampleSize) { this(Integer.parseInt(sampleSize)); } + /** + * Gets the sample size. + * + * @return the sample size. + */ public int getSampleSize() { return sampleSize; } + /** + * Sets the seed. + * + * @param seed the seed. + */ public void setSeed(final long seed) { random.setSeed(seed); } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java b/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java index 190a07d48..97101dfa4 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java @@ -43,9 +43,17 @@ public final class LineRecorder implements ObjectPipe receiver; private boolean isClosed; + /** + * Creates an instance of {@link LineRecorder}. + */ public LineRecorder() { } + /** + * Sets the record marker regexp. + * + * @param regexp the regexp + */ public void setRecordMarkerRegexp(final String regexp) { recordMarkerRegexp = regexp; } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/LineSplitter.java b/metafacture-strings/src/main/java/org/metafacture/strings/LineSplitter.java index 40840fb14..d23823ec7 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/LineSplitter.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/LineSplitter.java @@ -40,6 +40,9 @@ public final class LineSplitter extends DefaultObjectPipe * This parameter may be changed at any time. It becomes immediately * effective and affects all subsequently received start-record * events. * - * @param normalizeIds if true identifiers are normalised, otherwise not. + * @param normalizeIds if true identifiers are normalized, otherwise not. */ public void setNormalizeIds(final boolean normalizeIds) { this.normalizeIds = normalizeIds; } + /** + * Checks wether IDs should be normalized. + * + * @return true if IDs should be normalized + */ public boolean getNormalizeIds() { return normalizeIds; } /** - * Controls whether to normalise literal and entity names. By default these - * are not normalised. + * Controls whether to normalize literal and entity names. By default these + * are not normalized. *

    * This parameter may be changed at any time. It becomes immediately * effective and affects all subsequently received start-entity and * literal events. * - * @param normalizeKeys if true literal and entity names are normalised, + * @param normalizeKeys if true literal and entity names are normalized, * otherwise not. */ public void setNormalizeKeys(final boolean normalizeKeys) { this.normalizeKeys = normalizeKeys; } + /** + * Checks wether keys should be normalized. + * + * @return true if the keys should be normalized + */ public boolean getNormalizeKeys() { return normalizeKeys; } /** * Controls whether to normalise literal values. By default these are - * normalised. + * normalized. *

    * This parameter may be changed at any time. It becomes immediately * effective and affects all subsequently received literal events. * - * @param normalizeValues if true literal values are normalised, otherwise + * @param normalizeValues if true literal values are normalized, otherwise * not. */ public void setNormalizeValues(final boolean normalizeValues) { this.normalizeValues = normalizeValues; } + /** + * Checks wether values should be normalized. + * + * @return true if values should be normalized + */ public boolean getNormalizeValues() { return normalizeValues; } @@ -131,6 +149,11 @@ public void setNormalizationForm( this.normalizationForm = normalizationForm; } + /** + * Gets the normalization form. + * + * @return the {@link Normalizer.Form} + */ public Normalizer.Form getNormalizationForm() { return normalizationForm; } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StringConcatenator.java b/metafacture-strings/src/main/java/org/metafacture/strings/StringConcatenator.java index 64d727c02..81d9bffd2 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StringConcatenator.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StringConcatenator.java @@ -19,16 +19,18 @@ import org.metafacture.framework.ObjectReceiver; /** - * concatenetes all recieved Strings + * Concatenates all received Strings. * * @author markus geipel - * */ public final class StringConcatenator implements ObjectReceiver { private StringBuilder builder = new StringBuilder(); private String separator = ""; + /** + * Creates an instance of {@link StringConcatenator}. + */ public StringConcatenator() { } @@ -37,6 +39,11 @@ public void resetStream() { reset(); } + /** + * Sets a separator. + * + * @param separator the separator + */ public void setSeparator(final String separator) { this.separator = separator; } @@ -52,10 +59,18 @@ public void process(final String obj) { builder.append(obj); } + /** + * Resets the content. + */ public void reset() { builder = new StringBuilder(); } + /** + * Gets the string. + * + * @return the string + */ public String getString() { return builder.toString(); } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StringDecoder.java b/metafacture-strings/src/main/java/org/metafacture/strings/StringDecoder.java index 85a0c9585..cac25605e 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StringDecoder.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StringDecoder.java @@ -39,9 +39,8 @@ public final class StringDecoder extends DefaultObjectPipe> { /** - * determines whether string is split by the regexp or parts matching the - * regexp are extracted - * + * Determines whether the string is split by the regexp or parts matching the + * regexp are extracted. */ public enum Mode { SPLIT, EXTRACT @@ -51,10 +50,20 @@ public enum Mode { private final Pattern pattern; + /** + * Creates an instance of {@link StringDecoder} by a given pattern. + * + * @param pattern the pattern + */ public StringDecoder(final String pattern) { this.pattern = Pattern.compile(pattern); } + /** + * Sets the Mode. + * + * @param mode the {@link Mode} + */ public void setMode(final Mode mode) { this.mode = mode; } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StringFilter.java b/metafacture-strings/src/main/java/org/metafacture/strings/StringFilter.java index c91d026d2..2bb6f065b 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StringFilter.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StringFilter.java @@ -33,7 +33,7 @@ * @author Christoph Böhme * */ -@Description("Only forwards records which match (or do not match) a regular expression given in the constructor") +@Description("Only forwards records which match (or do not match) a regular expression.") @In(String.class) @Out(String.class) @FluxCommand("filter-strings") @@ -43,18 +43,38 @@ public final class StringFilter extends private final Matcher matcher; private boolean passMatches = true; + /** + * Creates an instance of {@link StringFilter} by a given pattern. + * + * @param pattern the pattern + */ public StringFilter(final String pattern) { this.matcher = Pattern.compile(pattern).matcher(""); } + /** + * Gets the pattern. + * + * @return the pattern + */ public String getPattern() { return matcher.pattern().pattern(); } + /** + * Checks wether matches are passed. + * + * @return true if matches should pass + */ public boolean isPassMatches() { return passMatches; } + /** + * Flags wether to pass matches or, inversely, pass everything but the matches. + * + * @param passMatches true if matches should pass, otherwise false + */ public void setPassMatches(final boolean passMatches) { this.passMatches = passMatches; } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StringMatcher.java b/metafacture-strings/src/main/java/org/metafacture/strings/StringMatcher.java index f0c791310..f4b2fa260 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StringMatcher.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StringMatcher.java @@ -41,21 +41,44 @@ public final class StringMatcher extends DefaultObjectPipe> { + /** + * Creates an instance of {@link StringReader}. + */ public StringReader() { } diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java b/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java index 8163bb18b..4e0165bfa 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java @@ -47,6 +47,9 @@ public final class UnicodeNormalizer extends DefaultObjectPipe createComparator() { return createComparator(compare, order, numeric); } + /** + * Creates an alphanumeric Comparator. + * + * @param compare one of {@link Compare} + * @param order the {@link Order} + * @return a Comparator of type Triple + */ public static Comparator createComparator(final Compare compare, final Order order) { return createComparator(compare, order, false); } diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java index 1d8c9c750..9c29f5e39 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/SortedTripleFileFacade.java @@ -27,6 +27,8 @@ import java.io.ObjectInputStream; /** + * A SortedTripleFileFacade created with a file. Reads a Triple from the file. + * * @author markus geipel * */ @@ -50,6 +52,11 @@ public SortedTripleFileFacade(final File file) throws IOException { next(); } + /** + * Checks wether SortedTripleFileFacade is empty. + * + * @return true if SortedTripleFileFacade is empty. + */ public boolean isEmpty() { return empty; } diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java b/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java index 727245cc9..6173c7623 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/StreamToTriples.java @@ -83,21 +83,44 @@ public final class StreamToTriples extends DefaultStreamPipe comparator; + /** + * Creates an instance of {@link TripleCount}. + */ public TripleCount() { } @@ -65,6 +68,11 @@ protected void sortedTriple(final Triple triple) { } } + /** + * Flags wether predicates should be counted. + * + * @param countPredicate true if predicates should be counted + */ public void setCountPredicate(final String countPredicate) { this.countPredicate = countPredicate; } @@ -93,6 +101,11 @@ private void writeResult() { } } + /** + * Compare triples by subject, predicate or object. + * + * @param countBy the {@link AbstractTripleSort.Compare} to sort by + */ public void setCountBy(final Compare countBy) { setCompare(countBy); } diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/TripleFilter.java b/metafacture-triples/src/main/java/org/metafacture/triples/TripleFilter.java index 68743441c..901f86e6d 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/TripleFilter.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/TripleFilter.java @@ -48,37 +48,80 @@ public final class TripleFilter extends DefaultObjectPipe { private Charset encoding = StandardCharsets.UTF_8; + /** + * Creates an instance of {@link TripleObjectWriter} with a given directory to + * write to. + * + * @param baseDir the path to the base directory + */ public TripleObjectWriter(final String baseDir) { this.baseDir = Paths.get(baseDir); } diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/TripleReader.java b/metafacture-triples/src/main/java/org/metafacture/triples/TripleReader.java index 935d6467d..fc0711590 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/TripleReader.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/TripleReader.java @@ -29,6 +29,8 @@ import java.io.ObjectInputStream; /** + * Reads triples. + * * @author Christoph Böhme * */ @@ -37,6 +39,9 @@ public final class TripleReader extends DefaultObjectPipe { private static final String VERSION = "1.0"; + /** + * Creates an instance of {@link CGXmlHandler}. + */ public CGXmlHandler() { } diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java index c6cd14dce..b81193d04 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java @@ -94,14 +94,29 @@ public void setRecordTagName(final String recordTagName) { this.recordTagName = recordTagName; } + /** + * Gets the record tag name. + * + * @return the record tag name. + */ public String getRecordTagName() { return recordTagName; } + /** + * Sets the value tag name. + * + * @param valueTagName the value tag name + */ public void setValueTagName(final String valueTagName) { this.valueTagName = valueTagName; } + /** + * Gets the value tag name. + * + * @return the value tag name + */ public String getValueTagName() { return valueTagName; } @@ -111,7 +126,7 @@ public String getValueTagName() { * will be passed through as "foo:bar". For backward compatibility the default * is set to "false", thus only "bar" is emitted. *

    - * Default value: {@value EMIT_NAMESPACE} + * Default value: {@value #EMIT_NAMESPACE} * * @param emitNamespace set to "true" if namespace should be emitted. Defaults * to "false". @@ -120,14 +135,29 @@ public void setEmitNamespace(final boolean emitNamespace) { this.emitNamespace = emitNamespace; } + /** + * Checks wether the namespace should be emitted. + * + * @return true if the namespace should be emitted + */ public boolean getEmitNamespace() { return this.emitNamespace; } + /** + * Sets the attribute marker. + * + * @param attributeMarker the attribute marker + */ public void setAttributeMarker(final String attributeMarker) { this.attributeMarker = attributeMarker; } + /** + * Gets the attribute marker. + * + * @return the attribute marker + */ public String getAttributeMarker() { return attributeMarker; } diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java index 2ca4016b2..3e12f083f 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java @@ -40,7 +40,7 @@ /** * - * Encodes a stream as XML + * Encodes a stream as XML. * * @author Markus Michael Geipel * @author Christoph Böhme @@ -86,21 +86,44 @@ public final class SimpleXmlEncoder extends DefaultStreamPipe namespaces) { this.namespaces = namespaces; } + /** + * Sets the attribute marker. + * + * @param attributeMarker the attribute marker. + */ public void setAttributeMarker(final String attributeMarker) { this.attributeMarker = attributeMarker; } + /** + * Gets the attribute marker. + * + * @return the attribute marker + */ public String getAttributeMarker() { return attributeMarker; } diff --git a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java index 69d434de5..b813b85d9 100644 --- a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java +++ b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlDecoder.java @@ -61,41 +61,90 @@ public final class YamlDecoder extends DefaultObjectPipe private String recordId = DEFAULT_RECORD_ID; private int recordCount; + /** + * Creates an instance of {@link YamlDecoder}. + */ public YamlDecoder() { } + /** + * Sets the array marker. Default value: + * {@value #DEFAULT_ARRAY_MARKER} + * + * @param arrayMarker the marker of the array + */ public void setArrayMarker(final String arrayMarker) { this.arrayMarker = arrayMarker; } + /** + * Gets the array marker. + * + * @return the array marker + */ public String getArrayMarker() { return arrayMarker; } + /** + * Sets the name of the array. Default value: + * {@value #DEFAULT_ARRAY_NAME} + * + * @param arrayName the name of the array + */ public void setArrayName(final String arrayName) { this.arrayName = arrayName; } + /** + * Gets the name of the array. + * + * @return the name of the array + */ public String getArrayName() { return arrayName; } + /** + * Sets the record ID. Default value: + * {@value #DEFAULT_RECORD_ID} + * + * @param recordId the record ID + */ public void setRecordId(final String recordId) { this.recordId = recordId; } + /** + * Get the record ID. + * + * @return the record ID + */ public String getRecordId() { return recordId; } + /** + * Sets the record count. + * + * @param recordCount the record count. + */ public void setRecordCount(final int recordCount) { this.recordCount = recordCount; } + /** + * Gets the record count. + * + * @return the record count + */ public int getRecordCount() { return recordCount; } + /** + * Resets the record count. + */ public void resetRecordCount() { setRecordCount(0); } diff --git a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java index b1fef9704..8cfc3efe1 100644 --- a/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java +++ b/metafacture-yaml/src/main/java/org/metafacture/yaml/YamlEncoder.java @@ -64,7 +64,7 @@ public final class YamlEncoder extends DefaultStreamPipe> private String arrayMarker = ARRAY_MARKER; /** - * Constructs a YamlEncoder if no IOException occurs. + * Creates an instance of {@link YamlEncoder} if no IOException occurs. */ public YamlEncoder() { try { @@ -75,18 +75,38 @@ public YamlEncoder() { } } + /** + * Sets the array marker. + * + * @param arrayMarker the array marker + */ public void setArrayMarker(final String arrayMarker) { this.arrayMarker = arrayMarker; } + /** + * Gets the array marker. + * + * @return the array marker + */ public String getArrayMarker() { return arrayMarker; } + /** + * Flags wether the data should be pretty printed. + * + * @param prettyPrinting true if the data should be pretty printed + */ public void setPrettyPrinting(final boolean prettyPrinting) { yamlGenerator.setPrettyPrinter(prettyPrinting ? new DefaultPrettyPrinter((SerializableString) null) : null); } + /** + * Checks wether to pretty print. + * + * @return true if the data should be pretty printed + */ public boolean getPrettyPrinting() { return yamlGenerator.getPrettyPrinter() != null; } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Collect.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Collect.java index 46c4c8699..a8bd6ffff 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Collect.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Collect.java @@ -23,15 +23,39 @@ * */ public interface Collect extends FlushListener, ConditionAware, NamedValuePipe { - + /** + * Flags wether to wait for a flush. + * + * @param waitForFlush true if to wait for a flush + */ void setWaitForFlush(boolean waitForFlush); + /** + * Flags wether the collector acts on the same entity. + * + * @param sameEntity true if the collector should acts on the same entity + */ void setSameEntity(boolean sameEntity); + /** + * Flags wether a reset should be done. + * + * @param reset true if a reset should be done. + */ void setReset(boolean reset); + /** + * Gets the name. + * + * @return the name + */ String getName(); + /** + * Sets the name. + * + * @param name the name + */ void setName(String name); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/ConditionAware.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/ConditionAware.java index e5b8305ca..26b5ef3d7 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/ConditionAware.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/ConditionAware.java @@ -23,7 +23,11 @@ * */ public interface ConditionAware { - + /** + * makes statements conditional. + * + * @param receiver the {@link NamedValueSource} + */ void setConditionSource(NamedValueSource receiver); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/FlushListener.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/FlushListener.java index 0beedb906..7b8e390e4 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/FlushListener.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/FlushListener.java @@ -22,7 +22,12 @@ * @author Markus Michael Geipel */ public interface FlushListener { - + /** + * Flush collected data. + * + * @param recordCount the record count + * @param entityCount the entity count + */ void flush(int recordCount, int entityCount); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Function.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Function.java index 671ab7d79..6ba52263f 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Function.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Function.java @@ -24,8 +24,19 @@ */ public interface Function extends NamedValuePipe, FlushListener { + /** + * Puts a value into the map + * + * @param key the key + * @param value the value + */ void putValue(String key, String value); + /** + * Sets maps. + * + * @param maps the {@link Maps} + */ void setMaps(Maps maps); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Maps.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Maps.java index b11feda4b..d9190765c 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/Maps.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/Maps.java @@ -29,14 +29,47 @@ public interface Maps { String DEFAULT_MAP_KEY = "__default"; + /** + * Gets all map names. + * + * @return the {@link Collection} of all map names + */ Collection getMapNames(); + /** + * Gest a map. + * + * @param mapName the name of the map + * @return the Map + */ Map getMap(String mapName); + /** + * Gets a value from the map. + * + * @param mapName the name of the map + * @param key the key of the map + * @return the value + */ String getValue(String mapName, String key); + /** + * Returns a Map with a map name. + * + * @param mapName the name of the map + * @param map the map + * @return the Map + */ Map putMap(String mapName, Map map); + /** + * Puts a value into a map. + * + * @param mapName the name of the map + * @param key the key + * @param value the value + * @return the value + */ String putValue(String mapName, String key, String value); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphBuildException.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphBuildException.java index f720f71fc..ad80be220 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphBuildException.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphBuildException.java @@ -26,10 +26,22 @@ public final class MorphBuildException extends RuntimeException { private static final long serialVersionUID = 0L; + /** + * Creates an instance of {@link MorphBuildException} by a given message. + * + * @param message the message + */ public MorphBuildException(final String message) { super(message); } + /** + * Creates an instance of {@link MorphBuildException} by a given message and + * cause. + * + * @param message the message + * @param cause the {@link Throwable} + */ public MorphBuildException(final String message, final Throwable cause) { super(message, cause); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphErrorHandler.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphErrorHandler.java index 8404d4c93..68b3543c1 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphErrorHandler.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphErrorHandler.java @@ -24,7 +24,11 @@ * */ public interface MorphErrorHandler { - + /** + * Provides custom error handling. + * + * @param exception the {@link Exception} + */ void error(Exception exception); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphExecutionException.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphExecutionException.java index be6e6e08a..addf8cc73 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphExecutionException.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/MorphExecutionException.java @@ -26,10 +26,22 @@ public class MorphExecutionException extends RuntimeException { private static final long serialVersionUID = 0L; + /** + * Creates an instance of {@link MorphExecutionException} by a given message. + * + * @param message the message + */ public MorphExecutionException(final String message) { super(message); } + /** + * Creates an instance of {@link MorphExecutionException} by a given message and + * cause. + * + * @param message the message + * @param cause the @{link Throwable} + */ public MorphExecutionException(final String message, final Throwable cause) { super(message, cause); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueReceiver.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueReceiver.java index fb0f6e6a0..a554b73e2 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueReceiver.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/NamedValueReceiver.java @@ -24,9 +24,22 @@ * */ public interface NamedValueReceiver extends KnowsSourceLocation { - + /** + * Receives named values. + * + * @param name the name of the key + * @param value the value of the key + * @param source the {@link NamedValueSource} + * @param recordCount the record count + * @param entityCount the entity count + */ void receive(String name, String value, NamedValueSource source, int recordCount, int entityCount); + /** + * Adds a named value source. + * + * @param namedValueSource the {@link NamedValueSource} + */ void addNamedValueSource(NamedValueSource namedValueSource); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/SourceLocation.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/SourceLocation.java index 3e3e01c48..d64cd81b6 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/SourceLocation.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/SourceLocation.java @@ -23,11 +23,25 @@ * @author Christoph Böhme */ public interface SourceLocation { - + /** + * Gets the filename. + * + * @return the filename + */ String getFileName(); + /** + * Gest the start position. + * + * @return the start position as {@link Position} + */ Position getStartPosition(); + /** + * Gets the end position. + * + * @return the end position as {@link Position} + */ Position getEndPosition(); /** @@ -36,9 +50,18 @@ public interface SourceLocation { * @author Christoph Böhme */ interface Position { - + /** + * Gest the line number. + * + * @return the line number + */ int getLineNumber(); + /** + * Gest the column number. + * + * @return the column number. + */ int getColumnNumber(); } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractCollect.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractCollect.java index 6a5892726..ecea865a6 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractCollect.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractCollect.java @@ -71,6 +71,11 @@ public final void setSameEntity(final boolean sameEntity) { this.sameEntity = sameEntity; } + /** + * Checks wether a reset should be done after emitting. + * + * @return true if a reset should be done after emitting + */ public final boolean getReset() { return resetAfterEmit; } @@ -97,6 +102,11 @@ public final void setConditionSource(final NamedValueSource source) { resetCondition(); } + /** + * Gets the value. + * + * @return the value + */ public final String getValue() { return value; } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFilter.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFilter.java index a110805da..9a05a4a0f 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFilter.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFilter.java @@ -39,6 +39,11 @@ protected final String getString() { return string; } + /** + * Sets the string. + * + * @param string the string + */ public final void setString(final String string) { this.string = string; } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFlushingCollect.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFlushingCollect.java index f6d99c4ae..35ab3e0bd 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFlushingCollect.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFlushingCollect.java @@ -27,6 +27,11 @@ public abstract class AbstractFlushingCollect extends AbstractCollect { private boolean flushIncomplete = true; + /** + * Flags if to flush when incomplete. + * + * @param flushIncomplete true if it should be flushed when incomplete + */ public final void setFlushIncomplete(final boolean flushIncomplete) { this.flushIncomplete = flushIncomplete; } diff --git a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java index 74a65fbf4..c0cb638e2 100644 --- a/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java +++ b/metamorph-api/src/main/java/org/metafacture/metamorph/api/helpers/AbstractFunction.java @@ -45,6 +45,11 @@ protected final String getLocalValue(final String key) { return null; } + /** + * Gets the name of the map. + * + * @return the name of the map + */ public final String getMapName() { return mapName; } @@ -59,6 +64,11 @@ public final Map getMap() { return localMap != null ? localMap : maps.getMap(mapName); } + /** + * Sets the name of the map. + * + * @param newMapName the name of the map + */ public final void setMap(final String newMapName) { mapName = newMapName; } @@ -71,6 +81,11 @@ public final void putValue(final String key, final String value) { localMap.put(key, value); } + /** + * Sets the maps. + * + * @param maps the {@link Maps} + */ public final void setMaps(final Maps maps) { this.maps = maps; } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/CGXmlReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/CGXmlReader.java index ff5db8248..0c1df6934 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/CGXmlReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/CGXmlReader.java @@ -26,6 +26,9 @@ */ public final class CGXmlReader extends XmlReaderBase { + /** + * Creates an instance of {@link CGXmlReader}. + */ public CGXmlReader() { super(new CGXmlHandler()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/FormetaReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/FormetaReader.java index 912501c3f..f4a7f5c6b 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/FormetaReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/FormetaReader.java @@ -27,6 +27,9 @@ */ public class FormetaReader extends ReaderBase { + /** + * Creates an instance of {@link FormetaReader}. + */ public FormetaReader() { super(new FormetaRecordsReader(), new FormetaDecoder()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonLinesReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonLinesReader.java index dc4af25db..772239e60 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonLinesReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonLinesReader.java @@ -27,6 +27,9 @@ */ public class JsonLinesReader extends ReaderBase { + /** + * Creates an instance of {@link JsonLinesReader}. + */ public JsonLinesReader() { super(new LineReader(), new JsonDecoder()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonReader.java index 48f601afe..656f4849d 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/JsonReader.java @@ -27,6 +27,9 @@ */ public class JsonReader extends ReaderBase { + /** + * Creates an instance of {@link JsonReader}. + */ public JsonReader() { super(new RecordReader(), new JsonDecoder()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MarcXmlReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MarcXmlReader.java index f1c1a461b..ca478f962 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MarcXmlReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MarcXmlReader.java @@ -26,6 +26,9 @@ */ public class MarcXmlReader extends XmlReaderBase { + /** + * Creates an instance of {@link MarcXmlReader}. + */ public MarcXmlReader() { super(new MarcXmlHandler()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java index 77a2693be..a20481628 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/MultiFormatReader.java @@ -31,6 +31,11 @@ public final class MultiFormatReader implements Reader { private StreamReceiver downstreamReceiver; private Reader currentReader; + /** + * Creates an instance of {@link MultiFormatReader} by a given format. + * + * @param format the format + */ public MultiFormatReader(final String format) { setFormat(format); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/PicaReader.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/PicaReader.java index 207635740..e56e346e4 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/PicaReader.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/reader/PicaReader.java @@ -26,6 +26,9 @@ */ public class PicaReader extends ReaderBase { + /** + * Creates an instance of {@link PicaReader}. + */ public PicaReader() { super(new LineReader(), new PicaDecoder()); } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java index 59806e772..7bbc7458a 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/StreamValidator.java @@ -100,10 +100,20 @@ public void setErrorHandler(final Consumer errorHandler) { wellformednessChecker.setErrorHandler(errorHandler); } + /** + * Gets the error handler. + * + * @return the error handler as a {@link Consumer} + */ public Consumer getErrorHandler() { return errorHandler; } + /** + * Checks wether the record order is strict. + * + * @return true if the record order is strict + */ public boolean isStrictRecordOrder() { return strictRecordOrder; } @@ -122,6 +132,11 @@ public void setStrictRecordOrder(final boolean strictRecordOrder) { this.strictRecordOrder = strictRecordOrder; } + /** + * Checks wether the key order is strict. + * + * @return true if the key order is strict + */ public boolean isStrictKeyOrder() { return strictKeyOrder; } @@ -140,6 +155,11 @@ public void setStrictKeyOrder(final boolean strictKeyOrder) { this.strictKeyOrder = strictKeyOrder; } + /** + * Checks wether the value order is strict. + * + * @return true if the value order is strict + */ public boolean isStrictValueOrder() { return strictValueOrder; } diff --git a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/WellformednessChecker.java b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/WellformednessChecker.java index c6eb8b972..34289cff7 100644 --- a/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/WellformednessChecker.java +++ b/metamorph-test/src/main/java/org/metafacture/metamorph/test/validators/WellformednessChecker.java @@ -58,6 +58,9 @@ public final class WellformednessChecker implements StreamReceiver { private int nestingLevel; + /** + * Creates an instance of {@link WellformednessChecker}. + */ public WellformednessChecker() { } @@ -73,6 +76,11 @@ public void setErrorHandler(final Consumer errorHandler) { this.errorHandler = errorHandler; } + /** + * Gets the error handler. + * + * @return the error handler as {@link Consumer} + */ public Consumer getErrorHandler() { return errorHandler; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java index e5babfebf..d3629412f 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/AbstractMetamorphDomWalker.java @@ -63,6 +63,11 @@ public enum AttributeName { this.string = string; } + /** + * Gests the string. + * + * @return the string + */ public String getString() { return string; } @@ -112,6 +117,11 @@ public final void walk(final InputSource morphScript, final Map walk(morphScript); } + /** + * Walks the DOM of the morph definition. + * + * @param morphScript the morph definition as {@link InputSource}. + */ public final void walk(final InputSource morphScript) { walk(DomLoader.parse(SCHEMA_FILE, morphScript)); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/DefaultErrorHandler.java b/metamorph/src/main/java/org/metafacture/metamorph/DefaultErrorHandler.java index be7dcdfa7..5ec4ce436 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/DefaultErrorHandler.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/DefaultErrorHandler.java @@ -26,6 +26,9 @@ */ public final class DefaultErrorHandler implements MorphErrorHandler { + /** + * Creates an instance of {@link DefaultErrorHandler}. + */ public DefaultErrorHandler() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java index 19ad1526e..e31baec40 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java @@ -45,10 +45,21 @@ public final class Entity extends AbstractFlushingCollect { private NamedValueSource nameSource; private String currentName; + /** + * Creates an instance of {@link Entity} by a given {@link Metamorph}. + * + * @param metamorph the {@link Metamorph} + */ public Entity(final Metamorph metamorph) { this.receiver = () -> metamorph.getStreamReceiver(); } + /** + * Creates an instance of {@link Entity} by a given {@link Supplier} of object + * type {@link StreamReceiver}. + * + * @param receiver the {@link Supplier} of object type {@link StreamReceiver} + */ public Entity(final Supplier receiver) { this.receiver = receiver; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Flush.java b/metamorph/src/main/java/org/metafacture/metamorph/Flush.java index e23cd8a35..734ce0480 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Flush.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Flush.java @@ -22,7 +22,7 @@ import org.metafacture.metamorph.api.SourceLocation; /** - * Flushes a {@link FlushListener} + * Flushes a {@link FlushListener}. * * @author Markus Geipel * @author Christoph Böhme @@ -34,6 +34,11 @@ public final class Flush implements NamedValueReceiver { private SourceLocation sourceLocation; + /** + * Creates an instance of {@link Flush} by a given {@link FlushListener}. + * + * @param listener the {@link FlushListener} + */ public Flush(final FlushListener listener) { this.listener = listener; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java b/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java index 98f788115..c1aaa9027 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Metamorph.java @@ -111,72 +111,179 @@ protected Metamorph() { init(); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link String}. + * + * @param morphDef the {@link String} + */ public Metamorph(final String morphDef) { this(morphDef, NO_VARS); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link String} and morph variables as a Map. + * + * @param morphDef the {@link String} + * @param vars the morph variables as a Map + */ public Metamorph(final String morphDef, final Map vars) { this(morphDef, vars, NULL_INTERCEPTOR_FACTORY); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link String} and an {@link InterceptorFactory}. + * + * @param morphDef the {@link String} + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final String morphDef, final InterceptorFactory interceptorFactory) { this(morphDef, NO_VARS, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link String} and morph variables as a Map and an + * {@link InterceptorFactory}. + * + * @param morphDef the {@link String} + * @param vars the morph variables as a Map + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final String morphDef, final Map vars, final InterceptorFactory interceptorFactory) { this(getInputSource(morphDef), vars, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link Reader}. + * + * @param morphDef the {@link Reader} + */ public Metamorph(final Reader morphDef) { this(morphDef, NO_VARS); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link Reader} and the morph variables as a Map. + * + * @param morphDef the {@link Reader} + * @param vars the morph variables as a Map + */ public Metamorph(final Reader morphDef, final Map vars) { this(morphDef, vars, NULL_INTERCEPTOR_FACTORY); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link Reader} and an {@link InterceptorFactory}. + * + * @param morphDef the {@link Reader} + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final Reader morphDef, final InterceptorFactory interceptorFactory) { this(morphDef, NO_VARS, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link Reader} and morph variables as a Map and an + * {@link InterceptorFactory}. + * + * @param morphDef the {@link Reader} + * @param vars the morph variables as a Map + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final Reader morphDef, final Map vars, final InterceptorFactory interceptorFactory) { this(new InputSource(morphDef), vars, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputStream}. + * + * @param morphDef the {@link InputStream} + */ public Metamorph(final InputStream morphDef) { this(morphDef, NO_VARS); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputStream} and morph variables as a Map. + * + * @param morphDef the {@link InputStream} + * @param vars the morph variables as a Map + */ public Metamorph(final InputStream morphDef, final Map vars) { this(morphDef, vars, NULL_INTERCEPTOR_FACTORY); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputStream} and an {@link InterceptorFactory}. + * + * @param morphDef the {@link InputStream} + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final InputStream morphDef, final InterceptorFactory interceptorFactory) { this(morphDef, NO_VARS, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputStream}, morph variables as a Map and an + * {@link InterceptorFactory}. + * + * @param morphDef the {@link InputStream} + * @param vars the morph variables as a Map + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final InputStream morphDef, final Map vars, final InterceptorFactory interceptorFactory) { this(new InputSource(morphDef), vars, interceptorFactory); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputSource}. + * + * @param inputSource the {@link InputSource} + */ public Metamorph(final InputSource inputSource) { this(inputSource, NO_VARS); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputSource} and morph variables as a Map. + * + * @param inputSource the {@link InputSource} + * @param vars the morph variables as a Map + */ public Metamorph(final InputSource inputSource, final Map vars) { this(inputSource, vars, NULL_INTERCEPTOR_FACTORY); } + /** + * Creates an instance of {@link Metamorph} given by a morph definition as + * {@link InputSource} and an {@link InterceptorFactory}. + * + * @param inputSource the {@link InputSource} + * @param interceptorFactory the {@link InterceptorFactory} + */ public Metamorph(final InputSource inputSource, final InterceptorFactory interceptorFactory) { this(inputSource, NO_VARS, interceptorFactory); } /** - * Constructs a Metamorph by setting an InputSource, a Map of variables and an - * InterceptorFactory. + * Constructs a Metamorph by setting a morph definition as {@link InputSource}, + * a Map of variables and an {@link InterceptorFactory}. * * @param inputSource the InputSource * @param vars the Map of variables @@ -224,6 +331,11 @@ protected void setEntityMarker(final String entityMarker) { flattener.setEntityMarker(entityMarker); } + /** + * Sett the {@link MorphErrorHandler}. + * + * @param errorHandler the {@link MorphErrorHandler} + */ public void setErrorHandler(final MorphErrorHandler errorHandler) { this.errorHandler = errorHandler; } @@ -407,6 +519,11 @@ public R setReceiver(final R streamReceiver) { return streamReceiver; } + /** + * Gets the {@link StreamReceiver}. + * + * @return the output {@link StreamReceiver} + */ public StreamReceiver getStreamReceiver() { return outputStreamReceiver; } @@ -462,6 +579,11 @@ public Collection getMapNames() { return Collections.unmodifiableSet(maps.keySet()); } + /** + * Adds a {@link FlushListener} to the record end. + * + * @param flushListener the {@link FlushListener} + */ public void registerRecordEndFlush(final FlushListener flushListener) { recordEndListener.add(flushListener); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/MetamorphException.java b/metamorph/src/main/java/org/metafacture/metamorph/MetamorphException.java index b22901920..dfe778d8a 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/MetamorphException.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/MetamorphException.java @@ -28,6 +28,13 @@ public class MetamorphException extends MetafactureException { private static final long serialVersionUID = 0L; + /** + * Creates an instance of {@link MetamorphException} by a given message and + * cause. + * + * @param message the message + * @param cause the {@link Throwable} + */ public MetamorphException(final String message, final Throwable cause) { super(message, cause); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java index 8990a22a9..9bebe2f92 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java @@ -36,6 +36,9 @@ public final class All extends AbstractFlushingCollect { private final Set sources = new HashSet(); private final Set sourcesLeft = new HashSet(); + /** + * Creates an instance of {@link All}. + */ public All() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Any.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Any.java index df3289813..0ba64d1b8 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Any.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Any.java @@ -33,6 +33,9 @@ public final class Any extends AbstractCollect { private boolean receivedInput; private boolean emittedResult; + /** + * Creates an instance of {@link Any}. + */ public Any() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java index 8ea10b752..24a0d6f5b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java @@ -34,9 +34,12 @@ public final class Choose extends AbstractFlushingCollect { private String value; private String name; private int priority = Integer.MAX_VALUE; - private final Map priorities = new HashMap(); + private final Map priorities = new HashMap<>(); private int nextPriority; + /** + * Creates an instance of {@link Choose}. + */ public Choose() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java index be9c4b85e..8c694abc7 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java @@ -36,6 +36,9 @@ public final class Combine extends AbstractFlushingCollect { private final Set sources = new HashSet(); private final Set sourcesLeft = new HashSet(); + /** + * Creates an instance of {@link Combine}. + */ public Combine() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Concat.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Concat.java index 9e51eee71..f16d26368 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Concat.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Concat.java @@ -34,21 +34,44 @@ public final class Concat extends AbstractFlushingCollect { private String currentDelimiter = ""; private boolean reverse; + /** + * Creates an instance of {@link Concat}. + */ public Concat() { } + /** + * Sets the prefix. + * + * @param prefix the prefix + */ public void setPrefix(final String prefix) { this.prefix = prefix; } + /** + * Sets the postfix. + * + * @param postfix the postfix + */ public void setPostfix(final String postfix) { this.postfix = postfix; } + /** + * Sets the delimiter. + * + * @param delimiter the delimiter + */ public void setDelimiter(final String delimiter) { this.delimiter = delimiter; } + /** + * Flasg wether the concatenation should be reversely done. + * + * @param reverse true if concatenation should be done reversely + */ public void setReverse(final boolean reverse) { this.reverse = reverse; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java index 8aaf181a6..3145e8eac 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java @@ -38,6 +38,9 @@ public final class EqualsFilter extends AbstractFlushingCollect { private final Set sourcesLeft = new HashSet(); private boolean isEqual = true; + /** + * Creates an instance of {@link EqualsFilter}. + */ public EqualsFilter() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Group.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Group.java index a55992487..baf3f0f75 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Group.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Group.java @@ -27,6 +27,9 @@ */ public final class Group extends AbstractFlushingCollect { + /** + * Creates an instance of {@link Group}. + */ public Group() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/None.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/None.java index 4e8f5a694..c095278c5 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/None.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/None.java @@ -33,6 +33,9 @@ public final class None extends AbstractCollect { private boolean receivedInput; private boolean emittedResult; + /** + * Creates an instance of {@link None}. + */ public None() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Range.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Range.java index 486661c27..fd700b5aa 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Range.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Range.java @@ -35,13 +35,26 @@ public final class Range extends AbstractFlushingCollect { private int increment; private Integer first; + /** + * Creates an instance of {@link Range}. + */ public Range() { } + /** + * Gets the incrment. + * + * @return the increment + */ public int getIncrement() { return increment; } + /** + * Sets the incremenet. + * + * @param increment the increment + */ public void setIncrement(final int increment) { this.increment = increment; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Square.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Square.java index 3cc19888e..d8be1aa4d 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Square.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Square.java @@ -36,17 +36,35 @@ public final class Square extends AbstractFlushingCollect { private String postfix = ""; private String delimiter = ""; + /** + * Creates an instance of {@link Square}. + */ public Square() { } + /** + * Sets the prefix. + * + * @param prefix the prefix + */ public void setPrefix(final String prefix) { this.prefix = prefix; } + /** + * Sets the postfix. + * + * @param postfix the postfix + */ public void setPostfix(final String postfix) { this.postfix = postfix; } + /** + * Sets the delimiter. + * + * @param delimiter the delimiter + */ public void setDelimiter(final String delimiter) { this.delimiter = delimiter; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Tuples.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Tuples.java index d36acbf85..546d17632 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Tuples.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Tuples.java @@ -32,18 +32,32 @@ */ public final class Tuples extends AbstractFlushingCollect { - private final ListMap listMap = new ListMap(); + public static final int MIN_N = 1; + private final ListMap listMap = new ListMap<>(); - private int minN = 1; + private int minN = MIN_N; private String separator = ""; + /** + * Creates an instance of {@link Tuples}. + */ public Tuples() { } + /** + * Sets min N. Default value: {@value #MIN_N} + * + * @param minN the min N + */ public void setMinN(final int minN) { this.minN = minN; } + /** + * Sets the separator. + * + * @param separator the separator + */ public void setSeparator(final String separator) { this.separator = separator; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/AbstractCompose.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/AbstractCompose.java index 5b3808732..bacb6c889 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/AbstractCompose.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/AbstractCompose.java @@ -31,24 +31,36 @@ abstract class AbstractCompose extends AbstractSimpleStatelessFunction { private String postfix = ""; /** - * @param prefix - * the prefix to set + * Sets the prefix. + * + * @param prefix the prefix to set */ public void setPrefix(final String prefix) { this.prefix = prefix; } + /** + * Gets the prefix. + * + * @return the prefix + */ protected String getPrefix() { return prefix; } + /** + * Gets the postfix. + * + * @return the postfix + */ protected String getPostfix() { return postfix; } /** - * @param postfix - * the postfix to set + * Sets the posfix. + * + * @param postfix the postfix to set */ public void setPostfix(final String postfix) { this.postfix = postfix; diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/BlackList.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/BlackList.java index 7f1da50e7..9b6017541 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/BlackList.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/BlackList.java @@ -24,6 +24,9 @@ */ public final class BlackList extends AbstractLookup { + /** + * Creates an instance of {@link BlackList}. + */ public BlackList() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Buffer.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Buffer.java index 7e5af9f16..c33de7140 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Buffer.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Buffer.java @@ -34,6 +34,9 @@ public final class Buffer extends AbstractFunction { private final List receipts = new ArrayList(); private int currentRecord; + /** + * Creates an instance of {@link Buffer}. + */ public Buffer() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java index 262fcc93f..084e977d3 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Case.java @@ -32,7 +32,7 @@ */ public final class Case extends AbstractSimpleStatelessFunction { - private static final String UPPER = "upper"; + public static final String UPPER = "upper"; private static final Set LANGUAGES; private Locale locale = Locale.getDefault(); private boolean toUpper; @@ -43,6 +43,9 @@ public final class Case extends AbstractSimpleStatelessFunction { LANGUAGES = Collections.unmodifiableSet(set); } + /** + * Creates an instance of {@link Case}. + */ public Case() { } @@ -54,6 +57,11 @@ public String process(final String value) { return value.toLowerCase(locale); } + /** + * Flags wether the case should be upper. + * + * @param string the case is set to upper when set to {@value #UPPER} + */ public void setTo(final String string) { this.toUpper = UPPER.equals(string); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Compose.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Compose.java index 487499400..faaff9950 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Compose.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Compose.java @@ -23,6 +23,9 @@ */ public final class Compose extends AbstractCompose { + /** + * Creates an instance of {@link Compose}. + */ public Compose() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Constant.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Constant.java index b031a4394..8db7b004d 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Constant.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Constant.java @@ -27,6 +27,9 @@ public final class Constant extends AbstractSimpleStatelessFunction { private String constValue; + /** + * Creates an instance of {@link Constant}. + */ public Constant() { } @@ -35,6 +38,11 @@ public String process(final String value) { return constValue; } + /** + * Sets the constant. + * + * @param string the constant + */ public void setValue(final String string) { this.constValue = string; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Contains.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Contains.java index eb497d649..06f633834 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Contains.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Contains.java @@ -25,6 +25,9 @@ */ public final class Contains extends AbstractFilter { + /** + * Creates an instance of {@link Contains}. + */ public Contains() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Count.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Count.java index 2aea2b7aa..7f794e3bf 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Count.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Count.java @@ -28,6 +28,9 @@ public final class Count extends AbstractStatefulFunction { private int count; + /** + * Creates an instance of {@link Count}. + */ public Count() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java index 48984bbd8..ee4336d29 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/DateFormat.java @@ -122,6 +122,9 @@ int getEraId() { SUPPORTED_LANGUAGES = Collections.unmodifiableSet(set); } + /** + * Creates an instance of {@link DateFormat}. + */ public DateFormat() { } @@ -162,18 +165,40 @@ else if (era == Era.AD) { return result; } + /** + * Sets the input format. Default value: + * {@code #DEFAULT_INPUT_FORMAT} + * + * @param inputFormat the input format + */ public final void setInputFormat(final String inputFormat) { this.inputFormat = inputFormat; } + /** + * Sets the output format. Default value: + * {@link #DEFAULT_OUTPUT_FORMAT} + * + * @param outputFormat the output format + */ public final void setOutputFormat(final DateFormats outputFormat) { this.outputFormat = outputFormat; } + /** + * Sets the output format. Default value: {@link #DEFAULT_ERA} + * + * @param era the {@link Era} + */ public final void setEra(final Era era) { this.era = era; } + /** + * Flags wether to remove leading zeros. + * + * @param removeLeadingZeros true if leading zeros should be removed + */ public final void setRemoveLeadingZeros(final boolean removeLeadingZeros) { this.removeLeadingZeros = removeLeadingZeros; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Equals.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Equals.java index 0be5edcd8..7f280ed9c 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Equals.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Equals.java @@ -25,6 +25,9 @@ */ public final class Equals extends AbstractFilter { + /** + * Creates an instance of {@link Equals}. + */ public Equals() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/HtmlAnchor.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/HtmlAnchor.java index 37df4cf29..969d73874 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/HtmlAnchor.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/HtmlAnchor.java @@ -26,9 +26,17 @@ public final class HtmlAnchor extends AbstractCompose { private String title; + /** + * Creates an instance of {@link HtmlAnchor}. + */ public HtmlAnchor() { } + /** + * Sets the title. + * + * @param title the title. + */ public void setTitle(final String title) { this.title = title; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java index 40572c6e5..37bbfba6f 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/ISBN.java @@ -47,9 +47,17 @@ public final class ISBN extends AbstractSimpleStatelessFunction { private boolean verifyCheckDigit; private String errorString; + /** + * Creates an instance of {@link ISBN}. + */ public ISBN() { } + /** + * Sets the error message as a placeholder if the ISBN couln't be validated. + * + * @param errorString the error message as a placeholder + */ public void setErrorString(final String errorString) { this.errorString = errorString; } @@ -194,6 +202,11 @@ else if (isbn.length() == ISBN13_SIZE) { return result; } + /** + * Flags wether the check digit should be verified. + * + * @param verifyCheckDigit "true" if the check digit should be verified + */ public void setVerifyCheckDigit(final String verifyCheckDigit) { this.verifyCheckDigit = "true".equals(verifyCheckDigit); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Lookup.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Lookup.java index e340c9b5d..0c1b48b35 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Lookup.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Lookup.java @@ -26,9 +26,17 @@ public final class Lookup extends AbstractLookup { private String defaultValue; + /** + * Creates an instance of {@link Lookup}. + */ public Lookup() { } + /** + * Sets the default value. + * + * @param newDefaultValue the default value + */ public void setDefault(final String newDefaultValue) { defaultValue = newDefaultValue; } @@ -43,6 +51,11 @@ public String process(final String key) { return returnValue; } + /** + * Sets the name of the map. + * + * @param mapName the name of the map + */ public void setIn(final String mapName) { setMap(mapName); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/NormalizeUTF8.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/NormalizeUTF8.java index 23c8b3880..fa349e3b9 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/NormalizeUTF8.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/NormalizeUTF8.java @@ -28,6 +28,9 @@ */ public final class NormalizeUTF8 extends AbstractSimpleStatelessFunction { + /** + * Creates an instance of {@link NormalizeUTF8}. + */ public NormalizeUTF8() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/NotContains.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/NotContains.java index 15094f404..7c812fa8e 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/NotContains.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/NotContains.java @@ -26,6 +26,9 @@ */ public final class NotContains extends AbstractFilter { + /** + * Creates an instance of {@link NotContains}. + */ public NotContains() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/NotEquals.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/NotEquals.java index 5b5c67b99..c7339b84c 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/NotEquals.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/NotEquals.java @@ -26,6 +26,9 @@ */ public final class NotEquals extends AbstractFilter { + /** + * Creates an instance of {@link NotEquals}. + */ public NotEquals() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Occurrence.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Occurrence.java index b3b26159a..254c5fbd7 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Occurrence.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Occurrence.java @@ -32,9 +32,9 @@ */ public final class Occurrence extends AbstractStatefulFunction { - private static final String LESS_THAN = "lessThan "; - private static final String MORE_THAN = "moreThan "; - + public static final String LESS_THAN = "lessThan "; + public static final String MORE_THAN = "moreThan "; + public static final boolean SAME_ENTITY = false; private int count; private String format; @@ -45,9 +45,12 @@ public boolean accept(final int value) { } }; - private final Map variables = new HashMap(); - private boolean sameEntity; + private final Map variables = new HashMap<>(); + private boolean sameEntity = SAME_ENTITY; + /** + * Creates an instance of {@link Occurrence}. + */ public Occurrence() { } @@ -69,6 +72,11 @@ private String processMatch(final String value) { return StringUtil.format(format, variables); } + /** + * Sets the format. + * + * @param format the format + */ public void setFormat(final String format) { this.format = format; } @@ -83,10 +91,23 @@ protected boolean doResetOnEntityChange() { return sameEntity; } + /** + * Sets the inequality. Use values starting with {@value #LESS_THAN} or + * {@value #MORE_THAN}. If the value is an integer it an equal filter will be + * set. + * + * @param only set the inequality, otherwise an equal filter will be used + */ public void setOnly(final String only) { filter = parse(only); } + /** + * Sets if the occurrence must be in the same entity. Default value: + * {@value #SAME_ENTITY} + * + * @param sameEntity true if the occurrence must be in the same entity + */ public void setSameEntity(final boolean sameEntity) { this.sameEntity = sameEntity; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Regexp.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Regexp.java index b7490eb6a..fdb769647 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Regexp.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Regexp.java @@ -36,6 +36,9 @@ public final class Regexp extends AbstractFunction { private String format; private final Map tempVars = new HashMap(); + /** + * Creates an instance of {@link Regexp}. + */ public Regexp() { } @@ -76,10 +79,20 @@ private void populateVars() { } } + /** + * Sets the matcher. + * + * @param match the matcher + */ public void setMatch(final String match) { matcher = Pattern.compile(match).matcher(""); } + /** + * Sets the format. + * + * @param format the format + */ public void setFormat(final String format) { this.format = format; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Replace.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Replace.java index 518f8ad62..ba494d782 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Replace.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Replace.java @@ -30,6 +30,9 @@ public final class Replace extends AbstractSimpleStatelessFunction { private Pattern pattern; private String with; + /** + * Creates an instance of {@link Replace}. + */ public Replace() { } @@ -38,10 +41,20 @@ public String process(final String value) { return pattern.matcher(value).replaceAll(with); } + /** + * Sets the pattern. + * + * @param string the pattern + */ public void setPattern(final String string) { pattern = Pattern.compile(string); } + /** + * Sets the replacement. + * + * @param with the replacement + */ public void setWith(final String with) { this.with = with; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java index bc685aa8d..ad78c9195 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Script.java @@ -37,9 +37,17 @@ public final class Script extends AbstractSimpleStatelessFunction { private Invocable invocable; private String invoke; + /** + * Creates an instance of {@link Script}. + */ public Script() { } + /** + * Flags wether to invoke the script. + * + * @param invoke true if script should be invoked + */ public void setInvoke(final String invoke) { this.invoke = invoke; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/SetReplace.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/SetReplace.java index c699cc969..214848922 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/SetReplace.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/SetReplace.java @@ -27,6 +27,9 @@ public final class SetReplace extends AbstractSimpleStatelessFunction { private final SetReplacer setReplacer = new SetReplacer(); private boolean prepared; + /** + * Creates an instance of {@link SetReplace}. + */ public SetReplace() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Split.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Split.java index b18af6dbc..af905cf63 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Split.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Split.java @@ -30,6 +30,9 @@ public final class Split extends AbstractFunction { private Pattern delimiterPattern; + /** + * Creates an instance of {@link Split}. + */ public Split() { } @@ -42,6 +45,11 @@ public void receive(final String name, final String value, final NamedValueSourc } } + /** + * Sets the delimiter. + * + * @param delimiter the delimiter + */ public void setDelimiter(final String delimiter) { this.delimiterPattern = Pattern.compile(delimiter); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Substring.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Substring.java index 5987b0852..da52067e8 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Substring.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Substring.java @@ -28,6 +28,9 @@ public final class Substring extends AbstractSimpleStatelessFunction { private int start; private int end; + /** + * Creates an instance of {@link Substring}. + */ public Substring() { } @@ -50,16 +53,19 @@ public String process(final String value) { } /** - * @param start - * start of substring + * Sets the start of the substring. + * + * @param start start of substring */ public void setStart(final String start) { this.start = Integer.parseInt(start); } /** - * @param end end of substring, if end==0 the the complete - * remaining string is returned + * Sets the end of the substring. + * + * @param end end of substring, if end==0 the the complete remaining string is + * returned * */ public void setEnd(final String end) { diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/SwitchNameValue.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/SwitchNameValue.java index fc6f7abcb..7330eb65b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/SwitchNameValue.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/SwitchNameValue.java @@ -26,6 +26,9 @@ */ public final class SwitchNameValue extends AbstractFunction { + /** + * Creates an instance of {@link SwitchNameValue}. + */ public SwitchNameValue() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java index 4ce633415..80b544ee0 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Timestamp.java @@ -62,6 +62,9 @@ public final class Timestamp extends AbstractSimpleStatelessFunction { SUPPORTED_LANGUAGES = Collections.unmodifiableSet(set); } + /** + * Creates an instance of {@link Timestamp}. + */ public Timestamp() { } @@ -81,10 +84,20 @@ public String process(final String value) { return dateFormat.format(new Date()); } + /** + * Sets the format. Default value: {@value #DEFAULT_FORMAT} + * + * @param format the format + */ public void setFormat(final String format) { this.format = format; } + /** + * Sets the timezone. Default value: {@value #DEFAULT_TIMEZONE} + * + * @param timezone the timezone + */ public void setTimezone(final String timezone) { this.timezone = timezone; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Trim.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Trim.java index a4881c156..f91ff79a6 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Trim.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Trim.java @@ -25,6 +25,9 @@ */ public final class Trim extends AbstractSimpleStatelessFunction { + /** + * Creates an instance of {@link Trim}. + */ public Trim() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/URLEncode.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/URLEncode.java index 3996b7e1f..90debe481 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/URLEncode.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/URLEncode.java @@ -30,6 +30,9 @@ */ public final class URLEncode extends AbstractSimpleStatelessFunction { + /** + * Creates an instance of {@link URLEncode}. + */ public URLEncode() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java index b3e903679..37fed5a78 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/Unique.java @@ -33,7 +33,7 @@ public final class Unique extends AbstractStatefulFunction { public static final String NAME = "name"; public static final String VALUE = "value"; - private final Set set = new HashSet(); + private final Set set = new HashSet<>(); private boolean uniqueInEntity; @@ -44,6 +44,9 @@ public String createKey(final String name, final String value) { } }; + /** + * Creates an instance of {@link Unique}. + */ public Unique() { } @@ -67,6 +70,11 @@ protected boolean doResetOnEntityChange() { return uniqueInEntity; } + /** + * Flags wether the scope is {@link #ENTITY}. + * + * @param scope the scope + */ public void setIn(final String scope) { uniqueInEntity = ENTITY.equals(scope); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/functions/WhiteList.java b/metamorph/src/main/java/org/metafacture/metamorph/functions/WhiteList.java index 30187ada9..bbcc75fd0 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/functions/WhiteList.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/functions/WhiteList.java @@ -23,6 +23,9 @@ */ public final class WhiteList extends AbstractLookup { + /** + * Creates an instance of {@link WhiteList}. + */ public WhiteList() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java index bf4dd8c8b..b1066dcac 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/FileMap.java @@ -43,10 +43,13 @@ */ public final class FileMap extends AbstractReadOnlyMap { - private final Map map = new HashMap(); + private final Map map = new HashMap<>(); private Pattern split = Pattern.compile("\t", Pattern.LITERAL); + /** + * Creates an instance of {@link FileMap}. + */ public FileMap() { } @@ -129,6 +132,13 @@ private Optional openAsUrl(final String file) { } } + /** + * Sets the separator. + * + * Default value: {@code \t} + * + * @param delimiter the separator + */ public void setSeparator(final String delimiter) { split = Pattern.compile(delimiter, Pattern.LITERAL); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java index 37edb3a70..58be7996b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/JndiSqlMap.java @@ -41,6 +41,9 @@ public final class JndiSqlMap extends AbstractReadOnlyMap implem private DataSource datasource; private String query; + /** + * Creates an instance of {@link JndiSqlMap}. + */ public JndiSqlMap() { } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/RestMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/RestMap.java index d69a78897..1a1921947 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/RestMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/RestMap.java @@ -38,13 +38,23 @@ */ public final class RestMap extends AbstractReadOnlyMap { + public static final String CHARSET_NAME = "UTF-8"; + private static final Pattern VAR_PATTERN = Pattern.compile("${key}", Pattern.LITERAL); - private String charsetName = "UTF-8"; + private String charsetName = CHARSET_NAME; private String url; + /** + * Creates an instance of {@link RestMap}. + */ public RestMap() { } + /** + * Creates an instance of {@link RestMap} by the given URL. + * + * @param url the URL + */ public RestMap(final String url) { this.url = url; } @@ -79,10 +89,20 @@ private String readFromUrl(final String targetUrl) throws IOException, URISyntax } } + /** + * Sets the URL. + * + * @param url the URL + */ public void setUrl(final String url) { this.url = url; } + /** + * Sets the charset name. Default value: {@value #CHARSET_NAME} + * + * @param name the charset name + */ public void setCharsetName(final String name) { charsetName = name; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java index 8a8333575..390debad2 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/maps/SqlMap.java @@ -48,6 +48,9 @@ public final class SqlMap extends AbstractReadOnlyMap implements private PreparedStatement preparedStatement; + /** + * Creates an instance of {@link SqlMap}. + */ public SqlMap() { } @@ -110,26 +113,56 @@ public String get(final Object key) { return resultString; } + /** + * Sets the driver. + * + * @param driver the driver + */ public void setDriver(final String driver) { this.driver = driver; } + /** + * Sets the host. + * + * @param host the host + */ public void setHost(final String host) { this.host = host; } + /** + * Sets the login. + * + * @param login the login + */ public void setLogin(final String login) { this.login = login; } + /** + * Sets the password. + * + * @param password the password + */ public void setPassword(final String password) { this.password = password; } + /** + * Sets the database. + * + * @param database the database + */ public void setDatabase(final String database) { this.database = database; } + /** + * Sets the query. + * + * @param query the query + */ public void setQuery(final String query) { this.query = query; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java index 5b39b57a6..a089489b0 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/xml/Location.java @@ -72,18 +72,38 @@ public Location(final Location src) { elementEnd = new LocatorImpl(src.elementEnd); } + /** + * Gets the start of the element. + * + * @return the start of the element + */ public Locator getElementStart() { return elementStart; } + /** + * Gets the end of the element. + * + * @return the end of the element + */ public Locator getElementEnd() { return elementEnd; } + /** + * Gets the system ID. + * + * @return the system ID + */ public String getSystemId() { return elementStart.getSystemId(); } + /** + * Gets the public ID + * + * @return the public ID + */ public String getPublicId() { return elementStart.getPublicId(); } From 3b8289eaaecf08e1e9b2d3751434090f1fb5c251 Mon Sep 17 00:00:00 2001 From: Jens Wille Date: Sat, 30 Oct 2021 18:04:59 +0200 Subject: [PATCH 39/40] Fix Javadoc references. (#396) metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java:136: warning - #NAMESPACE_NAME (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java:136: warning - #NAMESPACE_NAME (referenced by @value tag) is an unknown reference. metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java:136: warning - #NAMESPACE_NAME (referenced by @value tag) is an unknown reference. metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java:63: warning - #DEFAULT_VARSTART (referenced by @value tag) is an unknown reference. metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java:63: warning - #DEFAULT_VAREND (referenced by @value tag) is an unknown reference. metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java:94: warning - #DEFAULT_VARSTART (referenced by @value tag) is an unknown reference. metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java:94: warning - #DEFAULT_VAREND (referenced by @value tag) is an unknown reference. metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java:157: warning - Tag @link: reference not found: Normalizer.Form metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java:76: warning - Tag @link: reference not found: Normalizer.Form --- .../java/org/metafacture/biblio/marc21/MarcXmlEncoder.java | 2 +- .../src/main/java/org/metafacture/commons/StringUtil.java | 4 ++-- .../java/org/metafacture/strings/StreamUnicodeNormalizer.java | 2 +- .../main/java/org/metafacture/strings/UnicodeNormalizer.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index e4afe44f0..0b8202ec0 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -42,6 +42,7 @@ @FluxCommand("encode-marcxml") public final class MarcXmlEncoder extends DefaultStreamPipe> { + public static final String NAMESPACE_NAME = "marc"; public static final String XML_ENCODING = "UTF-8"; public static final String XML_VERSION = "1.0"; public static final boolean PRETTY_PRINTED = true; @@ -81,7 +82,6 @@ public String close(final Object[] args) { } private static final String NAMESPACE = "http://www.loc.gov/MARC21/slim"; - private static final String NAMESPACE_NAME = "marc"; private static final String NAMESPACE_PREFIX = NAMESPACE_NAME + ":"; private static final String NAMESPACE_SUFFIX = ":" + NAMESPACE_NAME; diff --git a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java index cc3f13fc1..ce9c7f89c 100644 --- a/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java +++ b/metafacture-commons/src/main/java/org/metafacture/commons/StringUtil.java @@ -27,8 +27,8 @@ */ public final class StringUtil { - private static final String DEFAULT_VARSTART = "${"; - private static final String DEFAULT_VAREND = "}"; + public static final String DEFAULT_VARSTART = "${"; + public static final String DEFAULT_VAREND = "}"; private StringUtil() { // no instances allowed diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java b/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java index bc1af63cd..b623355b0 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/StreamUnicodeNormalizer.java @@ -152,7 +152,7 @@ public void setNormalizationForm( /** * Gets the normalization form. * - * @return the {@link Normalizer.Form} + * @return the {@link java.text.Normalizer.Form} */ public Normalizer.Form getNormalizationForm() { return normalizationForm; diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java b/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java index 4e0165bfa..0f9bce614 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/UnicodeNormalizer.java @@ -71,7 +71,7 @@ public void setNormalizationForm(final Normalizer.Form normalizationForm) { /** * Gets the normalization form. * - * @return the {@link Normalizer.Form} + * @return the {@link java.text.Normalizer.Form} */ public Normalizer.Form getNormalizationForm() { return normalizationForm; From 6f07b3b354fd7a0efd224ec38876fefd98267abe Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 2 Nov 2021 08:24:00 +0100 Subject: [PATCH 40/40] Use plural in enum description (#396) Complements 87e602a. --- .../main/java/org/metafacture/triples/AbstractTripleSort.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java index bdb1779bd..5756ff50b 100644 --- a/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java +++ b/metafacture-triples/src/main/java/org/metafacture/triples/AbstractTripleSort.java @@ -39,14 +39,14 @@ public abstract class AbstractTripleSort extends DefaultObjectPipe> implements MemoryWarningSystem.Listener { /** - * The comparator. + * The comparators. */ public enum Compare { SUBJECT, PREDICATE, OBJECT, ALL } /** - * The sort order. + * The sort orders. */ public enum Order { INCREASING {