@Serial
This commit is contained in:
@@ -5,13 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.annotation;
|
package org.redkale.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
import static java.lang.annotation.ElementType.TYPE;
|
import static java.lang.annotation.ElementType.TYPE;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标记参数bean
|
* 用于预编译时执行Convert.convertFrom方法
|
||||||
*
|
*
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
@@ -19,4 +18,4 @@ import java.lang.annotation.*;
|
|||||||
@Documented
|
@Documented
|
||||||
@Target(TYPE)
|
@Target(TYPE)
|
||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
public @interface Bean {}
|
public @interface Serial {}
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
package org.redkale.boot;
|
package org.redkale.boot;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.redkale.annotation.Bean;
|
|
||||||
import org.redkale.boot.ClassFilter.FilterEntry;
|
import org.redkale.boot.ClassFilter.FilterEntry;
|
||||||
import org.redkale.convert.Decodeable;
|
import org.redkale.convert.Decodeable;
|
||||||
import org.redkale.convert.bson.BsonFactory;
|
import org.redkale.convert.bson.BsonFactory;
|
||||||
@@ -14,6 +13,7 @@ import org.redkale.convert.json.*;
|
|||||||
import org.redkale.persistence.Entity;
|
import org.redkale.persistence.Entity;
|
||||||
import org.redkale.source.*;
|
import org.redkale.source.*;
|
||||||
import org.redkale.util.Utility;
|
import org.redkale.util.Utility;
|
||||||
|
import org.redkale.annotation.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行一次Application.run提前获取所有动态类
|
* 执行一次Application.run提前获取所有动态类
|
||||||
@@ -42,12 +42,12 @@ public class PrepareCompiler {
|
|||||||
final ClassFilter<?> entityFilter = new ClassFilter(application.getClassLoader(), Entity.class, Object.class);
|
final ClassFilter<?> entityFilter = new ClassFilter(application.getClassLoader(), Entity.class, Object.class);
|
||||||
final ClassFilter<?> entityFilter2 =
|
final ClassFilter<?> entityFilter2 =
|
||||||
new ClassFilter(application.getClassLoader(), javax.persistence.Entity.class, Object.class);
|
new ClassFilter(application.getClassLoader(), javax.persistence.Entity.class, Object.class);
|
||||||
final ClassFilter<?> beanFilter = new ClassFilter(application.getClassLoader(), Bean.class, Object.class);
|
final ClassFilter<?> serialFilter = new ClassFilter(application.getClassLoader(), Serial.class, Object.class);
|
||||||
final ClassFilter<?> beanFilter2 =
|
final ClassFilter<?> serialFilter2 =
|
||||||
new ClassFilter(application.getClassLoader(), org.redkale.util.Bean.class, Object.class);
|
new ClassFilter(application.getClassLoader(), org.redkale.util.Bean.class, Object.class);
|
||||||
final ClassFilter<?> filterFilter = new ClassFilter(application.getClassLoader(), null, FilterBean.class);
|
final ClassFilter<?> filterFilter = new ClassFilter(application.getClassLoader(), null, FilterBean.class);
|
||||||
|
|
||||||
application.loadClassByFilters(entityFilter, beanFilter, filterFilter);
|
application.loadClassByFilters(entityFilter, serialFilter, filterFilter);
|
||||||
|
|
||||||
for (FilterEntry en : entityFilter.getFilterEntrys()) {
|
for (FilterEntry en : entityFilter.getFilterEntrys()) {
|
||||||
Class clz = en.getType();
|
Class clz = en.getType();
|
||||||
@@ -91,7 +91,7 @@ public class PrepareCompiler {
|
|||||||
} catch (Exception e) { // JsonFactory.loadDecoder可能会失败,因为class可能包含抽象类字段,如ColumnValue.value字段
|
} catch (Exception e) { // JsonFactory.loadDecoder可能会失败,因为class可能包含抽象类字段,如ColumnValue.value字段
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (FilterEntry en : beanFilter.getFilterEntrys()) {
|
for (FilterEntry en : serialFilter.getFilterEntrys()) {
|
||||||
Class clz = en.getType();
|
Class clz = en.getType();
|
||||||
if (Utility.isAbstractOrInterface(clz)) {
|
if (Utility.isAbstractOrInterface(clz)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -109,7 +109,7 @@ public class PrepareCompiler {
|
|||||||
} catch (Exception e) { // JsonFactory.loadDecoder可能会失败,因为class可能包含抽象类字段,如ColumnValue.value字段
|
} catch (Exception e) { // JsonFactory.loadDecoder可能会失败,因为class可能包含抽象类字段,如ColumnValue.value字段
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (FilterEntry en : beanFilter2.getFilterEntrys()) {
|
for (FilterEntry en : serialFilter2.getFilterEntrys()) {
|
||||||
Class clz = en.getType();
|
Class clz = en.getType();
|
||||||
if (Utility.isAbstractOrInterface(clz)) {
|
if (Utility.isAbstractOrInterface(clz)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.source;
|
package org.redkale.source;
|
||||||
|
|
||||||
import org.redkale.annotation.Bean;
|
import org.redkale.annotation.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FilterBean用于过滤条件, 所有的FilterBean都必须可以转换成FilterNode <br>
|
* FilterBean用于过滤条件, 所有的FilterBean都必须可以转换成FilterNode <br>
|
||||||
@@ -18,5 +18,5 @@ import org.redkale.annotation.Bean;
|
|||||||
* @see org.redkale.source.FilterGroup
|
* @see org.redkale.source.FilterGroup
|
||||||
* @author zhangjx
|
* @author zhangjx
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Serial
|
||||||
public interface FilterBean {}
|
public interface FilterBean {}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.source;
|
package org.redkale.source;
|
||||||
|
|
||||||
import org.redkale.annotation.Bean;
|
|
||||||
import org.redkale.convert.ConvertColumn;
|
import org.redkale.convert.ConvertColumn;
|
||||||
import org.redkale.convert.json.JsonConvert;
|
import org.redkale.convert.json.JsonConvert;
|
||||||
|
import org.redkale.annotation.Serial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻页对象与过滤条件Bean的组合对象
|
* 翻页对象与过滤条件Bean的组合对象
|
||||||
@@ -18,7 +18,7 @@ import org.redkale.convert.json.JsonConvert;
|
|||||||
* @param <T> Bean类
|
* @param <T> Bean类
|
||||||
* @since 2.7.0
|
* @since 2.7.0
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Serial
|
||||||
public class PageBean<T> {
|
public class PageBean<T> {
|
||||||
|
|
||||||
@ConvertColumn(index = 1)
|
@ConvertColumn(index = 1)
|
||||||
|
|||||||
@@ -5,15 +5,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.util;
|
package org.redkale.util;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
import static java.lang.annotation.ElementType.TYPE;
|
import static java.lang.annotation.ElementType.TYPE;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标记参数bean
|
* 标记参数, replace by {@link org.redkale.annotation.Serial}
|
||||||
*
|
*
|
||||||
* @see org.redkale.annotation.Bean
|
* @see org.redkale.annotation.Serial
|
||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
@Deprecated(since = "2.8.0")
|
@Deprecated(since = "2.8.0")
|
||||||
|
|||||||
@@ -968,6 +968,24 @@ public final class Utility {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串是否至少一个为空白
|
||||||
|
*
|
||||||
|
* @param strs 字符串集合
|
||||||
|
* @return 是否为空白
|
||||||
|
*/
|
||||||
|
public static boolean isAnyBlank(String... strs) {
|
||||||
|
if (strs == null || strs.length == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (String str : strs) {
|
||||||
|
if (isBlank(str)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否不为空白
|
* 是否不为空白
|
||||||
*
|
*
|
||||||
@@ -1009,6 +1027,24 @@ public final class Utility {
|
|||||||
return str == null || str.length() == 0;
|
return str == null || str.length() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串是否至少一个为空
|
||||||
|
*
|
||||||
|
* @param strs 字符串集合
|
||||||
|
* @return 是否为空
|
||||||
|
*/
|
||||||
|
public static boolean isAnyEmpty(CharSequence... strs) {
|
||||||
|
if (strs == null || strs.length == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (CharSequence str : strs) {
|
||||||
|
if (isEmpty(str)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否不为空
|
* 是否不为空
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user