Skip to content

Commit df2602e

Browse files
committed
Fix javadoc errors and warnings
1 parent d450168 commit df2602e

File tree

9 files changed

+95
-42
lines changed

9 files changed

+95
-42
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -125,7 +125,7 @@ public class SqlSessionFactoryBean implements FactoryBean<SqlSessionFactory>, In
125125
* Sets the ObjectFactory.
126126
*
127127
* @since 1.1.2
128-
* @param objectFactory
128+
* @param objectFactory a custom ObjectFactory
129129
*/
130130
public void setObjectFactory(ObjectFactory objectFactory) {
131131
this.objectFactory = objectFactory;
@@ -135,7 +135,7 @@ public void setObjectFactory(ObjectFactory objectFactory) {
135135
* Sets the ObjectWrapperFactory.
136136
*
137137
* @since 1.1.2
138-
* @param objectWrapperFactory
138+
* @param objectWrapperFactory a specified ObjectWrapperFactory
139139
*/
140140
public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory) {
141141
this.objectWrapperFactory = objectWrapperFactory;
@@ -145,7 +145,7 @@ public void setObjectWrapperFactory(ObjectWrapperFactory objectWrapperFactory) {
145145
* Gets the DatabaseIdProvider
146146
*
147147
* @since 1.1.0
148-
* @return
148+
* @return a specified DatabaseIdProvider
149149
*/
150150
public DatabaseIdProvider getDatabaseIdProvider() {
151151
return databaseIdProvider;
@@ -156,24 +156,40 @@ public DatabaseIdProvider getDatabaseIdProvider() {
156156
* As of version 1.2.2 this variable is not initialized by default.
157157
*
158158
* @since 1.1.0
159-
* @param databaseIdProvider
159+
* @param databaseIdProvider a DatabaseIdProvider
160160
*/
161161
public void setDatabaseIdProvider(DatabaseIdProvider databaseIdProvider) {
162162
this.databaseIdProvider = databaseIdProvider;
163163
}
164164

165+
/**
166+
* Gets the VFS.
167+
* @return a specified VFS
168+
*/
165169
public Class<? extends VFS> getVfs() {
166170
return this.vfs;
167171
}
168172

173+
/**
174+
* Sets the VFS.
175+
* @param vfs a VFS
176+
*/
169177
public void setVfs(Class<? extends VFS> vfs) {
170178
this.vfs = vfs;
171179
}
172180

181+
/**
182+
* Gets the Cache.
183+
* @return a specified Cache
184+
*/
173185
public Cache getCache() {
174186
return this.cache;
175187
}
176188

189+
/**
190+
* Sets the Cache.
191+
* @param cache a Cache
192+
*/
177193
public void setCache(Cache cache) {
178194
this.cache = cache;
179195
}
@@ -265,6 +281,8 @@ public void setFailFast(boolean failFast) {
265281
/**
266282
* Set the location of the MyBatis {@code SqlSessionFactory} config file. A typical value is
267283
* "WEB-INF/mybatis-configuration.xml".
284+
*
285+
* @param configLocation a location the MyBatis config file
268286
*/
269287
public void setConfigLocation(Resource configLocation) {
270288
this.configLocation = configLocation;
@@ -286,6 +304,8 @@ public void setConfiguration(Configuration configuration) {
286304
* This is an alternative to specifying "&lt;sqlmapper&gt;" entries in an MyBatis config file.
287305
* This property being based on Spring's resource abstraction also allows for specifying
288306
* resource patterns here: e.g. "classpath*:sqlmap/*-mapper.xml".
307+
*
308+
* @param mapperLocations location of MyBatis mapper files
289309
*/
290310
public void setMapperLocations(Resource[] mapperLocations) {
291311
this.mapperLocations = mapperLocations;
@@ -295,6 +315,8 @@ public void setMapperLocations(Resource[] mapperLocations) {
295315
* Set optional properties to be passed into the SqlSession configuration, as alternative to a
296316
* {@code &lt;properties&gt;} tag in the configuration xml file. This will be used to
297317
* resolve placeholders in the config file.
318+
*
319+
* @param sqlSessionFactoryProperties optional properties for the SqlSessionFactory
298320
*/
299321
public void setConfigurationProperties(Properties sqlSessionFactoryProperties) {
300322
this.configurationProperties = sqlSessionFactoryProperties;
@@ -314,6 +336,8 @@ public void setConfigurationProperties(Properties sqlSessionFactoryProperties) {
314336
* underlying target {@code DataSource}. If there's nevertheless a {@code TransactionAwareDataSourceProxy}
315337
* passed in, it will be unwrapped to extract its target {@code DataSource}.
316338
*
339+
* @param dataSource a JDBC {@code DataSource}
340+
*
317341
*/
318342
public void setDataSource(DataSource dataSource) {
319343
if (dataSource instanceof TransactionAwareDataSourceProxy) {
@@ -333,6 +357,8 @@ public void setDataSource(DataSource dataSource) {
333357
* This is mainly meant for testing so that mock SqlSessionFactory classes can be injected. By
334358
* default, {@code SqlSessionFactoryBuilder} creates {@code DefaultSqlSessionFactory} instances.
335359
*
360+
* @param sqlSessionFactoryBuilder a SqlSessionFactoryBuilder
361+
*
336362
*/
337363
public void setSqlSessionFactoryBuilder(SqlSessionFactoryBuilder sqlSessionFactoryBuilder) {
338364
this.sqlSessionFactoryBuilder = sqlSessionFactoryBuilder;

src/main/java/org/mybatis/spring/SqlSessionHolder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2016 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@ public final class SqlSessionHolder extends ResourceHolderSupport {
4444
*
4545
* @param sqlSession the {@code SqlSession} has to be hold.
4646
* @param executorType the {@code ExecutorType} has to be hold.
47+
* @param exceptionTranslator the {@code PersistenceExceptionTranslator} has to be hold.
4748
*/
4849
public SqlSessionHolder(SqlSession sqlSession,
4950
ExecutorType executorType,

src/main/java/org/mybatis/spring/SqlSessionTemplate.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ public class SqlSessionTemplate implements SqlSession, DisposableBean {
8888
* Constructs a Spring managed SqlSession with the {@code SqlSessionFactory}
8989
* provided as an argument.
9090
*
91-
* @param sqlSessionFactory
91+
* @param sqlSessionFactory a factory of SqlSession
9292
*/
9393
public SqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
9494
this(sqlSessionFactory, sqlSessionFactory.getConfiguration().getDefaultExecutorType());
@@ -100,8 +100,8 @@ public SqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
100100
* {@code ExecutorType} cannot be changed once the {@code SqlSessionTemplate}
101101
* is constructed.
102102
*
103-
* @param sqlSessionFactory
104-
* @param executorType
103+
* @param sqlSessionFactory a factory of SqlSession
104+
* @param executorType an executor type on session
105105
*/
106106
public SqlSessionTemplate(SqlSessionFactory sqlSessionFactory, ExecutorType executorType) {
107107
this(sqlSessionFactory, executorType,
@@ -119,9 +119,9 @@ public SqlSessionTemplate(SqlSessionFactory sqlSessionFactory, ExecutorType exec
119119
* exception translation will be done and MyBatis exceptions will be
120120
* thrown
121121
*
122-
* @param sqlSessionFactory
123-
* @param executorType
124-
* @param exceptionTranslator
122+
* @param sqlSessionFactory a factory of SqlSession
123+
* @param executorType an executor type on session
124+
* @param exceptionTranslator a translator of exception
125125
*/
126126
public SqlSessionTemplate(SqlSessionFactory sqlSessionFactory, ExecutorType executorType,
127127
PersistenceExceptionTranslator exceptionTranslator) {
@@ -408,8 +408,8 @@ public List<BatchResult> flushStatements() {
408408
* The implementation of {@link DisposableBean} forces spring context to use {@link DisposableBean#destroy()} method instead of {@link SqlSessionTemplate#close()} to shutdown gently.
409409
*
410410
* @see SqlSessionTemplate#close()
411-
* @see org.springframework.beans.factory.support.DisposableBeanAdapter#inferDestroyMethodIfNecessary
412-
* @see org.springframework.beans.factory.support.DisposableBeanAdapter#CLOSE_METHOD_NAME
411+
* @see "org.springframework.beans.factory.support.DisposableBeanAdapter#inferDestroyMethodIfNecessary(Object, RootBeanDefinition)"
412+
* @see "org.springframework.beans.factory.support.DisposableBeanAdapter#CLOSE_METHOD_NAME"
413413
*/
414414
@Override
415415
public void destroy() throws Exception {

src/main/java/org/mybatis/spring/SqlSessionUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,6 +77,7 @@ public static SqlSession getSqlSession(SqlSessionFactory sessionFactory) {
7777
* @param sessionFactory a MyBatis {@code SqlSessionFactory} to create new sessions
7878
* @param executorType The executor type of the SqlSession to create
7979
* @param exceptionTranslator Optional. Translates SqlSession.commit() exceptions to Spring exceptions.
80+
* @return an SqlSession managed by Spring Transaction Manager
8081
* @throws TransientDataAccessResourceException if a transaction is active and the
8182
* {@code SqlSessionFactory} is not using a {@code SpringManagedTransactionFactory}
8283
* @see SpringManagedTransactionFactory
@@ -162,8 +163,8 @@ private static SqlSession sessionHolder(ExecutorType executorType, SqlSessionHol
162163
* If it is not, it closes it, otherwise it just updates the reference counter and
163164
* lets Spring call the close callback when the managed transaction ends
164165
*
165-
* @param session
166-
* @param sessionFactory
166+
* @param session a target SqlSession
167+
* @param sessionFactory a factory of SqlSession
167168
*/
168169
public static void closeSqlSession(SqlSession session, SqlSessionFactory sessionFactory) {
169170
notNull(session, NO_SQL_SESSION_SPECIFIED);

src/main/java/org/mybatis/spring/annotation/MapperScan.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,15 +77,18 @@
7777
/**
7878
* Alias for the {@link #basePackages()} attribute. Allows for more concise
7979
* annotation declarations e.g.:
80-
* {@code @EnableMyBatisMapperScanner("org.my.pkg")} instead of {@code
81-
* @EnableMyBatisMapperScanner(basePackages= "org.my.pkg"})}.
80+
* {@code @MapperScan("org.my.pkg")} instead of {@code @MapperScan(basePackages = "org.my.pkg"})}.
81+
*
82+
* @return base package names
8283
*/
8384
String[] value() default {};
8485

8586
/**
8687
* Base packages to scan for MyBatis interfaces. Note that only interfaces
8788
* with at least one method will be registered; concrete classes will be
8889
* ignored.
90+
*
91+
* @return base package names for scanning mapper interface
8992
*/
9093
String[] basePackages() default {};
9194

@@ -94,12 +97,16 @@
9497
* to scan for annotated components. The package of each class specified will be scanned.
9598
* <p>Consider creating a special no-op marker class or interface in each package
9699
* that serves no purpose other than being referenced by this attribute.
100+
*
101+
* @return classes that indicate base package for scanning mapper interface
97102
*/
98103
Class<?>[] basePackageClasses() default {};
99104

100105
/**
101106
* The {@link BeanNameGenerator} class to be used for naming detected components
102107
* within the Spring container.
108+
*
109+
* @return the class of {@link BeanNameGenerator}
103110
*/
104111
Class<? extends BeanNameGenerator> nameGenerator() default BeanNameGenerator.class;
105112

@@ -110,6 +117,8 @@
110117
* the specified annotation.
111118
* <p>
112119
* Note this can be combined with markerInterface.
120+
*
121+
* @return the annotation that the scanner will search for
113122
*/
114123
Class<? extends Annotation> annotationClass() default Annotation.class;
115124

@@ -120,26 +129,33 @@
120129
* the specified interface class as a parent.
121130
* <p>
122131
* Note this can be combined with annotationClass.
132+
*
133+
* @return the parent that the scanner will search for
123134
*/
124135
Class<?> markerInterface() default Class.class;
125136

126137
/**
127138
* Specifies which {@code SqlSessionTemplate} to use in the case that there is
128139
* more than one in the spring context. Usually this is only needed when you
129140
* have more than one datasource.
141+
*
142+
* @return the bean name of {@code SqlSessionTemplate}
130143
*/
131144
String sqlSessionTemplateRef() default "";
132145

133146
/**
134147
* Specifies which {@code SqlSessionFactory} to use in the case that there is
135148
* more than one in the spring context. Usually this is only needed when you
136149
* have more than one datasource.
150+
*
151+
* @return the bean name of {@code SqlSessionFactory}
137152
*/
138153
String sqlSessionFactoryRef() default "";
139154

140155
/**
141156
* Specifies a custom MapperFactoryBean to return a mybatis proxy as spring bean.
142157
*
158+
* @return the class of {@code MapperFactoryBean}
143159
*/
144160
Class<? extends MapperFactoryBean> factoryBean() default MapperFactoryBean.class;
145161

src/main/java/org/mybatis/spring/batch/MyBatisBatchItemWriter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,16 +36,16 @@
3636
/**
3737
* {@code ItemWriter} that uses the batching features from
3838
* {@code SqlSessionTemplate} to execute a batch of statements for all items
39-
* provided.<br/>
40-
*
41-
* Provided to facilitate the migration from Spring-Batch iBATIS 2 writers to MyBatis 3<br/>
42-
*
39+
* provided.
40+
* <p>
41+
* Provided to facilitate the migration from Spring-Batch iBATIS 2 writers to MyBatis 3.
42+
* <p>
4343
* The user must provide a MyBatis statement id that points to the SQL statement defined
44-
* in the MyBatis.<br/>
45-
*
44+
* in the MyBatis.
45+
* <p>
4646
* It is expected that {@link #write(List)} is called inside a transaction. If it is not
47-
* each statement call will be autocommitted and flushStatements will return no results.<br/>
48-
*
47+
* each statement call will be autocommitted and flushStatements will return no results.
48+
* <p>
4949
* The writer is thread safe after its properties are set (normal singleton
5050
* behavior), so it can be used to write in multiple concurrent transactions.
5151
*

src/main/java/org/mybatis/spring/mapper/MapperFactoryBean.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -134,13 +134,13 @@ public Class<T> getMapperInterface() {
134134
/**
135135
* If addToConfig is false the mapper will not be added to MyBatis. This means
136136
* it must have been included in mybatis-config.xml.
137-
* <p/>
137+
* <p>
138138
* If it is true, the mapper will be added to MyBatis in the case it is not already
139139
* registered.
140-
* <p/>
140+
* <p>
141141
* By default addToConfig is true.
142142
*
143-
* @param addToConfig
143+
* @param addToConfig a flag that whether add mapper to MyBatis or not
144144
*/
145145
public void setAddToConfig(boolean addToConfig) {
146146
this.addToConfig = addToConfig;

0 commit comments

Comments
 (0)