Skip to content

Commit

Permalink
JavaDoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Jan 21, 2019
1 parent c692592 commit 7cfffc6
Show file tree
Hide file tree
Showing 51 changed files with 209 additions and 181 deletions.
4 changes: 2 additions & 2 deletions merlin-core/src/main/java/de/micromata/merlin/CoreI18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static CoreI18n getDefault() {
* Use this if only one locale is used (in a none multi user system).
* At default the default message bundle "MessagesBundle" of the class path with the system's default locale is used.
*
* @param instance
* @param instance The default instance to use.
*/
public static void setDefault(CoreI18n instance) {
defaultInstance = instance;
Expand All @@ -35,7 +35,7 @@ public static void setDefault(CoreI18n instance) {
* Use this if only one locale is used (in a none multi user system).
* Uses bundle "MessagesBundle" of the class path with the given locale.
*
* @param locale
* @param locale The default locale to use.
* @return new default instance for chaining.
*/
public static CoreI18n setDefault(Locale locale) {
Expand Down
16 changes: 9 additions & 7 deletions merlin-core/src/main/java/de/micromata/merlin/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ protected I18n create(Locale locale) {

/**
* Uses the default message bundle "MessagesBundle" of class path with systems default locale.
*
* @param bundleName The name of the bundle.
*/
public I18n(String bundleName) {
this.resourceBundle = I18n.getBundle(bundleName);
Expand All @@ -44,23 +46,23 @@ public I18n(String bundleName, Locale locale) {
/**
* Throws an error if messageId not found.
*
* @param messageId
* @param messageId The id of the message to translate.
* @return localized message.
*/
public String getMessage(String messageId) {
return resourceBundle.getString(messageId);
}

/**
* @param messageId
* @param messageId The id of the message to translate.
* @return true, if the messageId is found in the bundle, otherwise false.
*/
public boolean containsMessage(String messageId) {
return resourceBundle.containsKey(messageId);
}

/**
* @param messageId
* @param messageId The id of the message to translate.
* @param params Message parameter to replace in message.
* @return localized message.
* @see MessageFormat#format(String, Object...)
Expand All @@ -82,9 +84,8 @@ public ResourceBundle getResourceBundle() {
}

/**
*
* @param bundleName
* @param locale
* @param bundleName The name of the bundle.
* @param locale The locale to use.
* @return The root bundle if the given locale's language is "en" or language not found, otherwise the desired bundle for the given locale.
*/
public static ResourceBundle getBundle(String bundleName, Locale locale) {
Expand All @@ -98,7 +99,8 @@ public static ResourceBundle getBundle(String bundleName, Locale locale) {

/**
* Simply calls {@link ResourceBundle#getBundle(String)}.
* @param bundleName
*
* @param bundleName The bundle to use.
* @return The bundle for {@link Locale#getDefault()} or root bundle if not found..
*/
public static ResourceBundle getBundle(String bundleName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Object[] getParameters() {
}

/**
* @param i18n
* @param i18n The i18n implementation to use for translation.
* @return localized message.
*/
public String getMessage(I18n i18n) {
Expand Down
10 changes: 5 additions & 5 deletions merlin-core/src/main/java/de/micromata/merlin/csv/CSVParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public CSVParser(final Reader source) {
/**
* Parses the first (next) line and returns the cells as string. Stores also the col numbers of the head cols for .
*
* @return
* @return cells
* @see #parseLine()
* @see #getCell(List, String)
*/
Expand All @@ -99,8 +99,8 @@ public List<String> parseHeadCols() {
/**
* Get the cell with the given colname (head cols had to be parsed first via {@link #parseHeadCols()}.
*
* @param cells
* @param colname
* @param cells cells of a row.
* @param colname the colname to get the cell for.
* @return cell content
*/
public String getCell(final List<String> cells, final String colname) {
Expand All @@ -123,7 +123,7 @@ public String getCell(final List<String> cells, final String colname) {
/**
* Returns null, if EOF.
*
* @return
* @return List of cell values.
*/
public List<String> parseLine() {
if (type == Type.EOF) {
Expand Down Expand Up @@ -193,7 +193,7 @@ public String parseCell() {

/**
*
* @param csvSeparatorChar
* @param csvSeparatorChar separator character.
* @return this for chaining.
*/
public CSVParser setCsvSeparatorChar(final char csvSeparatorChar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public CSVWriter writeEndOfLine() {
* Appends the given value to the buffer.
*
* @param value The value to append.
* @return this for chaining.
*/
public CSVWriter write(final long value) {
writeSeparator();
Expand All @@ -91,6 +92,7 @@ public CSVWriter write(final long value) {
* Appends the given value in the format "yyyy-MM-dd HH:mm:ss.SSS".
*
* @param value The value to append.
* @return this for chaining.
*/
public CSVWriter write(final Date value) {
writeSeparator();
Expand All @@ -104,9 +106,10 @@ public CSVWriter write(final Date value) {

/**
* Appends the given value. The string will be encapsulated in quotation marks: " Any occurance of the quotation mark will be quoted by
* duplication. Example: hallo -> "hallo", hal"lo -> "hal""lo"
* duplication. Example: hallo -&gt; "hallo", hal"lo -&gt; "hal""lo"
*
* @param s The value to append.
* @return this for chaining.
*/
public CSVWriter write(final String s) {
writeSeparator();
Expand All @@ -132,6 +135,7 @@ public CSVWriter write(final String s) {
* Appends the given value to the buffer in the format "yyyy-MM-dd HH:mm:ss.SSS".
*
* @param value The value to append.
* @return this for chaining.
*/
public CSVWriter write(final Object value) {
writeSeparator();
Expand Down
4 changes: 2 additions & 2 deletions merlin-core/src/main/java/de/micromata/merlin/data/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public String getRightPadString(String prefix, String property, String suffix) {
}

/**
* @param property
* @param offset
* @param property the property for {@link #getString(String)}.
* @param offset offset for {@link StringUtils#rightPad(String, int)}
* @return Formatted string with fixed length of length of longest property of this type.
*/
public String getRightPadString(String property, int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ExcelCell setCellValue(String str) {

/**
* @param workbook Needed for creating int DataFormat.
* @param intValue
* @param intValue The value to set.
* @return this for chaining.
*/
public ExcelCell setCellValue(ExcelWorkbook workbook, int intValue) {
Expand All @@ -44,7 +44,7 @@ public ExcelCell setCellValue(ExcelWorkbook workbook, int intValue) {

/**
* @param workbook Needed for creating int DataFormat.
* @param booleanValue
* @param booleanValue The value to set.
* @return this for chaining.
*/
public ExcelCell setCellValue(ExcelWorkbook workbook, boolean booleanValue) {
Expand All @@ -54,7 +54,7 @@ public ExcelCell setCellValue(ExcelWorkbook workbook, boolean booleanValue) {

/**
* @param workbook Needed for creating int DataFormat.
* @param doubleValue
* @param doubleValue The value to set.
* @return this for chaining.
*/
public ExcelCell setCellValue(ExcelWorkbook workbook, double doubleValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class ExcelChecksum {
private static final String CUSTOM_PROPERTY_CHECKSUM = "MerlinChecksum";

/**
* @param workbook
* @return
* @param workbook The workbook to calculate the checksum for.
* @return checksum.
*/
public static long buildChecksum(Workbook workbook) {
Adler32 cs = new Adler32();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ExcelColumnDateValidator extends ExcelColumnValidator {
/**
* Checks if the cell value is date formatted.
*
* @param cell
* @param cell The cell to validate.
* @param rowNumber Row number of cell value in given sheet.
* @return null if valid, otherwise validation error message to display.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ExcelColumnDef {
/**
* Return the number of this column (0-based). The number is set by {@link ExcelSheet#findAndReadHeadRow()}.
*
* @return
* @return the column number.
*/
public int getColumnNumber() {
return columnNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ExcelColumnNumberValidator extends ExcelColumnValidator {
* Checks if the cell value is of type {@link CellType#NUMERIC} or if {@link #isTryToConvertStringToNumber()} is true if
* it is possible to convert a string cell value to a number.
*
* @param cell
* @param cell The cell to validate.
* @param rowNumber Row number of cell value in given sheet.
* @return null if valid, otherwise validation error message to display.
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ public boolean isTryToConvertStringToNumber() {

/**
* If true a string value of a cell will be converted by this validator to a string (if possible). Default is false.
* @param tryToConvertStringToNumber
* @param tryToConvertStringToNumber The value to set.
*/
public void setTryToConvertStringToNumber(boolean tryToConvertStringToNumber) {
this.tryToConvertStringToNumber = tryToConvertStringToNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ExcelColumnOptionsValidator extends ExcelColumnValidator {
/**
* Cell values must match one of the given options.
*
* @param options
* @param options The options to match.
*/
public ExcelColumnOptionsValidator(String... options) {
this.options = options;
Expand All @@ -35,7 +35,7 @@ public ExcelColumnOptionsValidator(String... options) {
/**
* Cell values must match one of the given options.
*
* @param options
* @param options The options to match.
*/
public ExcelColumnOptionsValidator(List<Object> options) {
this.options = options.toArray(new String[0]);
Expand All @@ -44,7 +44,7 @@ public ExcelColumnOptionsValidator(List<Object> options) {
/**
* Checks pattern match if the cell value does match any of the configured options, otherwise returns null.
*
* @param cell
* @param cell The cell to validate.
* @param rowNumber Row number of cell value in given sheet.
* @return null if valid, otherwise validation error message to display.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ExcelColumnPatternValidator() {
}

/**
* @param patternRegExp
* @param patternRegExp The regexp for validation.
*/
public ExcelColumnPatternValidator(String patternRegExp) {
this.flags = flags;
Expand All @@ -37,8 +37,8 @@ public ExcelColumnPatternValidator(String patternRegExp) {
}

/**
* @param patternRegExp
* @param flags @see {@link Pattern#compile(String, int)}
* @param patternRegExp The regexp for validation.
* @param flags See {@link Pattern#compile(String, int)}
*/
public ExcelColumnPatternValidator(String patternRegExp, int flags) {
this.flags = flags;
Expand All @@ -49,7 +49,7 @@ public ExcelColumnPatternValidator(String patternRegExp, int flags) {
/**
* Checks pattern match if {@link #patternRegExp} is given, otherwise returns null.
*
* @param cell
* @param cell The cell to validate.
* @param rowNumber Row number of cell value in given sheet.
* @return null if valid, otherwise validation error message to display.
*/
Expand Down Expand Up @@ -90,7 +90,7 @@ public void setPatternRegExp(String patternRegExp) {

/**
* @param patternRegExp String patternRegExp to validate. If null, no patternRegExp match will be validated.
* @param flags @see {@link Pattern#compile(String, int)}
* @param flags See {@link Pattern#compile(String, int)}
* @see String#matches(String)
*/
public void setPatternRegExp(String patternRegExp, int flags) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ExcelColumnValidator() {
* Overwrite this for own validation.
* Checks required and unique if configured, otherwise returns null.
*
* @param cell
* @param cell The cell to validate.
* @param rowNumber Row number of cell value in given sheet.
* @return null if valid, otherwise validation error message to display.
*/
Expand Down Expand Up @@ -124,7 +124,7 @@ public ExcelColumnValidator setRequired() {
/**
* Mark this column and are all its cell values as required.
*
* @param required
* @param required The value to set.
* @return this for chaining.
*/
public ExcelColumnValidator setRequired(boolean required) {
Expand Down Expand Up @@ -156,7 +156,7 @@ public ExcelColumnValidator setUnique() {
/**
* All cell values must be unique, if given.
*
* @param unique
* @param unique The value to set.
* @return this for chaining.
*/
public ExcelColumnValidator setUnique(boolean unique) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ExcelRow(Row row) {
/**
* Assumes {@link ExcelCellType#STRING}
*
* @return
* @return The created cell.
*/
public ExcelCell createCell() {
return createCell(ExcelCellType.STRING);
Expand Down
Loading

0 comments on commit 7cfffc6

Please sign in to comment.