Moved spider to own package

This commit is contained in:
Willem Cazander 2022-10-17 20:33:54 +02:00
parent 9d9c2148e9
commit a2b0478954
11 changed files with 33 additions and 37 deletions

View file

@ -10,13 +10,16 @@ import java.util.List;
import java.util.Set;
import java.util.function.Consumer;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpider.SpiderSilk;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinNail;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinOpen;
import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿª;
import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿªḕInit注;
import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿªḕPhase注;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpider;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderEgg注;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderSilk;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public final class BãßBȍőnPhaseLoader {
@ -49,7 +52,7 @@ public final class BãßBȍőnPhaseLoader {
continue;
}
BãßBȍőnSpiderWire注 anno = m.getAnnotation(BãßBȍőnSpiderWire注.class);
SpiderSilk silkRoad = BLACK_WIDOW.silkRoad(m.getType());
BãßBȍőnSpiderSilk silkRoad = BLACK_WIDOW.silkRoad(m.getType());
Object bean = silkRoad.senseWire(boon, anno.name(), anno.description());
//System.out.println("type: "+ m.getType() +" wth name: "+anno.name()+" of boon: "+boon.getClass());

View file

@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnPhaseBarrierʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderEgg注;
import love.distributedrebirth.bassboonyd.DefaultEnumBaseʸᴰ;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAnnotation注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
@ -13,6 +12,7 @@ import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffin;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinNail;
import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿª;
import love.distributedrebirth.bassboonyd.sinit.BãßBȍőnꝐŕḯṿªḕInit注;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderEgg注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnAnnotation注(required = {BãßBȍőnInfo注.class})

View file

@ -1,33 +1,34 @@
package love.distributedrebirth.bassboonyd;
package love.distributedrebirth.bassboonyd.spider;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import love.distributedrebirth.bassboonyd.BãßBȍőnʸᴰ;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class BãßBȍőnSpider {
private final Map<Class<?>, SpiderSilk> spiderWeb = new HashMap<>();
private final Map<Class<?>, BãßBȍőnSpiderSilk> spiderWeb = new HashMap<>();
protected BãßBȍőnSpider() {
public BãßBȍőnSpider() {
}
public boolean hasEggType(Class<?> eggType) {
return spiderWeb.containsKey(eggType);
}
public SpiderSilk silkRoad(Class<?> eggType) {
SpiderSilk silkRoad = spiderWeb.get(eggType);
public BãßBȍőnSpiderSilk silkRoad(Class<?> eggType) {
BãßBȍőnSpiderSilk silkRoad = spiderWeb.get(eggType);
if (silkRoad == null) {
throw new IllegalStateException("No silk road found for type: "+eggType);
}
return silkRoad;
}
public void registrateEgg(Class<?> eggType, SpiderSilk spiderSilk) {
public void registrateEgg(Class<?> eggType, BãßBȍőnSpiderSilk spiderSilk) {
if (spiderWeb.containsKey(eggType)) {
throw new IllegalStateException("Can't registate class twice: "+eggType);
}
@ -38,7 +39,7 @@ public class BãßBȍőnSpider {
registrateEgg(eggType, createSenseWire(m));
}
public SpiderSilk createSenseWire(Method m) {
public BãßBȍőnSpiderSilk createSenseWire(Method m) {
boolean valid = false;
Class<?>[] para = m.getParameterTypes();
if (para.length == 0) {
@ -56,7 +57,7 @@ public class BãßBȍőnSpider {
if (!valid) {
throw new IllegalStateException("Unknown method parameters on: "+m.getDeclaringClass().getSimpleName()+"."+m.toGenericString());
}
return new SpiderSilk() {
return new BãßBȍőnSpiderSilk() {
@Override
public Object senseWire(Object boon, String name, String description) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
@ -75,25 +76,6 @@ public class BãßBȍőnSpider {
}
throw new IllegalStateException("Unknown method parameters on: "+m.getDeclaringClass().getSimpleName()+"."+m.toGenericString());
}
@Override
public boolean isNamed() {
Class<?>[] para = m.getParameterTypes();
if (para.length == 2 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1])) {
return true;
}
if (para.length == 3 && BãßBȍőnʸᴰ.class.isAssignableFrom(para[0]) && String.class.isAssignableFrom(para[1]) && String.class.isAssignableFrom(para[2])) {
return true;
}
return false;
}
};
}
public interface SpiderSilk {
boolean isNamed();
Object senseWire(Object boon, String name, String description) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException;
}
}

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.bassboonyd;
package love.distributedrebirth.bassboonyd.spider;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View file

@ -0,0 +1,11 @@
package love.distributedrebirth.bassboonyd.spider;
import java.lang.reflect.InvocationTargetException;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnSpiderSilk {
Object senseWire(Object boon, String name, String description) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException;
}

View file

@ -1,4 +1,4 @@
package love.distributedrebirth.bassboonyd;
package love.distributedrebirth.bassboonyd.spider;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View file

@ -2,6 +2,7 @@ package love.distributedrebirth.numberxd.base2t;
import love.distributedrebirth.bassboonyd.Bãß;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.jmx.CounterGuageᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
@ -18,7 +19,6 @@ import love.distributedrebirth.numberxd.base2t.part.T12PartUncial;
import love.distributedrebirth.numberxd.base2t.part.T16PartHex;
import love.distributedrebirth.numberxd.base2t.part.T20PartScore;
import love.distributedrebirth.numberxd.base2t.part.T60PartSexagesimal;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnInfo注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnPackage注;

View file

@ -8,12 +8,12 @@ import java.util.Iterator;
import java.util.List;
import love.distributedrebirth.bassboonyd.Bãß;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnInfo注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnPackage注;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinNail;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.jmx.CounterGuageᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.T08PartOctal;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;

View file

@ -5,7 +5,6 @@ import java.util.Map;
import java.util.function.Consumer;
import love.distributedrebirth.bassboonyd.Bãß;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnInfo注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnPackage注;
@ -13,6 +12,7 @@ import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinNail;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinOpen;
import love.distributedrebirth.bassboonyd.jmx.AttributeBooleanᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.jmx.CounterGuageᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.AttributeStringᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartNail;

View file

@ -4,11 +4,11 @@ import java.math.BigInteger;
import java.text.DecimalFormat;
import love.distributedrebirth.bassboonyd.Bãß;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnInfo注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnPackage注;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumSetᴶᴹˣ;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.jmx.CounterGuageᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.T10PartDecimal;
import love.distributedrebirth.numberxd.base2t.part.T16PartHex;

View file

@ -14,12 +14,12 @@ import com.badlogic.gdx.Screen;
import com.badlogic.gdx.utils.ScreenUtils;
import love.distributedrebirth.bassboonyd.Bãß;
import love.distributedrebirth.bassboonyd.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnInfo注;
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnPackage注;
import love.distributedrebirth.bassboonyd.coffin.BãßBȍőnCoffinNail;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.spider.BãßBȍőnSpiderWire注;
import love.distributedrebirth.bassboonyd.jmx.AttributeStringᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.CounterGuageᴶᴹˣ;
import love.distributedrebirth.gdxapp4d.tos4.service.SystemGdxTerminal;