Skip to content

fix the configuration.xml doc #2344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/site/es/xdoc/configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2009-2020 the original author or authors.
Copyright 2009-2022 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1495,15 +1495,22 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
</p>
<source><![CDATA[// ExampleObjectFactory.java
public class ExampleObjectFactory extends DefaultObjectFactory {
public Object create(Class type) {
@Override
public <T> T create(Class<T> type) {
return super.create(type);
}
public Object create(Class type, List<Class> constructorArgTypes, List<Object> constructorArgs) {

@Override
public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
return super.create(type, constructorArgTypes, constructorArgs);
}

@Override
public void setProperties(Properties properties) {
super.setProperties(properties);
}

@Override
public <T> boolean isCollection(Class<T> type) {
return Collection.class.isAssignableFrom(type);
}
Expand Down Expand Up @@ -1552,12 +1559,16 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
args = {MappedStatement.class,Object.class})})
public class ExamplePlugin implements Interceptor {
private Properties properties = new Properties();

@Override
public Object intercept(Invocation invocation) throws Throwable {
// implement pre processing if need
Object returnObject = invocation.proceed();
// implement post processing if need
return returnObject;
}

@Override
public void setProperties(Properties properties) {
this.properties = properties;
}
Expand Down
17 changes: 14 additions & 3 deletions src/site/ja/xdoc/configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2009-2020 the original author or authors.
Copyright 2009-2022 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1527,15 +1527,22 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
</p>
<source><![CDATA[// ExampleObjectFactory.java
public class ExampleObjectFactory extends DefaultObjectFactory {
public Object create(Class type) {
@Override
public <T> T create(Class<T> type) {
return super.create(type);
}
public Object create(Class type, List<Class> constructorArgTypes, List<Object> constructorArgs) {

@Override
public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
return super.create(type, constructorArgTypes, constructorArgs);
}

@Override
public void setProperties(Properties properties) {
super.setProperties(properties);
}

@Override
public <T> boolean isCollection(Class<T> type) {
return Collection.class.isAssignableFrom(type);
}}
Expand Down Expand Up @@ -1595,12 +1602,16 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
args = {MappedStatement.class,Object.class})})
public class ExamplePlugin implements Interceptor {
private Properties properties = new Properties();

@Override
public Object intercept(Invocation invocation) throws Throwable {
// implement pre processing if need
Object returnObject = invocation.proceed();
// implement post processing if need
return returnObject;
}

@Override
public void setProperties(Properties properties) {
this.properties = properties;
}
Expand Down
17 changes: 14 additions & 3 deletions src/site/ko/xdoc/configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2009-2021 the original author or authors.
Copyright 2009-2022 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1457,15 +1457,22 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
예를들면:</p>
<source><![CDATA[// ExampleObjectFactory.java
public class ExampleObjectFactory extends DefaultObjectFactory {
public Object create(Class type) {
@Override
public <T> T create(Class<T> type) {
return super.create(type);
}
public Object create(Class type, List<Class> constructorArgTypes, List<Object> constructorArgs) {

@Override
public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
return super.create(type, constructorArgTypes, constructorArgs);
}

@Override
public void setProperties(Properties properties) {
super.setProperties(properties);
}

@Override
public <T> boolean isCollection(Class<T> type) {
return Collection.class.isAssignableFrom(type);
}}
Expand Down Expand Up @@ -1518,12 +1525,16 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
args = {MappedStatement.class,Object.class})})
public class ExamplePlugin implements Interceptor {
private Properties properties = new Properties();

@Override
public Object intercept(Invocation invocation) throws Throwable {
// implement pre processing if need
Object returnObject = invocation.proceed();
// implement post processing if need
return returnObject;
}

@Override
public void setProperties(Properties properties) {
this.properties = properties;
}
Expand Down
5 changes: 3 additions & 2 deletions src/site/xdoc/configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2009-2021 the original author or authors.
Copyright 2009-2022 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1656,7 +1656,8 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
@Override
public <T> boolean isCollection(Class<T> type) {
return Collection.class.isAssignableFrom(type);
}}
}
}
]]></source>

<source><![CDATA[<!-- mybatis-config.xml -->
Expand Down
17 changes: 14 additions & 3 deletions src/site/zh/xdoc/configuration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2009-2020 the original author or authors.
Copyright 2009-2022 the original author or authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1499,15 +1499,22 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
如果想覆盖对象工厂的默认行为,可以通过创建自己的对象工厂来实现。比如:</p>
<source><![CDATA[// ExampleObjectFactory.java
public class ExampleObjectFactory extends DefaultObjectFactory {
public Object create(Class type) {
@Override
public <T> T create(Class<T> type) {
return super.create(type);
}
public Object create(Class type, List<Class> constructorArgTypes, List<Object> constructorArgs) {

@Override
public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes, List<Object> constructorArgs) {
return super.create(type, constructorArgTypes, constructorArgs);
}

@Override
public void setProperties(Properties properties) {
super.setProperties(properties);
}

@Override
public <T> boolean isCollection(Class<T> type) {
return Collection.class.isAssignableFrom(type);
}}
Expand Down Expand Up @@ -1559,12 +1566,16 @@ public class ExampleObjectFactory extends DefaultObjectFactory {
args = {MappedStatement.class,Object.class})})
public class ExamplePlugin implements Interceptor {
private Properties properties = new Properties();

@Override
public Object intercept(Invocation invocation) throws Throwable {
// implement pre processing if need
Object returnObject = invocation.proceed();
// implement post processing if need
return returnObject;
}

@Override
public void setProperties(Properties properties) {
this.properties = properties;
}
Expand Down