|
|
|
@ -4,6 +4,7 @@ import cn.estsh.i3plus.pojo.aps.enums.FIELD_TYPE;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
|
|
|
|
public class BeanInfo {
|
|
|
|
|
private Class<? extends BaseBean> cls;
|
|
|
|
@ -103,6 +104,14 @@ public class BeanInfo {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Class<? extends BaseBean> getRelationClass(Enum<?> holder) {
|
|
|
|
|
RelationInfo relaInfo = getRelationInfo(holder);
|
|
|
|
|
if (relaInfo != null) {
|
|
|
|
|
return relaInfo.getBeanInfo().getBeanClass();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RELATION_TYPE getRelationType(Enum<?> holder) {
|
|
|
|
|
RelationInfo relaInfo = getRelationInfo(holder);
|
|
|
|
|
if (relaInfo != null) {
|
|
|
|
@ -120,31 +129,40 @@ public class BeanInfo {
|
|
|
|
|
return RELATION_TYPE.INVALID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Enum<?>> getAllHolders() {
|
|
|
|
|
List<Enum<?>> holders = new ArrayList<>();
|
|
|
|
|
private void foreach(Consumer<RelationInfo> fun) {
|
|
|
|
|
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
|
|
|
|
|
holders.add(entry.getKey());
|
|
|
|
|
fun.accept(entry.getValue());
|
|
|
|
|
}
|
|
|
|
|
if (this.superBeanInfo != null) {
|
|
|
|
|
this.superBeanInfo.foreach(fun);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Enum<?>> getAllHolders() {
|
|
|
|
|
List<Enum<?>> holders = new ArrayList<>();
|
|
|
|
|
foreach((RelationInfo info)->{
|
|
|
|
|
holders.add(info.getHolder());
|
|
|
|
|
});
|
|
|
|
|
return holders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Enum<?>> getOwnerHolders() {
|
|
|
|
|
List<Enum<?>> owners = new ArrayList<>();
|
|
|
|
|
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
|
|
|
|
|
if (entry.getValue().isOwner()) {
|
|
|
|
|
owners.add(entry.getKey());
|
|
|
|
|
foreach((RelationInfo info)->{
|
|
|
|
|
if (info.isOwner()) {
|
|
|
|
|
owners.add(info.getHolder());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return owners;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Enum<?>> getNormalSigns() {
|
|
|
|
|
List<Enum<?>> holders = new ArrayList<>();
|
|
|
|
|
for (Map.Entry<Enum<?>, RelationInfo> entry : relations.entrySet()) {
|
|
|
|
|
if (!entry.getValue().isOwner()) {
|
|
|
|
|
holders.add(entry.getKey());
|
|
|
|
|
foreach((RelationInfo info)->{
|
|
|
|
|
if (!info.isOwner()) {
|
|
|
|
|
holders.add(info.getHolder());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return holders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|