Class MixinConfig
java.lang.Object
org.spongepowered.asm.mixin.transformer.MixinConfig
- All Implemented Interfaces:
Comparable<MixinConfig>,IMixinConfig
Mixin configuration bundle
-
Field Summary
Fields inherited from interface org.spongepowered.asm.mixin.extensibility.IMixinConfig
DEFAULT_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(MixinConfig other)booleanGet whether visibility levelfor overwritten methods should be conformed to the target class<V> voidDecorate this config with arbitrary metadata for debugging or compatibility purposesGet the list of mixin classes we will be applying<V> VgetDecoration(String key)Get the specified decorationGet the defined injector group for injectorsintGet the default priority for mixins in this config.intGet the defined value for theInject.require()parameter on injectors defined in mixins in this configuration.Get the parent environment of this configGet marshalling handleGet the logging level for this configintGet the maximum allowed value ofAt.by().Get the package containing all mixin classesList<org.spongepowered.asm.mixin.transformer.MixinInfo>getMixinsFor(String targetClass)Get mixins for the specified target classgetName()Get the name of the file from which this configuration object was initialisedGet the companion plugin, if availableintGet the priorityGet the reference remapper for injectorsGet targets for this configurationReturns a mutable view of the targets set, used to pass the targets to config pluginsGet targets for this configurationbooleanhasDecoration(String key)Get whether this node is decorated with the specified keybooleanhasMixinsFor(String targetClass)Check whether this configuration bundle has a mixin for the specified classbooleanTrue if this mixin is required (failure to apply a defined mixin is an error condition).booleanGet whether verbose logging is enabledbooleanpackageMatch(String className)Get whether this config's package matches the supplied class namereloadMixin(String mixinClass, org.objectweb.asm.tree.ClassNode classNode)Updates a mixin with new bytecodebooleanGet whetherOverwriteannotations are required to enable overwrite behaviour for mixins in this configbooleanselect(MixinEnvironment environment)booleanGet whether to propogate the source file attribute from a mixin onto the target classtoString()
-
Method Details
-
getHandle
Get marshalling handle -
isRequired
public boolean isRequired()Description copied from interface:IMixinConfigTrue if this mixin is required (failure to apply a defined mixin is an error condition).- Specified by:
isRequiredin interfaceIMixinConfig- Returns:
- true if this config is marked as required
-
getEnvironment
Description copied from interface:IMixinConfigGet the parent environment of this config- Specified by:
getEnvironmentin interfaceIMixinConfig- Returns:
- the parent environment
-
getName
Description copied from interface:IMixinConfigGet the name of the file from which this configuration object was initialised- Specified by:
getNamein interfaceIMixinConfig- Returns:
- the config filename (resource name)
-
getMixinPackage
Get the package containing all mixin classes- Specified by:
getMixinPackagein interfaceIMixinConfig- Returns:
- the base package name for this config
-
getPriority
public int getPriority()Get the priority- Specified by:
getPriorityin interfaceIMixinConfig- Returns:
- the priority
-
getVersion
-
getDefaultMixinPriority
public int getDefaultMixinPriority()Get the default priority for mixins in this config. Values specified in the mixin annotation still override this value -
getDefaultRequiredInjections
public int getDefaultRequiredInjections()Get the defined value for theInject.require()parameter on injectors defined in mixins in this configuration.- Returns:
- default require value
-
getDefaultInjectorGroup
Get the defined injector group for injectors- Returns:
- default group name
-
conformOverwriteVisibility
public boolean conformOverwriteVisibility()Get whether visibility levelfor overwritten methods should be conformed to the target class- Returns:
- true if conform is enabled
-
requireOverwriteAnnotations
public boolean requireOverwriteAnnotations()Get whetherOverwriteannotations are required to enable overwrite behaviour for mixins in this config- Returns:
- true to require overwriting methods to be annotated
-
getMaxShiftByValue
public int getMaxShiftByValue()Get the maximum allowed value ofAt.by(). High values of shift can indicate very brittle injectors and in general should be replaced with slices. This value determines the warning/error threshold (behaviour determined by the environment) for the value of by.- Returns:
- defined shift warning threshold for this config
-
select
-
getClasses
Get the list of mixin classes we will be applying -
shouldSetSourceFile
public boolean shouldSetSourceFile()Get whether to propogate the source file attribute from a mixin onto the target class -
getReferenceMapper
Get the reference remapper for injectors -
getPlugin
Description copied from interface:IMixinConfigGet the companion plugin, if available- Specified by:
getPluginin interfaceIMixinConfig- Returns:
- the companion plugin instance or null if no plugin
-
getTargetsSet
Returns a mutable view of the targets set, used to pass the targets to config plugins -
getTargets
Description copied from interface:IMixinConfigGet targets for this configuration- Specified by:
getTargetsin interfaceIMixinConfig- Returns:
- target classes of mixins in this config
-
getUnhandledTargets
Get targets for this configuration -
decorate
Decorate this config with arbitrary metadata for debugging or compatibility purposes- Specified by:
decoratein interfaceIMixinConfig- Type Parameters:
V- value type- Parameters:
key- meta keyvalue- meta value- Throws:
IllegalArgumentException- if the specified key exists already
-
hasDecoration
Get whether this node is decorated with the specified key- Specified by:
hasDecorationin interfaceIMixinConfig- Parameters:
key- meta key- Returns:
- true if the specified decoration exists
-
getDecoration
Get the specified decoration- Specified by:
getDecorationin interfaceIMixinConfig- Type Parameters:
V- value type- Parameters:
key- meta key- Returns:
- decoration value or null if absent
-
getLoggingLevel
Get the logging level for this config -
isVerboseLogging
public boolean isVerboseLogging()Get whether verbose logging is enabled -
packageMatch
Get whether this config's package matches the supplied class name- Parameters:
className- Class name to check- Returns:
- True if the specified class name is in this config's mixin package
-
hasMixinsFor
Check whether this configuration bundle has a mixin for the specified class- Parameters:
targetClass- target class- Returns:
- true if this bundle contains any mixins for the specified target
-
getMixinsFor
Get mixins for the specified target class- Parameters:
targetClass- target class- Returns:
- mixins for the specified target
-
reloadMixin
Updates a mixin with new bytecode- Parameters:
mixinClass- Name of the mixin classclassNode- New class- Returns:
- List of classes that need to be updated
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<MixinConfig>
-