Package codechicken.mixin
Class MixinCompilerImpl
java.lang.Object
codechicken.mixin.MixinCompilerImpl
- All Implemented Interfaces:
MixinCompiler
Generates composite classes similar to the scala compiler with traits.
Created by covers1624 on 2/11/20.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMixinCompilerImpl(MixinBackend mixinBackend) MixinCompilerImpl(MixinBackend mixinBackend, MixinDebugger debugger) MixinCompilerImpl(MixinBackend mixinBackend, MixinDebugger debugger, Supplier<Collection<Class<? extends MixinLanguageSupport>>> supportSupplier) -
Method Summary
Modifier and TypeMethodDescription<T> Class<T>compileMixinClass(String name, String superClass, Set<String> traits) Compiles a new class with the given name, super Class, and traits.<T> Class<T>defineClass(String name, byte[] bytes) Defines a class.@Nullable ClassInfogetClassInfo(String name) Gets aClassInfoinstance for the given class name.@Nullable ClassInfogetClassInfo(org.objectweb.asm.tree.ClassNode cNode) Overload forMixinCompiler.getClassInfo(String), taking aClassNodeinstead.@Nullable org.objectweb.asm.tree.ClassNodegetClassNode(String name) Loads aClassNodefor the given class name.<T> Class<T>getDefinedClass(String name) Get a previously defined class.<T extends MixinLanguageSupport>
TgetLanguageSupport(String name) Get aMixinLanguageSupportinstance with the given name.Gets theMixinBackendfor this MixinCompilergetMixinInfo(String name) Gets aMixinInfofor the given Class name.registerTrait(org.objectweb.asm.tree.ClassNode cNode) Registers a Trait to theMixinCompiler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.mixin.api.MixinCompiler
getClassInfo
-
Field Details
-
LOG_LEVEL
public static final org.slf4j.event.Level LOG_LEVEL
-
-
Constructor Details
-
MixinCompilerImpl
public MixinCompilerImpl() -
MixinCompilerImpl
-
MixinCompilerImpl
-
MixinCompilerImpl
public MixinCompilerImpl(MixinBackend mixinBackend, MixinDebugger debugger, Supplier<Collection<Class<? extends MixinLanguageSupport>>> supportSupplier)
-
-
Method Details
-
getMixinBackend
Description copied from interface:MixinCompilerGets theMixinBackendfor this MixinCompiler- Specified by:
getMixinBackendin interfaceMixinCompiler- Returns:
- The MixinBackend instance.
-
getLanguageSupport
Description copied from interface:MixinCompilerGet aMixinLanguageSupportinstance with the given name.- Specified by:
getLanguageSupportin interfaceMixinCompiler- Parameters:
name- The name.- Returns:
- The
MixinLanguageSupportinstance ornull
-
getClassInfo
Description copied from interface:MixinCompilerGets aClassInfoinstance for the given class name.- Specified by:
getClassInfoin interfaceMixinCompiler- Parameters:
name- The class name.- Returns:
- The ClassInfo
-
getClassInfo
Description copied from interface:MixinCompilerOverload forMixinCompiler.getClassInfo(String), taking aClassNodeinstead.- Specified by:
getClassInfoin interfaceMixinCompiler- Parameters:
cNode- The ClassNode.- Returns:
- The ClassInfo.
-
getMixinInfo
Description copied from interface:MixinCompilerGets aMixinInfofor the given Class name.- Specified by:
getMixinInfoin interfaceMixinCompiler- Parameters:
name- The Class name- Returns:
- The MixinInfo, Null if it does not exist.
-
compileMixinClass
Description copied from interface:MixinCompilerCompiles a new class with the given name, super Class, and traits.- Specified by:
compileMixinClassin interfaceMixinCompiler- Parameters:
name- The name for the class.superClass- The name for the super class.straits- The Traits to mixin.- Returns:
- The compiled class.
-
defineClass
Description copied from interface:MixinCompilerDefines a class.- Specified by:
defineClassin interfaceMixinCompiler- Parameters:
name- The name for the class.bytes- The bytes for the class.- Returns:
- The defined class.
-
getDefinedClass
Description copied from interface:MixinCompilerGet a previously defined class.- Specified by:
getDefinedClassin interfaceMixinCompiler- Parameters:
name- The name of the previously defined class.- Returns:
- The defined class.
-
registerTrait
Description copied from interface:MixinCompilerRegisters a Trait to theMixinCompiler.- Specified by:
registerTraitin interfaceMixinCompiler- Parameters:
cNode- The ClassNode for the trait.- Returns:
- The MixinInfo for the trait.
-
getClassNode
Description copied from interface:MixinCompilerLoads aClassNodefor the given class name.- Specified by:
getClassNodein interfaceMixinCompiler- Parameters:
name- The Class name.- Returns:
- The ClassNode.
-