This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.redkale.boot;
|
package org.redkale.boot;
|
||||||
|
|
||||||
import org.redkale.util.Ignore;
|
|
||||||
import org.redkale.util.AutoLoad;
|
import org.redkale.util.AutoLoad;
|
||||||
import org.redkale.util.AnyValue;
|
import org.redkale.util.AnyValue;
|
||||||
import org.redkale.util.AnyValue.DefaultAnyValue;
|
import org.redkale.util.AnyValue.DefaultAnyValue;
|
||||||
@@ -198,7 +197,6 @@ public final class ClassFilter<T> {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public boolean accept(AnyValue property, Class clazz, boolean autoscan) {
|
public boolean accept(AnyValue property, Class clazz, boolean autoscan) {
|
||||||
if (this.refused || !Modifier.isPublic(clazz.getModifiers())) return false;
|
if (this.refused || !Modifier.isPublic(clazz.getModifiers())) return false;
|
||||||
if (clazz.getAnnotation(Ignore.class) != null) return false;
|
|
||||||
if (autoscan) {
|
if (autoscan) {
|
||||||
AutoLoad auto = (AutoLoad) clazz.getAnnotation(AutoLoad.class);
|
AutoLoad auto = (AutoLoad) clazz.getAnnotation(AutoLoad.class);
|
||||||
if (auto != null && !auto.value()) return false;
|
if (auto != null && !auto.value()) return false;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.util.concurrent.*;
|
|||||||
import java.util.function.*;
|
import java.util.function.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
import javax.annotation.*;
|
import javax.annotation.*;
|
||||||
|
import org.redkale.convert.*;
|
||||||
import org.redkale.convert.json.*;
|
import org.redkale.convert.json.*;
|
||||||
import org.redkale.net.sncp.*;
|
import org.redkale.net.sncp.*;
|
||||||
import org.redkale.source.*;
|
import org.redkale.source.*;
|
||||||
@@ -445,17 +446,17 @@ public class CacheSourceService<K extends Serializable, V extends Object> implem
|
|||||||
return JsonFactory.root().getConvert().convertTo(this);
|
return JsonFactory.root().getConvert().convertTo(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
@ConvertColumn(ignore = true)
|
||||||
public boolean isListCacheType() {
|
public boolean isListCacheType() {
|
||||||
return cacheType == CacheEntryType.LIST;
|
return cacheType == CacheEntryType.LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
@ConvertColumn(ignore = true)
|
||||||
public boolean isSetCacheType() {
|
public boolean isSetCacheType() {
|
||||||
return cacheType == CacheEntryType.SET;
|
return cacheType == CacheEntryType.SET;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
@ConvertColumn(ignore = true)
|
||||||
public boolean isExpired() {
|
public boolean isExpired() {
|
||||||
return (expireSeconds > 0 && lastAccessed + expireSeconds < (System.currentTimeMillis() / 1000));
|
return (expireSeconds > 0 && lastAccessed + expireSeconds < (System.currentTimeMillis() / 1000));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ public final class FilterNodeBean<T> implements Comparable<FilterNodeBean<T>> {
|
|||||||
for (final Field field : cltmp.getDeclaredFields()) {
|
for (final Field field : cltmp.getDeclaredFields()) {
|
||||||
if (Modifier.isStatic(field.getModifiers())) continue;
|
if (Modifier.isStatic(field.getModifiers())) continue;
|
||||||
if (fields.contains(field.getName())) continue;
|
if (fields.contains(field.getName())) continue;
|
||||||
if (field.getAnnotation(Ignore.class) != null) continue;
|
|
||||||
if (field.getAnnotation(Transient.class) != null) continue;
|
if (field.getAnnotation(Transient.class) != null) continue;
|
||||||
|
|
||||||
final boolean pubmod = Modifier.isPublic(field.getModifiers());
|
final boolean pubmod = Modifier.isPublic(field.getModifiers());
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
|
||||||
* To change this template file, choose Tools | Templates
|
|
||||||
* and open the template in the editor.
|
|
||||||
*/
|
|
||||||
package org.redkale.util;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
import static java.lang.annotation.ElementType.*;
|
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用于忽略字段、方法或类。使用场景:
|
|
||||||
* 1、convert功能中被标记为@Ignore的字段或方法会被忽略
|
|
||||||
* 2、FilterBean中的被标记为@Ignore的字段会被忽略
|
|
||||||
* 3、被标记为@Ignore的Service类不会被自动加载
|
|
||||||
* 4、被标记为@Ignore的Servlet类不会被自动加载
|
|
||||||
*
|
|
||||||
* <p> 详情见: http://www.redkale.org
|
|
||||||
* @author zhangjx
|
|
||||||
*/
|
|
||||||
@Inherited
|
|
||||||
@Documented
|
|
||||||
@Target({TYPE, FIELD, METHOD})
|
|
||||||
@Retention(RUNTIME)
|
|
||||||
public @interface Ignore {
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user