gdxapp4d/gdxapp4d-lib-bassboonyd/src/main/java/ᒢᐩᐩ/ᒡᒢᑊᒻᒻᓫᔿ/ObjectScopeLimitΔ邪ᙾ.java

46 lines
2.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;
import java.util.Optional;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.DefaultBȍőnLoader;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©⍙ ∞ 仙上主天")
public class ObjectScopeLimitΔ邪ᙾ implements ClassFileTransformer {
// not tested
@Override
public byte[] transform(Module module, ClassLoader loader, String className,
Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer)
throws IllegalClassFormatException {
if (!ObjectScopeLimitΔ.Ꝑŕḯṿª.ꞱClassNameType抽.class.isAssignableFrom(classBeingRedefined)) {
return null;
}
if (classBeingRedefined.getDeclaringClass() == null) {
return null;
}
Optional<Class<?>> checkPrefixInterface = DefaultBȍőnLoader.findInterfaceByAnnotation(classBeingRedefined, ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchPrefix注.class);
if (checkPrefixInterface.isPresent()) {
ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchPrefix注 checkPrefix = checkPrefixInterface.get().getAnnotation(ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchPrefix注.class);
if (checkPrefix != null) {
if (!classBeingRedefined.getName().startsWith(checkPrefix.match())) {
throw new IllegalClassFormatException(checkPrefix.lastBreath()+checkPrefix.match());
}
}
}
Optional<Class<?>> checkNameInterface = DefaultBȍőnLoader.findInterfaceByAnnotation(classBeingRedefined, ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchName注.class);
if (checkNameInterface.isPresent()) {
ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchName注 checkName = checkNameInterface.get().getAnnotation(ObjectScopeLimitΔ.Ꝑŕḯṿª.DeathMatchName注.class);
if (checkName != null) {
if (!classBeingRedefined.getName().contains(checkName.match())) {
throw new IllegalClassFormatException(checkName.lastBreath()+checkName.match());
}
}
}
return null;
}
}