diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java index f8379cda1..76df36c1c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ExecutionContext.java @@ -58,7 +58,9 @@ public class ExecutionContext implements Serializable { } /** - * @param executionContext + * Initializes a new execution context with the contents of another executionContext. + * + * @param executionContext containing the entries to be copied to this current context. */ public ExecutionContext(ExecutionContext executionContext) { this(); @@ -325,6 +327,9 @@ public class ExecutionContext implements Serializable { /** * Removes the mapping for a key from this context if it is present. * + * @param key {@link String} that identifies the entry to be removed from the context. + * @return the value that was removed from the context. + * * @see java.util.Map#remove(Object) */ public Object remove(String key) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java index e253f0e1d..3f77c9f94 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemProcessor.java @@ -36,7 +36,8 @@ public interface ItemProcessor { * @param item to be processed * @return potentially modified or new item for continued processing, null if processing of the * provided item should not continue. - * @throws Exception + * + * @throws Exception thrown if exception occurs during processing. */ O process(I item) throws Exception; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemStreamException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemStreamException.java index ca8461435..c0a2a5064 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemStreamException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemStreamException.java @@ -25,7 +25,7 @@ package org.springframework.batch.item; public class ItemStreamException extends RuntimeException { /** - * @param message + * @param message the String that contains a detailed message. */ public ItemStreamException(String message) { super(message); @@ -35,6 +35,7 @@ public class ItemStreamException extends RuntimeException { * Constructs a new instance with a message and nested exception. * * @param msg the exception message. + * @param nested the cause of the exception. * */ public ItemStreamException(String msg, Throwable nested) { @@ -43,6 +44,8 @@ public class ItemStreamException extends RuntimeException { /** * Constructs a new instance with a nested exception and empty message. + * + * @param nested the cause of the exception. */ public ItemStreamException(Throwable nested) { super(nested); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/KeyValueItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/KeyValueItemWriter.java index 08a5bd3df..79ecca123 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/KeyValueItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/KeyValueItemWriter.java @@ -59,7 +59,8 @@ public abstract class KeyValueItemWriter implements ItemWriter, Initial /** * Set the {@link Converter} to use to derive the key from the item - * @param itemKeyMapper + * + * @param itemKeyMapper the {@link Converter} used to derive a key from an item. */ public void setItemKeyMapper(Converter itemKeyMapper) { this.itemKeyMapper = itemKeyMapper; @@ -67,7 +68,9 @@ public abstract class KeyValueItemWriter implements ItemWriter, Initial /** * Sets the delete flag to have the item writer perform deletes - * @param delete + * + * @param delete if true {@link ItemWriter} will perform deletes, + * if False not to perform deletes. */ public void setDelete(boolean delete) { this.delete = delete; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java index 22308a974..d5f8ffe21 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/adapter/AbstractMethodInvokingDelegator.java @@ -50,9 +50,10 @@ public abstract class AbstractMethodInvokingDelegator implements Initializing /** * Invoker the target method with arguments set by * {@link #setArguments(Object[])}. + * * @return object returned by invoked method - * @throws DynamicMethodInvocationException if the {@link MethodInvoker} - * used throws exception + * + * @throws Exception if the {@link MethodInvoker} used, throws an Exception. */ protected T invokeDelegateMethod() throws Exception { MethodInvoker invoker = createMethodInvoker(targetObject, targetMethod); @@ -62,10 +63,11 @@ public abstract class AbstractMethodInvokingDelegator implements Initializing /** * Invokes the target method with given argument. + * * @param object argument for the target method * @return object returned by target method - * @throws DynamicMethodInvocationException if the {@link MethodInvoker} - * used throws exception + * + * @throws Exception if the {@link MethodInvoker} used throws exception */ protected T invokeDelegateMethodWithArgument(Object object) throws Exception { MethodInvoker invoker = createMethodInvoker(targetObject, targetMethod); @@ -75,10 +77,11 @@ public abstract class AbstractMethodInvokingDelegator implements Initializing /** * Invokes the target method with given arguments. + * * @param args arguments for the invoked method * @return object returned by invoked method - * @throws DynamicMethodInvocationException if the {@link MethodInvoker} - * used throws exception + * + * @throws Exception if the {@link MethodInvoker} used, throws an exception */ protected T invokeDelegateMethodWithArguments(Object[] args) throws Exception { MethodInvoker invoker = createMethodInvoker(targetObject, targetMethod); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/RepositoryItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/RepositoryItemWriter.java index 1a4461aea..dde5c4d23 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/RepositoryItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/RepositoryItemWriter.java @@ -66,7 +66,7 @@ public class RepositoryItemWriter implements ItemWriter, InitializingBean * Specifies what method on the repository to call. This method must have the type of * object passed to this writer as the sole argument. * - * @param methodName + * @param methodName {@link String} containing the method name. */ public void setMethodName(String methodName) { this.methodName = methodName; @@ -99,6 +99,8 @@ public class RepositoryItemWriter implements ItemWriter, InitializingBean * a subclass if necessary. * * @param items the list of items to be persisted. + * + * @throws Exception thrown if error occurs during writing. */ protected void doWrite(List items) throws Exception { if (logger.isDebugEnabled()) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateCursorItemReaderBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateCursorItemReaderBuilder.java index 88e1b4684..e53551589 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateCursorItemReaderBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/HibernateCursorItemReaderBuilder.java @@ -222,8 +222,9 @@ public class HibernateCursorItemReaderBuilder { /** * Used to configure a {@link HibernateNativeQueryProvider}. This is ignored if - * @param nativeQuery - * @return + * + * @param nativeQuery {@link String} containing the native query. + * @return this instance for method chaining */ public HibernateCursorItemReaderBuilder nativeQuery(String nativeQuery) { this.nativeQuery = nativeQuery; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JpaPagingItemReaderBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JpaPagingItemReaderBuilder.java index 695656a97..9a51883a9 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JpaPagingItemReaderBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/builder/JpaPagingItemReaderBuilder.java @@ -183,8 +183,9 @@ public class JpaPagingItemReaderBuilder { * The {@link EntityManagerFactory} to be used for executing the configured * {@link #queryString}. * - * @param entityManagerFactory - * @return + * @param entityManagerFactory {@link EntityManagerFactory} used to create + * {@link javax.persistence.EntityManager} + * @return this instance for method chaining */ public JpaPagingItemReaderBuilder entityManagerFactory(EntityManagerFactory entityManagerFactory) { this.entityManagerFactory = entityManagerFactory; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java index 4b2b1276c..49f349400 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/orm/JpaQueryProvider.java @@ -42,7 +42,7 @@ public interface JpaQueryProvider { /** * Provide an {@link EntityManager} for the query to be built. * - * @param entityManager + * @param entityManager to be used by the JpQueryProvider. */ void setEntityManager(EntityManager entityManager); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java index 7157c897d..65b946396 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/DataFieldMaxValueIncrementerFactory.java @@ -41,11 +41,16 @@ public interface DataFieldMaxValueIncrementerFactory { /** * Returns boolean indicated whether or not the provided string is supported by this * factory. + * + * @param databaseType {@link String} containing the database type. + * @return true if the incrementerType is supported by this database type. Else false is returned. */ public boolean isSupportedIncrementerType(String databaseType); /** * Returns the list of supported database incrementer types + * + * @return an array of {@link String}s containing the supported incrementer types. */ public String[] getSupportedIncrementerTypes(); } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/ListPreparedStatementSetter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/ListPreparedStatementSetter.java index cd9d9d2a1..6605448d5 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/ListPreparedStatementSetter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/ListPreparedStatementSetter.java @@ -61,6 +61,7 @@ PreparedStatementSetter, InitializingBean { * It is assumed that their order in the List is the order of the parameters * in the PreparedStatement. * + * @param parameters list containing the parameter values to be used. * @deprecated In favor of the constructor */ @Deprecated diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryUtils.java index 651a18435..db6b33ccf 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/support/SqlPagingQueryUtils.java @@ -156,6 +156,7 @@ public class SqlPagingQueryUtils { * * @param provider {@link AbstractSqlPagingQueryProvider} providing the * implementation specifics + * @param selectClause {@link String} containing the select portion of the query. * @param remainingPageQuery is this query for the remaining pages (true) as * opposed to the first page (false) * @param rowNumClause the implementation specific row num clause to be used @@ -242,7 +243,8 @@ public class SqlPagingQueryUtils { /** * Generates ORDER BY attributes based on the sort keys. * - * @param provider + * @param provider the {@link AbstractSqlPagingQueryProvider} to be used for + * used for pagination. * @return a String that can be appended to an ORDER BY clause. */ public static String buildSortClause(AbstractSqlPagingQueryProvider provider) { @@ -252,7 +254,8 @@ public class SqlPagingQueryUtils { /** * Generates ORDER BY attributes based on the sort keys. * - * @param sortKeys + * @param sortKeys {@link Map} where the key is the name of the column to be + * sorted and the value contains the {@link Order}. * @return a String that can be appended to an ORDER BY clause. */ public static String buildSortClause(Map sortKeys) { @@ -280,8 +283,10 @@ public class SqlPagingQueryUtils { /** * Appends the where conditions required to query for the subsequent pages. * - * @param provider - * @param sql + * @param provider the {@link AbstractSqlPagingQueryProvider} to be used for + * pagination. + * @param sql {@link StringBuilder} containing the sql to be used for the + * query. */ public static void buildSortConditions( AbstractSqlPagingQueryProvider provider, StringBuilder sql) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileFooterCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileFooterCallback.java index 5c5583866..ec3a0a197 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileFooterCallback.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileFooterCallback.java @@ -29,6 +29,10 @@ public interface FlatFileFooterCallback { /** * Write contents to a file using the supplied {@link Writer}. It is not * required to flush the writer inside this method. + * + * @param writer the {@link Writer} to be used to write the footer. + * + * @throws IOException if error occurs during writing. */ void writeFooter(Writer writer) throws IOException; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileHeaderCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileHeaderCallback.java index b4374cdbf..4b5da3ef0 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileHeaderCallback.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileHeaderCallback.java @@ -29,6 +29,10 @@ public interface FlatFileHeaderCallback { /** * Write contents to a file using the supplied {@link Writer}. It is not * required to flush the writer inside this method. + * + * @param writer the {@link Writer} to be used to write the header. + * + * @throws IOException if error occurs during writing. */ void writeHeader(Writer writer) throws IOException; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileItemWriter.java index 9e3941eab..a554b2e95 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/FlatFileItemWriter.java @@ -161,6 +161,9 @@ InitializingBean { /** * Sets encoding for output template. + * + * @param newEncoding {@link String} containing the encoding to be used for + * the writer. */ public void setEncoding(String newEncoding) { this.encoding = newEncoding; @@ -217,6 +220,10 @@ InitializingBean { /** * headerCallback will be called before writing the first item to file. * Newline will be automatically appended after the header is written. + * + * @param headerCallback {@link FlatFileHeaderCallback} to be used after + * header is written. + * */ public void setHeaderCallback(FlatFileHeaderCallback headerCallback) { this.headerCallback = headerCallback; @@ -225,6 +232,10 @@ InitializingBean { /** * footerCallback will be called after writing the last item to file, but * before the file is closed. + * + * @param footerCallback {@link FlatFileFooterCallback} to be used after + * footer is written. + * */ public void setFooterCallback(FlatFileFooterCallback footerCallback) { this.footerCallback = footerCallback; @@ -233,6 +244,9 @@ InitializingBean { /** * Flag to indicate that writing to the buffer should be delayed if a * transaction is active. Defaults to true. + * + * @param transactional true if writing to buffer should be delayed. + * */ public void setTransactional(boolean transactional) { this.transactional = transactional; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java index 3255ba84b..48c73eb53 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/MultiResourceItemWriter.java @@ -91,6 +91,8 @@ public class MultiResourceItemWriter extends AbstractItemStreamItemWriter /** * Allows customization of the suffix of the created resources based on the * index. + * + * @param suffixCreator {@link ResourceSuffixCreator} to be used by the writer. */ public void setResourceSuffixCreator(ResourceSuffixCreator suffixCreator) { this.suffixCreator = suffixCreator; @@ -99,6 +101,9 @@ public class MultiResourceItemWriter extends AbstractItemStreamItemWriter /** * After this limit is exceeded the next chunk will be written into newly * created resource. + * + * @param itemCountLimitPerResource int containing the limit to determine + * when the next chunk will be written to a newly created resource. */ public void setItemCountLimitPerResource(int itemCountLimitPerResource) { this.itemCountLimitPerResource = itemCountLimitPerResource; @@ -106,6 +111,9 @@ public class MultiResourceItemWriter extends AbstractItemStreamItemWriter /** * Delegate used for actual writing of the output. + * + * @param delegate {@link ResourceAwareItemWriterItemStream} that will be used + * to write the output. */ public void setDelegate(ResourceAwareItemWriterItemStream delegate) { this.delegate = delegate; @@ -116,11 +124,20 @@ public class MultiResourceItemWriter extends AbstractItemStreamItemWriter * the same directory and use the same name as this prototype with appended * suffix (according to * {@link #setResourceSuffixCreator(ResourceSuffixCreator)}. + * + * @param resource The prototype resource. */ public void setResource(Resource resource) { this.resource = resource; } + + /** + * Establishes that state of each resource is saved to the context when + * update is called. + * + * @param saveState true the state is saved. + */ public void setSaveState(boolean saveState) { this.saveState = saveState; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java index 1f1b5b1dc..9269bfe8a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/SimpleBinaryBufferedReaderFactory.java @@ -44,7 +44,7 @@ public class SimpleBinaryBufferedReaderFactory implements BufferedReaderFactory private String lineEnding = DEFAULT_LINE_ENDING; /** - * @param lineEnding + * @param lineEnding {@link String} contains the line ending to use. */ public void setLineEnding(String lineEnding) { this.lineEnding = lineEnding; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/ConversionException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/ConversionException.java index 0951af744..0822d2641 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/ConversionException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/ConversionException.java @@ -23,7 +23,7 @@ package org.springframework.batch.item.file.transform; public class ConversionException extends RuntimeException { /** - * @param msg + * @param msg the detail message. */ public ConversionException(String msg) { super(msg); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java index db2d78070..dd5374258 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/DefaultFieldSet.java @@ -649,6 +649,8 @@ public class DefaultFieldSet implements FieldSet { /** * Read and trim the {@link String} value at 'index'. + * + * @param index the offset in the token array to obtain the value to be trimmed. * * @return null if the field value is null. */ @@ -664,9 +666,12 @@ public class DefaultFieldSet implements FieldSet { } /** - * Read and trim the {@link String} value from column with given ' - * name. - * + * Retrieve the index of where a specified column is located based on the + * name parameter. + * + * @param name the value to search in the {@link List} of names. + * @return the index in the {@link List} of names where the name was found. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldExtractor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldExtractor.java index f5c902b3c..5b738336d 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldExtractor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldExtractor.java @@ -24,7 +24,7 @@ package org.springframework.batch.item.file.transform; public interface FieldExtractor { /** - * @param item + * @param item the object that contains the the information to be extracted. * @return an array containing item's parts */ Object[] extract(T item); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSet.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSet.java index d724e36eb..7bab53b38 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSet.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSet.java @@ -57,6 +57,8 @@ public interface FieldSet { * Read the {@link String} value at index 'index'. * * @param index the field index. + * @return {@link String} containing the value at the index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ String readString(int index); @@ -65,6 +67,7 @@ public interface FieldSet { * Read the {@link String} value from column with given 'name'. * * @param name the field name. + * @return {@link String} containing the value from the specified name. */ String readString(String name); @@ -73,6 +76,8 @@ public interface FieldSet { * trailing whitespace (don't trim). * * @param index the field index. + * @return {@link String} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ String readRawString(int index); @@ -82,6 +87,7 @@ public interface FieldSet { * including trailing whitespace (don't trim). * * @param name the field name. + * @return {@link String} containing the value from the specified name. */ String readRawString(String name); @@ -89,6 +95,8 @@ public interface FieldSet { * Read the 'boolean' value at index 'index'. * * @param index the field index. + * @return boolean containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ boolean readBoolean(int index); @@ -97,6 +105,8 @@ public interface FieldSet { * Read the 'boolean' value from column with given 'name'. * * @param name the field name. + * @return boolean containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -108,6 +118,8 @@ public interface FieldSet { * @param index the field index. * @param trueValue the value that signifies {@link Boolean#TRUE true}; * case-sensitive. + * @return boolean containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds, or if * the supplied trueValue is null. */ @@ -119,6 +131,8 @@ public interface FieldSet { * @param name the field name. * @param trueValue the value that signifies {@link Boolean#TRUE true}; * case-sensitive. + * @return boolean containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined, or if the supplied trueValue is null. */ @@ -128,6 +142,8 @@ public interface FieldSet { * Read the 'char' value at index 'index'. * * @param index the field index. + * @return char containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ char readChar(int index); @@ -136,6 +152,8 @@ public interface FieldSet { * Read the 'char' value from column with given 'name'. * * @param name the field name. + * @return char containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -145,6 +163,8 @@ public interface FieldSet { * Read the 'byte' value at index 'index'. * * @param index the field index. + * @return byte containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ byte readByte(int index); @@ -152,7 +172,8 @@ public interface FieldSet { /** * Read the 'byte' value from column with given 'name'. * - * @param name the field name. + * @param name the field name.* + * @return byte containing the value from the specified name. */ byte readByte(String name); @@ -160,6 +181,8 @@ public interface FieldSet { * Read the 'short' value at index 'index'. * * @param index the field index. + * @return short containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ short readShort(int index); @@ -168,6 +191,8 @@ public interface FieldSet { * Read the 'short' value from column with given 'name'. * * @param name the field name. + * @return short containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -177,6 +202,8 @@ public interface FieldSet { * Read the 'int' value at index 'index'. * * @param index the field index. + * @return int containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ int readInt(int index); @@ -185,6 +212,8 @@ public interface FieldSet { * Read the 'int' value from column with given 'name'. * * @param name the field name. + * @return int containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -196,6 +225,9 @@ public interface FieldSet { * blank. * * @param index the field index. + * @param defaultValue the value to use if the field value is blank. + * @return int containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ int readInt(int index, int defaultValue); @@ -206,6 +238,9 @@ public interface FieldSet { * blank. * * @param name the field name. + * @param defaultValue the value to use if the field value is blank. + * @return int containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -215,6 +250,8 @@ public interface FieldSet { * Read the 'long' value at index 'index'. * * @param index the field index. + * @return long containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ long readLong(int index); @@ -223,6 +260,8 @@ public interface FieldSet { * Read the 'long' value from column with given 'name'. * * @param name the field name. + * @return long containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -234,6 +273,9 @@ public interface FieldSet { * blank. * * @param index the field index. + * @param defaultValue the value to use if the field value is blank. + * @return long containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ long readLong(int index, long defaultValue); @@ -244,6 +286,9 @@ public interface FieldSet { * blank. * * @param name the field name. + * @param defaultValue the value to use if the field value is blank. + * @return long containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -253,6 +298,8 @@ public interface FieldSet { * Read the 'float' value at index 'index'. * * @param index the field index. + * @return float containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ float readFloat(int index); @@ -261,6 +308,8 @@ public interface FieldSet { * Read the 'float' value from column with given 'name. * * @param name the field name. + * @return float containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -270,6 +319,8 @@ public interface FieldSet { * Read the 'double' value at index 'index'. * * @param index the field index. + * @return double containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ double readDouble(int index); @@ -278,6 +329,8 @@ public interface FieldSet { * Read the 'double' value from column with given 'name. * * @param name the field name. + * @return double containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -287,6 +340,8 @@ public interface FieldSet { * Read the {@link java.math.BigDecimal} value at index 'index'. * * @param index the field index. + * @return {@link BigDecimal} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ BigDecimal readBigDecimal(int index); @@ -295,6 +350,8 @@ public interface FieldSet { * Read the {@link java.math.BigDecimal} value from column with given 'name. * * @param name the field name. + * @return {@link BigDecimal} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -306,6 +363,9 @@ public interface FieldSet { * value at index 'index' is blank. * * @param index the field index. + * @param defaultValue the value to use if the field value is blank. + * @return {@link BigDecimal} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. */ BigDecimal readBigDecimal(int index, BigDecimal defaultValue); @@ -317,6 +377,8 @@ public interface FieldSet { * * @param name the field name. * @param defaultValue the default value to use if the field is blank + * @return {@link BigDecimal} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -327,6 +389,8 @@ public interface FieldSet { * designated column index. * * @param index the field index. + * @return {@link Date} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. * @throws IllegalArgumentException if the value is not parseable * @throws NullPointerException if the value is empty @@ -338,6 +402,8 @@ public interface FieldSet { * with given name. * * @param name the field name. + * @return {@link Date} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined or if the value is not parseable * @throws NullPointerException if the value is empty @@ -350,6 +416,8 @@ public interface FieldSet { * * @param index the field index. * @param defaultValue the default value to use if the field is blank + * @return {@link Date} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. * @throws IllegalArgumentException if the value is not parseable * @throws NullPointerException if the value is empty @@ -362,6 +430,8 @@ public interface FieldSet { * * @param name the field name. * @param defaultValue the default value to use if the field is blank + * @return {@link Date} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined. */ @@ -373,6 +443,8 @@ public interface FieldSet { * * @param index the field index. * @param pattern the pattern describing the date and time format + * @return {@link Date} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. * @throws IllegalArgumentException if the date cannot be parsed. * @@ -385,6 +457,8 @@ public interface FieldSet { * * @param name the field name. * @param pattern the pattern describing the date and time format + * @return {@link Date} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined or if the specified field cannot be parsed * @@ -398,6 +472,8 @@ public interface FieldSet { * @param index the field index. * @param pattern the pattern describing the date and time format * @param defaultValue the default value to use if the field is blank + * @return {@link Date} containing the value from the specified index. + * * @throws IndexOutOfBoundsException if the index is out of bounds. * @throws IllegalArgumentException if the date cannot be parsed. * @@ -411,6 +487,8 @@ public interface FieldSet { * @param name the field name. * @param pattern the pattern describing the date and time format * @param defaultValue the default value to use if the field is blank + * @return {@link Date} containing the value from the specified name. + * * @throws IllegalArgumentException if a column with given name is not * defined or if the specified field cannot be parsed * @@ -419,6 +497,8 @@ public interface FieldSet { /** * Return the number of fields in this 'FieldSet'. + * + * @return int containing the number of fields in this field set. */ int getFieldCount(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSetFactory.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSetFactory.java index 4c61ca32c..7d5614f4f 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSetFactory.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FieldSetFactory.java @@ -26,8 +26,11 @@ public interface FieldSetFactory { /** * Create a FieldSet with named tokens. The token values can then be * retrieved either by name or by column number. + * * @param values the token values * @param names the names of the tokens + * @return an instance of {@link FieldSet}. + * * @see DefaultFieldSet#readString(String) */ FieldSet create(String[] values, String[] names); @@ -35,7 +38,10 @@ public interface FieldSetFactory { /** * Create a FieldSet with anonymous tokens. They can only be retrieved by * column number. + * * @param values the token values + * @return an instance of {@link FieldSet}. + * * @see FieldSet#readString(int) */ FieldSet create(String[] values); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FlatFileFormatException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FlatFileFormatException.java index 827db10b2..3b5ec8c59 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FlatFileFormatException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FlatFileFormatException.java @@ -34,6 +34,8 @@ public class FlatFileFormatException extends RuntimeException { * Create a new {@link FlatFileFormatException} based on a message. * * @param message the message for this exception + * @param input {@link String} containing the input for that caused this + * exception to be thrown. */ public FlatFileFormatException(String message, String input) { super(message); @@ -58,5 +60,10 @@ public class FlatFileFormatException extends RuntimeException { super(message, cause); } + /** + * Retrieve the input that caused this exception. + * + * @return String containing the input. + */ public String getInput() { return input; } } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FormatterLineAggregator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FormatterLineAggregator.java index bd1d20aea..eb63d4e5c 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FormatterLineAggregator.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/FormatterLineAggregator.java @@ -60,7 +60,9 @@ public class FormatterLineAggregator extends ExtractorLineAggregator { /** * Set the format string used to aggregate items. - * + * + * @param format {@link String} containing the format to use. + * * @see Formatter */ public void setFormat(String format) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/IncorrectLineLengthException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/IncorrectLineLengthException.java index ce80de6bf..7797796aa 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/IncorrectLineLengthException.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/IncorrectLineLengthException.java @@ -30,6 +30,12 @@ public class IncorrectLineLengthException extends FlatFileFormatException { private int expectedLength; /** + * @param message the message for this exception. + * @param expectedLength int containing the length that was expected. + * @param actualLength int containing the actual length. + * @param input the {@link String} that contained the contents that caused + * the exception to be thrown. + * * @since 2.2.6 */ public IncorrectLineLengthException(String message, int expectedLength, int actualLength, String input) { @@ -38,6 +44,11 @@ public class IncorrectLineLengthException extends FlatFileFormatException { this.actualLength = actualLength; } + /** + * @param message the message for this exception. + * @param expectedLength int containing the length that was expected. + * @param actualLength int containing the actual length. + */ public IncorrectLineLengthException(String message, int expectedLength, int actualLength) { super(message); this.expectedLength = expectedLength; @@ -45,6 +56,11 @@ public class IncorrectLineLengthException extends FlatFileFormatException { } /** + * @param expectedLength int containing the length that was expected. + * @param actualLength int containing the actual length. + * @param input the {@link String} that contained the contents that caused + * the exception to be thrown. + * @since 2.2.6 */ public IncorrectLineLengthException(int expectedLength, int actualLength, String input) { @@ -53,16 +69,30 @@ public class IncorrectLineLengthException extends FlatFileFormatException { this.expectedLength = expectedLength; } + /** + * @param expectedLength int containing the length that was expected. + * @param actualLength int containing the actual length. + */ public IncorrectLineLengthException(int expectedLength, int actualLength) { super("Incorrect line length in record: expected " + expectedLength + " actual " + actualLength); this.actualLength = actualLength; this.expectedLength = expectedLength; } - + + /** + * Retrieves the actual length that was recorded for this exception. + * + * @return int containing the actual length. + */ public int getActualLength() { return actualLength; } - + + /** + * Retrieves the expected length that was recorded for this exception. + * + * @return int containing the expected length. + */ public int getExpectedLength() { return expectedLength; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/RangeArrayPropertyEditor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/RangeArrayPropertyEditor.java index 58d479c32..e2460a227 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/RangeArrayPropertyEditor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/file/transform/RangeArrayPropertyEditor.java @@ -55,7 +55,7 @@ public class RangeArrayPropertyEditor extends PropertyEditorSupport { * Set force disjoint ranges. If set to TRUE, ranges are validated to be disjoint. * For example: defining ranges '1-10, 5-15' will cause IllegalArgumentException in * case of forceDisjointRanges=TRUE. - * @param forceDisjointRanges + * @param forceDisjointRanges true to force disjoint ranges. */ public void setForceDisjointRanges(boolean forceDisjointRanges) { this.forceDisjointRanges = forceDisjointRanges; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ldif/builder/MappingLdifReaderBuilder.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ldif/builder/MappingLdifReaderBuilder.java index cd352c98d..7fe09e869 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ldif/builder/MappingLdifReaderBuilder.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ldif/builder/MappingLdifReaderBuilder.java @@ -163,7 +163,9 @@ public class MappingLdifReaderBuilder { /** * Setter for object mapper. This property is required to be set. + * * @param recordMapper maps record to an object + * @return this instance for method chaining. */ public MappingLdifReaderBuilder recordMapper(RecordMapper recordMapper) { this.recordMapper = recordMapper; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/SimpleMailMessageItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/SimpleMailMessageItemWriter.java index 7acc699ed..30b2ac21e 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/SimpleMailMessageItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/mail/SimpleMailMessageItemWriter.java @@ -63,7 +63,7 @@ public class SimpleMailMessageItemWriter implements ItemWriter streams = new ArrayList(); /** - * Public setter for the listeners. + * Public setter for the streams. * - * @param listeners + * @param streams array of {@link ItemStream}. */ - public void setStreams(ItemStream[] listeners) { - this.streams = Arrays.asList(listeners); + public void setStreams(ItemStream[] streams) { + this.streams = Arrays.asList(streams); } /** * Register a {@link ItemStream} as one of the interesting providers under * the provided key. - * + * + * @param stream an instance of {@link ItemStream} to be added to the list of streams. */ public void register(ItemStream stream) { synchronized (streams) { @@ -77,7 +78,10 @@ public class CompositeItemStream implements ItemStream { /** * Broadcast the call to close. - * @throws ItemStreamException + + * @throws ItemStreamException thrown if one of the {@link ItemStream}s in + * the list fails to close. This is a sequential operation so all itemStreams + * in the list after the one that failed to close will remain open. */ @Override public void close() throws ItemStreamException { @@ -88,7 +92,10 @@ public class CompositeItemStream implements ItemStream { /** * Broadcast the call to open. - * @throws ItemStreamException + * + * @throws ItemStreamException thrown if one of the {@link ItemStream}s in + * the list fails to open. This is a sequential operation so all itemStreams + * in the list after the one that failed to open will not be opened. */ @Override public void open(ExecutionContext executionContext) throws ItemStreamException { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java index 9baba4296..7691180d5 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ScriptItemProcessor.java @@ -82,7 +82,7 @@ public class ScriptItemProcessor implements ItemProcessor, Initializ *

* * @param scriptSource the {@link String} form of the script source code to use. - * @param language the language of the script as returned by the {@link javax.script.ScriptEngineFactory} + * @param language the language of the script. */ public void setScriptSource(String scriptSource, String language) { Assert.hasText(language, "Language must contain the script language"); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/ExecutionContextUserSupport.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/ExecutionContextUserSupport.java index 336d3c900..96d87d08a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/ExecutionContextUserSupport.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/ExecutionContextUserSupport.java @@ -54,10 +54,13 @@ public class ExecutionContextUserSupport { /** * Prefix the argument with {@link #getName()} to create a unique key that can be safely used to identify data * stored in {@link ExecutionContext}. + * + * @param suffix {@link String} to be used to generate the key. + * @return the key that was generated based on the name and the suffix. */ - public String getKey(String s) { + public String getKey(String suffix) { Assert.hasText(name, "Name must be assigned for the sake of defining the execution context keys prefix."); - return name + "." + s; + return name + "." + suffix; } } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/FileUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/FileUtils.java index 49b5458b6..5c8d26a6e 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/FileUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/util/FileUtils.java @@ -95,6 +95,20 @@ public final class FileUtils { } /** + * Set up output file for batch processing. This method implements common logic for handling output files when + * starting or restarting file I/O. When starting output file processing, creates/overwrites new file. When + * restarting output file processing, checks whether file is writable. + * + * @param file file to be set up + * @param restarted true signals that we are restarting output file processing + * @param overwriteOutputFile If set to true, output file will be overwritten (this flag is ignored when processing + * is restart) + * + * @throws IllegalArgumentException when file is null + * @throws ItemStreamException when starting output file processing, file exists and flag "overwriteOutputFile" is + * set to false + * @throws ItemStreamException when unable to create file or file is not writable + * * @deprecated use the version with explicit append parameter instead. Here append=false is assumed. */ @Deprecated @@ -106,6 +120,10 @@ public final class FileUtils { * Create a new file if it doesn't already exist. * * @param file the file to create on the filesystem + * @return true if file was created else false. + * + * @throws IOException is thrown if error occurs during creation and file + * does not exist. */ public static boolean createNewFile(File file) throws IOException { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidatingItemProcessor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidatingItemProcessor.java index f419295ac..79b5ca102 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidatingItemProcessor.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidatingItemProcessor.java @@ -43,6 +43,8 @@ public class ValidatingItemProcessor implements ItemProcessor, Initiali /** * Creates a ValidatingItemProcessor based on the given Validator. + * + * @param validator the {@link Validator} instance to be used. */ public ValidatingItemProcessor(Validator validator) { this.validator = validator; @@ -51,7 +53,7 @@ public class ValidatingItemProcessor implements ItemProcessor, Initiali /** * Set the validator used to validate each item. * - * @param validator + * @param validator the {@link Validator} instance to be used. */ public void setValidator(Validator validator) { this.validator = validator; @@ -60,7 +62,8 @@ public class ValidatingItemProcessor implements ItemProcessor, Initiali /** * Should the processor filter invalid records instead of skipping them? * - * @param filter + * @param filter true if filter is to return null or false if filter is to + * throw a {@link ValidationException}. */ public void setFilter(boolean filter) { this.filter = filter; diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java index 76fab9317..d4091e41a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemReader.java @@ -139,6 +139,8 @@ ResourceAwareItemReaderItemStream, InitializingBean { * * This implementation simply looks for the next corresponding element, it does not care about element nesting. You * will need to override this method to correctly handle composite fragments. + * + * @param reader the {@link XMLEventReader} to be used to find next fragment. * * @return true if next fragment was found, false otherwise. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java index 493b5d480..66d70167e 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxEventItemWriter.java @@ -184,6 +184,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * headerCallback is called before writing any items. + * + * @param headerCallback the {@link StaxWriterCallback} to be called prior to writing items. */ public void setHeaderCallback(StaxWriterCallback headerCallback) { this.headerCallback = headerCallback; @@ -191,7 +193,9 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * footerCallback is called after writing all items but before closing the - * file + * file. + * + *@param footerCallback the {@link StaxWriterCallback} to be called after writing items. */ public void setFooterCallback(StaxWriterCallback footerCallback) { this.footerCallback = footerCallback; @@ -250,7 +254,7 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Get XML version. - * + * * @return the XML version used */ public String getVersion() { @@ -336,7 +340,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { * Set "overwrite" flag for the output file. Flag is ignored when output * file processing is restarted. * - * @param overwriteOutput + * @param overwriteOutput If set to true, output file will be overwritten + * (this flag is ignored when processing is restart). */ public void setOverwriteOutput(boolean overwriteOutput) { this.overwriteOutput = overwriteOutput; @@ -347,7 +352,7 @@ ResourceAwareItemWriterItemStream, InitializingBean { } /** - * @throws Exception + * @throws Exception thrown if error occurs * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() */ @Override @@ -365,6 +370,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Open the output source + * + * @param executionContext the batch context. * * @see org.springframework.batch.item.ItemStream#open(ExecutionContext) */ @@ -499,10 +506,13 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Subclasses can override to customize the writer. - * @param outputFactory - * @param writer + * + * @param outputFactory the factory to be used to create an {@link XMLEventWriter}. + * @param writer the {@link Writer} to be used by the {@link XMLEventWriter} for + * writing to character streams. * @return an xml writer - * @throws XMLStreamException + * + * @throws XMLStreamException thrown if error occured creating {@link XMLEventWriter}. */ protected XMLEventWriter createXmlEventWriter(XMLOutputFactory outputFactory, Writer writer) throws XMLStreamException { @@ -511,8 +521,10 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Subclasses can override to customize the factory. + * * @return a factory for the xml output - * @throws FactoryConfigurationError + * + * @throws FactoryConfigurationError throw if an instance of this factory cannot be loaded. */ protected XMLOutputFactory createXmlOutputFactory() throws FactoryConfigurationError { return XMLOutputFactory.newInstance(); @@ -520,8 +532,10 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Subclasses can override to customize the event factory. + * * @return a factory for the xml events - * @throws FactoryConfigurationError + * + * @throws FactoryConfigurationError thrown if an instance of this factory cannot be loaded. */ protected XMLEventFactory createXmlEventFactory() throws FactoryConfigurationError { XMLEventFactory factory = XMLEventFactory.newInstance(); @@ -530,8 +544,10 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Subclasses can override to customize the STAX result. + * * @return a result for writing to - * @throws Exception + * + * @throws Exception thrown if an error occurs curing the creation of the result. */ protected Result createStaxResult() throws Exception { return StaxUtils.getResult(eventWriter); @@ -545,7 +561,9 @@ ResourceAwareItemWriterItemStream, InitializingBean { * * * @param writer XML event writer - * @throws XMLStreamException + * + * @throws XMLStreamException thrown if error occurs while setting the + * prefix or default name space. */ protected void initNamespaceContext(XMLEventWriter writer) throws XMLStreamException { if (StringUtils.hasText(getRootTagNamespace())) { @@ -582,7 +600,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { * version and root tag name can be retrieved with corresponding getters. * * @param writer XML event writer - * @throws XMLStreamException + * + * @throws XMLStreamException thrown if error occurs. */ protected void startDocument(XMLEventWriter writer) throws XMLStreamException { @@ -634,7 +653,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { * Writes the EndDocument tag manually. * * @param writer XML event writer - * @throws XMLStreamException + * + * @throws XMLStreamException thrown if error occurs. */ protected void endDocument(XMLEventWriter writer) throws XMLStreamException { @@ -732,8 +752,9 @@ ResourceAwareItemWriterItemStream, InitializingBean { * Write the value objects and flush them to the file. * * @param items the value object - * @throws IOException - * @throws XmlMappingException + * + * @throws Exception thrown if general error occurs. + * @throws XmlMappingException thrown if error occurs during XML Mapping. */ @Override public void write(List items) throws XmlMappingException, Exception { @@ -767,6 +788,8 @@ ResourceAwareItemWriterItemStream, InitializingBean { /** * Get the restart data. + * + * @param executionContext the batch context. * * @see org.springframework.batch.item.ItemStream#update(ExecutionContext) */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxWriterCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxWriterCallback.java index 496e5a057..9074a046b 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxWriterCallback.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/xml/StaxWriterCallback.java @@ -31,6 +31,10 @@ public interface StaxWriterCallback { /** * Write contents using the supplied {@link XMLEventWriter}. It is not * required to flush the writer inside this method. + * + * @param writer the {@link XMLEventWriter} to be used to write the contents. + * + * @throws IOException thrown if an error occurs during writing. */ void write(XMLEventWriter writer) throws IOException; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/RepeatContextSupport.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/RepeatContextSupport.java index 0ed3d563d..b453261e4 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/RepeatContextSupport.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/context/RepeatContextSupport.java @@ -41,7 +41,7 @@ public class RepeatContextSupport extends SynchronizedAttributeAccessor implemen * Constructor for {@link RepeatContextSupport}. The parent can be null, but * should be set to the enclosing repeat context if there is one, e.g. if * this context is an inner loop. - * @param parent + * @param parent {@link RepeatContext} to be used as the parent context. */ public RepeatContextSupport(RepeatContext parent) { super(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java index 6fae383be..c54d11e24 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java @@ -86,7 +86,8 @@ public class LogOrRethrowExceptionHandler implements ExceptionHandler { * Classify the throwables and decide whether to rethrow based on the * result. The context is not used. * - * @throws Throwable + * @throws Throwable thrown if {@link LogOrRethrowExceptionHandler#exceptionClassifier} + * is classified as {@link Level#RETHROW}. * * @see ExceptionHandler#handleException(RepeatContext, Throwable) */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java index 177872992..44c5b7eae 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java @@ -85,7 +85,7 @@ public class RethrowOnThresholdExceptionHandler implements ExceptionHandler { * result. The context is used to accumulate the number of exceptions of the * same type according to the classifier. * - * @throws Throwable + * @throws Throwable is thrown if number of exceptions exceeds threshold. * @see ExceptionHandler#handleException(RepeatContext, Throwable) */ @Override diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/listener/CompositeRepeatListener.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/listener/CompositeRepeatListener.java index a0d999127..b23e3cd08 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/listener/CompositeRepeatListener.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/listener/CompositeRepeatListener.java @@ -24,6 +24,8 @@ import org.springframework.batch.repeat.RepeatContext; import org.springframework.batch.repeat.RepeatListener; /** + * Allows a user to register one or more RepeatListeners to be notified on batch events. + * * @author Dave Syer * */ @@ -34,7 +36,7 @@ public class CompositeRepeatListener implements RepeatListener { /** * Public setter for the listeners. * - * @param listeners + * @param listeners array of RepeatListeners to be used by the CompositeRepeatListener. */ public void setListeners(RepeatListener[] listeners) { this.listeners = Arrays.asList(listeners); @@ -43,7 +45,7 @@ public class CompositeRepeatListener implements RepeatListener { /** * Register additional listener. * - * @param listener + * @param listener the RepeatListener to be added to the list of listeners to be notified. */ public void register(RepeatListener listener) { if (!listeners.contains(listener)) { diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/CompositeCompletionPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/CompositeCompletionPolicy.java index a14e85cff..4b2e1f224 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/CompositeCompletionPolicy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/CompositeCompletionPolicy.java @@ -39,7 +39,8 @@ public class CompositeCompletionPolicy implements CompletionPolicy { /** * Setter for the policies. * - * @param policies + * @param policies an array of completion policies to be used to determine + * isComplete by consensus. */ public void setPolicies(CompletionPolicy[] policies) { this.policies = Arrays.asList(policies).toArray(new CompletionPolicy[policies.length]); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/TimeoutTerminationPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/TimeoutTerminationPolicy.java index 37daf2c70..33bf345c3 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/TimeoutTerminationPolicy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/policy/TimeoutTerminationPolicy.java @@ -52,7 +52,7 @@ public class TimeoutTerminationPolicy extends CompletionPolicySupport { * Construct a {@link TimeoutTerminationPolicy} with the specified timeout * value (in milliseconds). * - * @param timeout + * @param timeout the milliseconds to be used for the timeout. */ public TimeoutTerminationPolicy(long timeout) { super(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/RepeatTemplate.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/RepeatTemplate.java index 29d7d9c9d..819f806d6 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/RepeatTemplate.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/RepeatTemplate.java @@ -434,7 +434,10 @@ public class RepeatTemplate implements RepeatOperations { /** * Delegate to the {@link CompletionPolicy}. - * + * @param context the current batch context. + * @param result the result of the latest batch item processing. + * @return true if complete according to policy and result value, else false. + * * @see org.springframework.batch.repeat.CompletionPolicy#isComplete(RepeatContext, * RepeatStatus) */ @@ -448,6 +451,8 @@ public class RepeatTemplate implements RepeatOperations { /** * Delegate to {@link CompletionPolicy}. + * @param context the current batch context. + * @return true if complete according to policy alone not including result value, else false. * * @see org.springframework.batch.repeat.CompletionPolicy#isComplete(RepeatContext) */ @@ -461,6 +466,9 @@ public class RepeatTemplate implements RepeatOperations { /** * Delegate to the {@link CompletionPolicy}. + * + * @return a RepeatContext object that can be used by the implementation to store + * internal state for a batch step. * * @see org.springframework.batch.repeat.CompletionPolicy#start(RepeatContext) */ @@ -474,6 +482,7 @@ public class RepeatTemplate implements RepeatOperations { /** * Delegate to the {@link CompletionPolicy}. + * @param context the value returned by start. * * @see org.springframework.batch.repeat.CompletionPolicy#update(RepeatContext) */ diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AnnotationMethodResolver.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AnnotationMethodResolver.java index eb8ad37e7..7752d4855 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AnnotationMethodResolver.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AnnotationMethodResolver.java @@ -40,7 +40,9 @@ public class AnnotationMethodResolver implements MethodResolver { /** - * Create a MethodResolver for the specified Method-level annotation type + * Create a MethodResolver for the specified Method-level annotation type. + * + * @param annotationType establish the annotation to be used. */ public AnnotationMethodResolver(Class annotationType) { Assert.notNull(annotationType, "annotationType must not be null"); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java index 43a797bab..d81d8cab8 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java @@ -72,8 +72,9 @@ public enum DatabaseType { /** * Static method to obtain a DatabaseType from the provided product name. * - * @param productName - * @return DatabaseType for given product name. + * @param productName {@link String} containing the product name. + * @return the {@link DatabaseType} for given product name. + * * @throws IllegalArgumentException if none is found. */ public static DatabaseType fromProductName(String productName){ @@ -89,9 +90,10 @@ public enum DatabaseType { /** * Convenience method that pulls a database product name from the DataSource's metadata. * - * @param dataSource - * @return DatabaseType - * @throws MetaDataAccessException + * @param dataSource {@link DataSource} to the database to be used. + * @return {@link DatabaseType} for the {@link DataSource} specified. + * + * @throws MetaDataAccessException thrown if error occured during Metadata lookup. */ public static DatabaseType fromMetaData(DataSource dataSource) throws MetaDataAccessException { String databaseProductName = diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java index 18150e389..f01001199 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/MethodInvokerUtils.java @@ -182,8 +182,10 @@ public class MethodInvokerUtils { * Create a {@link MethodInvoker} for the delegate from a single public * method. * - * @param target an object to search for an appropriate method - * @return a MethodInvoker that calls a method on the delegate + * @param target an object to search for an appropriate method. + * @param the class. + * @param the type. + * @return a MethodInvoker that calls a method on the delegate. */ public static MethodInvoker getMethodInvokerForSingleArgument(Object target) { final AtomicReference methodHolder = new AtomicReference<>(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/PropertiesConverter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/PropertiesConverter.java index d3843e946..82ca0eab7 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/PropertiesConverter.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/PropertiesConverter.java @@ -96,7 +96,7 @@ public final class PropertiesConverter { * an empty properties object is passed in, a blank string is returned, * otherwise it's string representation is returned. * - * @param propertiesToParse + * @param propertiesToParse contains the properties be converted. * @return String representation of properties object */ public static String propertiesToString(Properties propertiesToParse) {