Package codechicken.mixin.api
Interface MixinLanguageSupport
- All Known Implementing Classes:
MixinLanguageSupport.JavaMixinLanguageSupport,MixinScalaLanguageSupport
public interface MixinLanguageSupport
Defines abstract logic for loading Mixins for different languages.
These are loaded using a
ServiceLoader from the classpath.
Created by covers1624 on 2/16/20.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe default java handling for MixinCompiler.static @interfaceThe name for the MixinLanguageSupport, Required.static @interfaceA simple way to sort thisMixinLanguageSupportbefore others in the list. -
Method Summary
Modifier and TypeMethodDescription@Nullable MixinInfobuildMixinTrait(org.objectweb.asm.tree.ClassNode cNode) Tries to build aMixinInfofor the givenClassNode.@Nullable ClassInfoobtainInfo(org.objectweb.asm.tree.ClassNode cNode) Tries to load aClassInfofor the givenClassNode.
-
Method Details
-
obtainInfo
Tries to load aClassInfofor the givenClassNode. Custom implementations shouldn't be greedy, only load aClassInfoif you know for certain that you need to. I.e:MixinScalaLanguageSupport, only loads aScalaClassInfoif the class has a ScalaSignature Annotation, and is a Scala trait class.- Parameters:
cNode- The ClassNode.- Returns:
- The ClassInfo.
-
buildMixinTrait
Tries to build aMixinInfofor the givenClassNode. as withobtainInfo(org.objectweb.asm.tree.ClassNode), only load MixinInfos if you know for certain that you need to. I.e:MixinScalaLanguageSupport, will only load a MixinInfo for the class, ifMixinCompiler.getClassInfo(ClassNode)resolves to aScalaClassInfo.- Parameters:
cNode- The ClassNode.- Returns:
- The MixinInfo.
-