Skip to content

Commit

Permalink
fixes for Javadoc errors and some warnings (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
SingingBush committed Nov 14, 2022
1 parent 514250a commit e741815
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ private BufferStrategyFactory() {
*
* You can also pass in a fully qualified class name of a custom {@link BufferStrategy}.
*
* @param strategyName one of the supported BufferStrategies as per above
* @return an instance of the chosen BufferStrategy
* @throws IllegalArgumentException if the given strategyName does not resolve to a BufferStrategy.
*/
public static BufferStrategy valueOf(String strategyName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.apache.johnzon.core;

/**
* A <tt>Buffered</tt> is a source or destination of data that is buffered
* A <code>Buffered</code> is a source or destination of data that is buffered
* before writing or reading. The bufferSize method allows all participants
* in the underlying stream to align on this buffer size for optimization.
*
Expand All @@ -31,6 +31,7 @@ public interface Buffered { // https://github.com/apache/johnzon/pull/84#discuss
/**
* The buffer size used by this stream while reading input or before writing
* output to the underlying stream.
* @return the size of the buffer
*/
int bufferSize();
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ private void doAutoAdjust(final int length) {
}

/**
* @param currentLength length of the buffer
* @return the amount of bytes the current buffer should get extended with
*/
protected int getBufferExtends(int currentLength) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public int size() {

/**
* Take the given array object and fill a fresh Collection with it.
* @param array an array that is to be duplicated
* @return a new collection of the original array elements
* @throws IllegalArgumentException if the given value this is not an array.
*/
public static Collection<Object> newCollection(Object array) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
* An Adapter is similar to a {@link Converter}.
* The main difference is that a Converter always converts from/to a String.
* An adapter might e.g. convert to a Date or any other Object which will
* then be json-ified.<p>
* then be json-ified.
*
* A small example which has a special Java type to internally represent dates.
* Let's call it {@code DateHolder}.
* Our {@code Mapper} should treat it as a {@code java.util.Date}.
* For doing so we create a {@code DateHolderAdapter} like the following example shows:
* <pre>
* {@code
* public static class DateHolderAdapter implements Adapter<DateHolder, Date> {
* @Override
* public DateHolder to(Date date) {
Expand All @@ -41,6 +42,7 @@
* return new Date(dateHolder.getDate());
* }
* }
* }
* </pre>
*
* Consider a POJO has a DateHolder.
Expand All @@ -53,11 +55,15 @@
public interface Adapter<POJO_TYPE, JSON_TYPE> extends MapperConverter {
/**
* Transfer JSONTYPE_TYPE from JSON to POJO as POJO_TYPE.
* @param b the JSON type
* @return the equivalent Java type
*/
POJO_TYPE to(JSON_TYPE b);

/**
* Take the POJO_TYPE object A from a POJO an convert it to JSON_TYPE which will be inserted into the JSON output.
* @param a the Java type
* @return the equivalent JSON type
*/
JSON_TYPE from(POJO_TYPE a);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
*
* An example would be to convert joda LocalDate into Strings and back.
*
* @param <T>
* @param <T> the Java type that needs to be converted
*/
public interface Converter<T> extends MapperConverter {
String toString(T instance);
T fromString(String text);

// for generic converters it allows to explicitely provide the converted type (ex: enum converter)
// for generic converters it allows to explicitly provide the converted type (ex: enum converter)
// typically useful when generic type get resolved to a TypeVariable
interface TypeAccess {
Type type();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* The feature only gets activated if this annotation is available
* on the root object to be serialised/deserialised.
*
* @see MapperBuilder#setDeduplicateObjects(boolean)
* @see MapperBuilder#setDeduplicateObjects(Boolean)
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
Expand Down

0 comments on commit e741815

Please sign in to comment.