Skip to content

Commit d38fcf0

Browse files
committed
[javadoc]: Added javadoc for few methods and resolved javadoc warnings
1 parent 2e4e91c commit d38fcf0

File tree

4 files changed

+44
-21
lines changed

4 files changed

+44
-21
lines changed

src/main/java/io/github/millij/poi/ss/model/annotations/SheetColumn.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040

4141

4242
/**
43-
* Data presentation format of the Data cell.
43+
* Data presentation format of the Data Column.
4444
*
4545
* @return Data format String.
4646
*/
4747
String format() default "";
4848

4949
/**
50-
* DateTime Type
50+
* DateTimeType value of the Column
5151
*
52-
* @return
52+
* @return the {@link DateTimeType} value of the Column
5353
*/
5454
DateTimeType datetime() default DateTimeType.NONE;
5555

src/main/java/io/github/millij/poi/ss/writer/SpreadsheetWriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ default void write(final String filepath) throws IOException {
128128
/**
129129
* Writes the current Spreadsheet workbook to a file
130130
*
131-
* @param fiel output file
131+
* @param file output file
132132
*
133133
* @throws IOException if the file is not writable.
134134
*/

src/main/java/io/github/millij/poi/util/Beans.java

+38-17
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ public static Object getProperty(final Object bean, final String propName) throw
122122
// ------------------------------------------------------------------------
123123

124124
/**
125+
* Set a property value of an object.
126+
*
127+
* @param target Target Object
128+
* @param propName name of the Object Property
129+
* @param propType type of the Object Property
130+
* @param propValue Value of the property to be set
131+
*
132+
* @throws Exception exceptions when invoking the accessor methods
125133
*/
126134
public static void setProperty(final Object target, final String propName, final Class<?> propType,
127135
final Object propValue) throws Exception {
@@ -130,30 +138,34 @@ public static void setProperty(final Object target, final String propName, final
130138
return; // Skip Setter if property value is NULL
131139
}
132140

133-
try {
134-
// Convert the specified value to the required type
135-
final Object newValue;
136-
if (propValue instanceof String) {
137-
newValue = CONVERT_UTILS_BEAN.convert((String) propValue, propType);
141+
// Convert the specified value to the required type
142+
final Object newValue;
143+
if (propValue instanceof String) {
144+
newValue = CONVERT_UTILS_BEAN.convert((String) propValue, propType);
145+
} else {
146+
final Converter converter = CONVERT_UTILS_BEAN.lookup(propType);
147+
if (converter != null) {
148+
newValue = converter.convert(propType, propValue);
138149
} else {
139-
final Converter converter = CONVERT_UTILS_BEAN.lookup(propType);
140-
if (converter != null) {
141-
newValue = converter.convert(propType, propValue);
142-
} else {
143-
newValue = propValue;
144-
}
150+
newValue = propValue;
145151
}
146-
147-
// Invoke the setter method
148-
PROP_UTILS_BEAN.setProperty(target, propName, newValue);
149-
150-
} catch (Exception ex) {
151-
//
152152
}
153+
154+
// Invoke the setter method
155+
PROP_UTILS_BEAN.setProperty(target, propName, newValue);
153156
}
154157

155158

156159
/**
160+
* Set a property value of an object.
161+
*
162+
* @param target Target Object
163+
* @param propName name of the Object Property
164+
* @param propValue Value of the property to be set
165+
* @param format Value format
166+
* @param dateTimeType {@link DateTimeType} value for Date/Time properties
167+
*
168+
* @throws Exception exceptions when invoking the accessor methods
157169
*/
158170
@SuppressWarnings({"unchecked", "rawtypes"})
159171
public static void setProperty(final Object target, final String propName, final Object propValue,
@@ -206,6 +218,15 @@ public static void setProperty(final Object target, final String propName, final
206218

207219
/**
208220
* Set the Date/Time property of the Target Bean.
221+
*
222+
* @param target Target Object
223+
* @param propName name of the Object Property
224+
* @param propType type of the Object Property
225+
* @param propValue Value of the property to be set
226+
* @param format Value format
227+
* @param dateTimeType {@link DateTimeType} value for Date/Time properties
228+
*
229+
* @throws Exception exceptions when invoking the accessor methods
209230
*/
210231
private static void setDateTimeProperty(final Object target, final String propName, final Class<?> propType,
211232
final Object propValue, final String format, final DateTimeType dateTimeType) throws Exception {

src/main/java/io/github/millij/poi/util/Spreadsheet.java

+2
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ private static boolean validateRowData(final Map<String, Object> rowDataMap,
336336
/**
337337
* Normalize the string. typically used for case-insensitive comparison.
338338
*
339+
* @param inStr input string
340+
*
339341
* @deprecated in favor of {@link Strings#normalize(String)}
340342
*/
341343
@Deprecated

0 commit comments

Comments
 (0)