Show the javadoc some love and a bit of a facelift, improve some docs

Closes #457, closes #446
This commit is contained in:
Mumfrey committed 2021-02-06 01:14:07 +00:00
1 parent ef6422f26e
commit c1aec0fb49
67 files changed
+2406 -161

No files matched your search

@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Classes which support environment-agnostic launch logic for the Mixin
* subsystem and base classes and interfaces for environment-specific adapters.
*/
package org.spongepowered.asm.launch;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Default (platform-agnostic) container handles
*/
package org.spongepowered.asm.launch.platform.container;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Base classes for environment-specific adapters and default platform-agnostic
* handlers for environment and mixin containers.
*/
package org.spongepowered.asm.launch.platform;
@@ -31,7 +31,13 @@ import java.lang.annotation.Target;
/**
* Pseudo-implements decorator for Mixins with conflicting methods in a
* superclass to soft-implement an interface
* superclass to soft-implement an interface.
*
* <p>See <a target="_top"
* href="https://github.com/SpongePowered/Mixin/wiki/Introduction-to-Mixins -
* Resolving-Method-Signature-Conflicts">Introduction to Mixins - Resolving
* Method Signature Conflicts</a> for details on soft implementation of
* interfaces.</p>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
@@ -46,10 +46,10 @@ import java.lang.annotation.Target;
* <p>Consider the following code:</p>
*
* <blockquote><pre>&#064;Shadow public int getSomething();
*
* public int soft$getSomething() {
* return this.getSomething();
* }</pre></blockquote>
*
*public int soft$getSomething() {
* return this.getSomething();
*}</pre></blockquote>
*
* <p>This type of accessor is common when an interface conflict occurs, but has
* the problem that the injected accessor will be effectively self-referential
@@ -61,9 +61,9 @@ import java.lang.annotation.Target;
*
* <blockquote><pre>&#064;Shadow private int something;
*
* public int soft$getSomething() {
* return this.something;
* }</pre></blockquote>
*public int soft$getSomething() {
* return this.something;
*}</pre></blockquote>
*
* <p>But this has the drawback of forcing the mixin to re-implement the target
* method, and thus forces ongoing maintenance of the mixin to include updating
@@ -75,21 +75,21 @@ import java.lang.annotation.Target;
* accessor with {@link Intrinsic &#064;Intrinsic}:</p>
*
* <blockquote><pre>&#064;Shadow public int getSomething();
*
* &#064;Intrinsic // don't merge the method if the target already exists
* public int soft$getSomething() {
* return this.getSomething();
* }</pre></blockquote>
*
*&#064;Intrinsic <del>// don't merge the method if the target already exists
*</del>public int soft$getSomething() {
* return this.getSomething();
*}</pre></blockquote>
*
* <p>This is ideal if the accessor is simply providing a proxy through to an
* underlying obfuscated method, as in the example above. However, if the new
* method contains additional code, such as in this example:</p>
*
* <blockquote><pre>&#064;Shadow public int getSomething();
*
* public int soft$getSomething() {
* return this.someCondition ? this.someOtherValue : this.getSomething();
* }</pre></blockquote>
*
*public int soft$getSomething() {
* return this.someCondition ? this.someOtherValue : this.getSomething();
*}</pre></blockquote>
*
* <p>Then we still have the original problem that the method becomes re-entrant
* without specifying the additional Overwrite. We can solve this with the
@@ -108,11 +108,11 @@ import java.lang.annotation.Target;
* accessor will call the overwritten method.</p>
*
* <blockquote><pre>&#064;Shadow public int getSomething();
*
* &#064;Intrinsic(displace = true) // if the target already exists, displace it
* public int soft$getSomething() {
* return this.someCondition ? this.someOtherValue : this.getSomething();
* }</pre></blockquote>
*
*&#064;Intrinsic(displace = true) // if the target already exists, displace it
*public int soft$getSomething() {
* return this.someCondition ? this.someOtherValue : this.getSomething();
*}</pre></blockquote>
*
*/
@Target({ ElementType.METHOD })
@@ -30,7 +30,22 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Decorator for mixin classes
* The main decorator for mixin classes, this annotation denotes a class as a
* mixin and specifies two key attributes:
*
* <dl>
* <dt>The target classes</dt>
* <dd>Every mixin requires at least one target class in order to be valid.
* The target classes should be specified via {@link #value} where possible
* using class literals. However for anonymous inner classes,
* package-private classes, or unavailable classes (eg. synthetic classes)
* being targetted via {@link Pseudo &#64;Pseudo}, the targets should be
* specified via the {@link #targets} instead.</dd>
* <dt>The priority</dt>
* <dd>The mixin {@link #priority} is used to express the mixin's desired
* ordering with respect to other mixins being applied to the same target
* class.</dd>
* </dl>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
@@ -46,18 +61,34 @@ public @interface Mixin {
/**
* Since specifying targets in {@link #value} requires that the classes be
* publicly visible, this property is provided to allow package-private,
* anonymous innner, and private inner classes to be referenced. Referencing
* an otherwise public class using this property is an error condition and
* will throw an exception at runtime. It is completely fine to specify both
* public and private targets for the same mixin however.
* anonymous innner, and private inner, or unavailable ({@link Pseudo
* &#64;Pseudo} classes to be referenced. Referencing an otherwise public
* class using this property is an error condition and will raise a warning
* at runtime or an error if {@link MixinEnvironment.Option#DEBUG_STRICT
* strict checks} are enabled. It is completely fine to specify both publi
* and private targets for the same mixin however.
*
* <p>Note that unlike class literals specified in {@link #value}, imports
* are not supported and therefore the class specified here must be
* fully-qualified with the package name.</p>
*
* @return protected or package-private classes this mixin targets
* @return protected, package-private, or {@link Pseudo pseudo} classes this
* mixin targets
*/
public String[] targets() default { };
/**
* Priority for the mixin, relative to other mixins targetting the same
* classes
* classes. By default mixins inherit their priority from the parent
* configuration that contains them, setting this value allows the priority
* to be overridden on a per-mixin basis.
*
* <p>Priorities sort mixins into <em>natural order</em> with lower priority
* mixins being applied first. This changes the nature of priority based on
* your intentions. Especially with respect to injectors, which must be
* considered on a case-by-case basis since the semantics of priority vary
* by injector because of first-come-first-served versus implied ordering of
* injectors such as inject-at-HEAD.</p>
*
* @return the mixin priority (relative to other mixins targetting the same
* class)
@@ -66,7 +97,7 @@ public @interface Mixin {
/**
* By default, the annotation processor will attempt to locate an
* obfuscation mapping for all {@link Shadow} and
* obfuscation mapping for all {@link Overwrite}, {@link Shadow} and
* {@link org.spongepowered.asm.mixin.injection.Inject} annotated members
* since it is anticipated that in general the target of a {@link Mixin}
* will be an obfuscated class and all annotated members will need to be
@@ -84,4 +115,5 @@ public @interface Mixin {
* obfuscation mappings for this annotation (default true).
*/
public boolean remap() default true;
}
@@ -30,23 +30,38 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* A Mixin marked as <b>Pseudo</b> is allowed to target classes which are not
* available at compile time and may not be available at runtime. This means
* that certain restrictions apply:
* A Mixin marked as <tt>&#64;Pseudo</tt> is allowed to target classes which are
* not available at <em>compile time</em> and may not be available at runtime.
* This can be used in situations where - for one reason or another - a target
* class is not available to a project being compiled and would therefore fail
* AP verification. The target class is simulated by the AP using knowledge of
* only the superclass of the target (or at least, any <em>available</em> known
* superclass of the target. This means that certain restrictions apply:
*
* <p>In particular, the superclass requirement for pseudo mixins is extremely
* important if the target has an obfuscated class in its hierarchy. For example
* let's assume that we're mixing into a class <tt>SomeCustomScreen</tt> from
* another party which extends <tt>GuiScreen</tt> which is obfuscated.
* Attempting to inject into <tt>initGui</tt> will succeed at dev time and fail
* at production time, because the reference is obfuscated. We can overcome this
* by ensuring the mixin inherits from the same superclass, thus allowing
* <tt>initGui</tt> to be resolved in the superclass hierarchy (this is not the
* case for normal mixins).</p>
* <p>The superclass requirement for pseudo mixins is extremely important <b>if
* the target has an obfuscated class in its hierarchy</b>. For example
* let's assume that we're mixing into a class <tt>CustomGuiScreen</tt> from
* another party which extends <tt>GuiScreen</tt>, where <tt>GuiScreen</tt> is
* an obfuscated class. <tt>GuiScreen</tt> contains an obfuscated method
* <tt>initGui</tt> which the (&#64;Pseudo) target class overrides. Attempting
* to inject into <tt>initGui</tt> would succeed at dev time but would fail
* at production time, because the reference is obfuscated. Normally when a
* target overrides an obfuscated method in this way, the AP can resolve the
* obfuscation by walking the superclass hierarchy of the target in order to
* discover a mapping. However when the target is not available at compile time
* the AP cannot do this and must rely on only information from the mixin
* itself. We can overcome this problem by ensuring the mixin inherits from the
* same superclass (or at least a superclass which contains the obfuscated
* methods or fields used in the mixin), thus allowing our example <tt>initGui
* </tt> method to be resolved in the superclass hierarchy. This behaviour is
* not available to normal mixins as the AP always resolves the hierarchy via
* the target class metadata when it is available.</p>
*
* <p>{@link Overwrite} methods which are <b>not</b> inherited from a superclass
* (if the target is obfuscated) <b>must</b> be decorated manually with aliases.
* </p>
* <p>If the target class contains obfuscated methods which the mixin needs to
* {@link Overwrite} or {@link Shadow} which are <b>not</b> inherited from a
* superclass (eg. the target is obfuscated), the {@link Overwrite} or
* {@link Shadow} <b>must</b> be decorated manually with <tt>aliases</tt> since
* there is no mechanism for the AP to resolve the mappings automatically.</p>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* See {@link org.spongepowered.asm.mixin.connect.IMixinConnector}
*/
package org.spongepowered.asm.mixin.connect;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Interfaces for internal Mixin objects which provide extensibility for mixin
* consumers.
*/
package org.spongepowered.asm.mixin.extensibility;
@@ -0,0 +1,32 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Generators, a special type of injector which replace the annotated method
* with synthetic content, see
* {@link org.spongepowered.asm.mixin.gen.Accessor &#64;Accessor} and
* {@link org.spongepowered.asm.mixin.gen.Invoker &#64;Invoker}.
*/
package org.spongepowered.asm.mixin.gen;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Exceptions for generators.
*/
package org.spongepowered.asm.mixin.gen.throwables;
@@ -69,22 +69,23 @@ import com.google.common.collect.ImmutableList.Builder;
/**
* <p>Base class for injection point discovery classes. Each subclass describes
* a strategy for locating code injection points within an instruction list,
* with the {@link #find} method populating a collection with insn nodes from
* the supplied list which satisfy its strategy.</p>
* with the {@link #find find} method populating a collection with insn nodes
* from the supplied list which satisfy its strategy.</p>
*
* <p>This base class also contains composite strategy factory methods such as
* {@link #and} and {@link #or} which allow strategies to be combined using
* intersection (and) or union (or) relationships to allow multiple strategies
* to be easily combined.</p>
* {@link #and and} and {@link #or or} which allow strategies to be combined
* using intersection (and) or union (or) relationships to allow multiple
* strategies to be easily combined.</p>
*
* <p>You are free to create your own injection point subclasses, but take note
* that it <b>is allowed</b> for a single InjectionPoint instance to be used for
* multiple injections and thus implementing classes MUST NOT cache the insn
* list, event, or nodes instance passed to the {@link #find} method, as each
* call to {@link #find} must be considered a separate functional contract and
* the InjectionPoint's lifespan is not linked to the discovery lifespan,
* therefore it is important that the InjectionPoint implementation is fully
* <b>stateless</b>.</p>
* list, event, or nodes instance passed to the {@link #find find} method, as
* each call to {@link #find find} must be considered a separate functional
* contract and the InjectionPoint's lifespan is not linked to the discovery
* lifespan, therefore it is important that the InjectionPoint implementation is
* fully <b>stateless</b> and that calls to {@link #find find} are idempotent.
* </p>
*/
public abstract class InjectionPoint {
@@ -38,24 +38,35 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
/**
* Specifies that this mixin method should inject an argument modifier to itself
* in the target method(s) identified by {@link #method}. This type of injection
* provides a lightweight mechanism for changing a single argument of a target
* method invocation. To affect multiple arguments at once, use {@link
* ModifyArgs} instead.
* provides a lightweight mechanism for changing a single argument of a selected
* method invocation within the target method(s). To affect multiple arguments
* of an invocation all at once, use {@link ModifyArgs} instead.
*
* <p>Consider the following method call:</p>
* <p>Use this injector when a method contains an method invocation and you wish
* to change a single value being <em>passed to</em> that method. If you need to
* alter an argument <em>received by</em> a target method, use {@link
* ModifyVariable} instead.</p>
*
* <blockquote><pre>// x, y and z are of type float
*someObject.setLocation(x, y, z, true);</pre></blockquote>
* <p>Consider the following method:</p>
*
* <p>Let us assume that we wish to modify the <tt>y</tt> value in the method
* call. We know that the arguments are <tt>float</tt>s and that the <tt>y</tt>
* value is the <em>second</em> (index = 1) <tt>float</tt> argument. Thus our
* injector requires the following signature:
* <blockquote><pre><code>private void targetMethod() {
* Entity someEntity = this.obtainEntity();
* float x = 1.0F, y = 3.0F, z = 0.1F;
* someEntity.<ins>setLocation</ins>(x, <ins>y</ins>, z, true);
*}</code></pre>
*</blockquote>
*
* <p>Let us assume that we wish to modify the <ins><tt>y</tt></ins> value when
* calling the <ins><tt>setLocation</tt></ins> method. We know that the
* arguments are <tt>float</tt>s and that the <tt>y</tt> value is the <em>second
* </em> (index = 1) <tt>float</tt> argument. Thus our injector requires the
* following signature:
*
* <blockquote><pre>&#064;ModifyArg(method = "...", at = ..., index = 1)
*private float adjustYCoord(float y) {
* return y + 64.0F;
*}</pre></blockquote>
* <blockquote><code>&#064;ModifyArg(method = "targetMethod", at = &#64;At(value
* = "INVOKE", target = "<ins>setLocation(FFFZ)V</ins>"), index = 1)<br />
* private float adjustYCoord(float y) {<br />
* &nbsp; &nbsp; return y + 64.0F;<br />
* }</code></blockquote>
*
* <p>The callback consumes the original value of <tt>y</tt> and returns the
* adjusted value.</p>
@@ -64,10 +75,11 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* arguments if required, to provide additional context for the callback. In
* this case the arguments of the callback should match the target method:</p>
*
* <blockquote><pre>&#064;ModifyArg(method = "...", at = ..., index = 1)
*private float adjustYCoord(float x, float y, float z, boolean interpolate) {
* return (x == 0 && y == 0) ? 0 : y;
*}</pre></blockquote>
* <blockquote><code>&#064;ModifyArg(method = "targetMethod", at = &#64;At(value
* = "INVOKE", target = "<ins>setLocation(FFFZ)V</ins>"), index = 1)<br />
* private float adjustYCoord(float x, float y, float z, boolean interpolate) {
* <br />&nbsp; &nbsp; return (x == 0 &amp;&amp; y == 0) ? 0 : y;<br />
* }</code></blockquote>
*/
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@@ -37,20 +37,27 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
/**
* Specifies that this mixin method should inject a variable modifier callback
* to itself in the target method(s) identified by {@link #method}.
* to itself in the target method(s) identified by {@link #method}. The variable
* modifier can modify a single local variable in the target method frame.
*
* <p>If the variable being modified is a method argument, specifying the
* <tt>{@link #argsOnly argsOnly=true}</tt> reduces the overhead of calculating
* the local variable table for the method.</p>
*
* <p><tt>ModifyVariable</tt> callbacks should always take one argument of the
* type to capture and return the same type. For example a <tt>ModifyVariable
* </tt> for a local of type {@link String} should have the signature:</p>
* </tt> for a local of type <ins>{@link String}</ins> should have the
* signature:</p>
*
* <code>private String methodName(String variable) { ...</code>
* <blockquote><code>private <ins>String</ins> myHandlerMethod(<ins>String</ins>
* variable) {<br />&nbsp; &nbsp; ...</code></blockquote>
*
* <p>The callback receives the current value of the local variable, and should
* return the new value.</p>
*
* <p>The injector has two operating modes, <em>explicit</em> and <em>implicit
* </em>, and can operate either on the entire LVT or on the method arguments
* only</p>.
* </em>, and can operate either on the entire LVT or on the {@link #argsOnly
* ethod arguments only}.</p>
*
* <p>In <em>explicit</em> mode, the variable to capture can be specified by
* specifying values for the discriminator arguments {@link #ordinal},
@@ -55,7 +55,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* int def = 1;
* Foo someObject = new Foo();
*
* // Hooking this method
* <del>// Hooking this method</del>
* boolean xyz = someObject.bar(abc, def);
*}</pre>
* </blockquote>
@@ -63,7 +63,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* <p>The signature of the redirected method should be:</p>
*
* <blockquote>
* <pre>public boolean barProxy(Foo someObject, int abc, int def)</pre>
* <code>public boolean barProxy(Foo someObject, int abc, int def)</code>
* </blockquote>
*
* <p>For obvious reasons this does not apply for static methods, for static
@@ -77,8 +77,8 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* arguments) by appending the arguments to the method signature:</p>
*
* <blockquote>
* <pre>public boolean barProxy(Foo someObject, int abc, int def,
* int someInt, String someString)</pre>
* <code>public boolean barProxy(Foo someObject, int abc, int def,
* int someInt, String someString)</code>
* </blockquote>
*
* <p>All arguments of a method redirect handler, and the return type, can be
@@ -92,7 +92,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* handling a field <b>write</b> (<tt>PUTFIELD</tt>, <tt>PUTSTATIC</tt>) or a
* field <b>read</b> (<tt>GETFIELD</tt>, <tt>GETSTATIC</tt>).</p>
*
* <table width="100%">
* <table width="100%" class="infoTable">
* <tr>
* <th width="25%">Operation (OPCODE)</th>
* <th>Handler signature</th>
@@ -148,7 +148,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* <em>indices</em>, for multi-dimensional arrays) and returns <em>the element
* type</em> (in this case <tt>String</tt>) as follows:</p>
*
* <table width="100%">
* <table width="100%" class="infoTable">
* <tr>
* <th width="25%">Operation</th>
* <th>Handler signature</th>
@@ -177,16 +177,16 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* <tt>array=length</tt> and configure your handler signature to return <tt>int
* </tt> and consume the array as an argument:</p>
*
* <blockquote><code>private int getLength(<b>ElementType</b>[] array)
* <blockquote><code>private int getLength(<ins>ElementType</ins>[] array)
* </code></blockquote>
*
* -
* <p>For multi-dimensional arrays, provide one <tt>int</tt> argument for each
* additional dimension of the array:</p>
*
* <blockquote><code>// Multidimensional array<br />
* private <b>ElementType</b>[][] array;<br /><br />
* // Handler signature:<br />
* private <b>int</b> getLength(<b>ElementType</b>[][] array, int baseDim)
* <blockquote><code><del>// Multidimensional array</del><br />
* private <ins>ElementType</ins>[][] array;<br /><br />
* <del>// Handler signature:</del><br /> private <ins>int</ins>
* getLength(<ins>ElementType</ins>[][] array, int baseDim)
* </code></blockquote>
*
* <h3>New Object Redirect Mode (Factory Mode)</h3>
@@ -211,7 +211,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
*class Foo {
* private final int x, y;
*
* // ctor we wish to hook
* <del>// ctor we wish to hook</del>
* Foo(int x, int y) {
* this.x = x;
* this.y = y;
@@ -231,7 +231,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* example to redirect the following object creation call:</p>
*
* <blockquote><pre>public void exampleFunc(String someString, int dx, int dy) {
* // Hooking this constructor
* <del>// Hooking this constructor</del>
* Foo someFoo = new Foo(dx * 10, dy * 10);
*}</pre>
* </blockquote>
@@ -239,15 +239,15 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
* <p>The signature of the handler method should be:</p>
*
* <blockquote>
* <pre>public Foo constructFoo(int x, int y)</pre>
* <code>public Foo constructFoo(int x, int y)</code>
* </blockquote>
*
* <p>Note that like other redirectors, it is possible to capture the target
* method's arguments by appending them to the handler method's signature:</p>
*
* <blockquote>
* <tt>public Foo constructFoo(int x, int y, String someString, int dx,
* int dy)</tt>
* <code>public Foo constructFoo(int x, int y, String someString, int dx,
* int dy)</code>
* </blockquote>
*
* <h3><tt>instanceof</tt> Redirect Mode</h3>
@@ -277,8 +277,8 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
*
* <p>Note that this results in the injected code being less efficient, because
* the <tt>instanceof</tt> opcode is replaced with discrete code similar to <tt>
* reference != null && yourClass.isAssignableFrom(reference.getClass())</tt> in
* the target method body.</p>
* reference != null &amp;&amp; yourClass.isAssignableFrom(reference.getClass())
* </tt> in the target method body.</p>
*
* <p>The arguments to an <tt>instanceof</tt> redirect handler <b>must always be
* <tt>Object, Class</tt> even if the variable type is known</b>. This is
@@ -298,7 +298,7 @@ import org.spongepowered.asm.util.ConstraintParser.Constraint;
*
* <blockquote><pre>class Foo : Bar {
* Foo(int arg) {
* super(<span style="background: #FF0">Foo.isEven(arg)</span>);
* super(<ins>Foo.isEven(arg)</ins>);
* }
*
* static int isEven(int arg) {
@@ -85,7 +85,7 @@ import org.spongepowered.asm.mixin.injection.InjectionPoint.Selector;
* thing.<b>processStuff</b>();
* }
*
* // A new call to processStuff, which now has the ordinal 1
* <del>// A new call to processStuff, which now has the ordinal 1</del>
* bar.getActiveThing().<b>processStuff</b>();
*
* Thing specialThing = bar.getSpecialThing();
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Implementation of callback injector functionality provided by
* {@link org.spongepowered.asm.mixin.injection.Inject @#64;Inject}.
*/
package org.spongepowered.asm.mixin.injection.callback;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Common base classes for injector implementations.
*/
package org.spongepowered.asm.mixin.injection.code;
@@ -65,7 +65,7 @@ import com.google.common.primitives.Ints;
* int def = 1;
* Foo someObject = new Foo();
*
* // Hooking this method
* <del>// Hooking this method</del>
* boolean xyz = someObject.bar(abc, def);</pre>
* </blockquote>
*
@@ -0,0 +1,32 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Support classes for
* {@link org.spongepowered.asm.mixin.injection.ModifyArgs &#64;ModifyArgs}
* which handle argument bundles
* ({@link org.spongepowered.asm.mixin.injection.invoke.arg.Args}).
*/
package org.spongepowered.asm.mixin.injection.invoke.arg;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Implementation of injectors which primarily mutate method invocations.
*/
package org.spongepowered.asm.mixin.injection.invoke;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Utility classes for invoke injectors.
*/
package org.spongepowered.asm.mixin.injection.invoke.util;
@@ -0,0 +1,31 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Implementation of variable modifier injector specified by
* {@link org.spongepowered.asm.mixin.injection.ModifyVariable
* &#64;ModifyVariable}
*/
package org.spongepowered.asm.mixin.injection.modify;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Injectors are class postprocessors which search for annotated methods merged
* by mixins and perform weaving operations as requested.
*/
package org.spongepowered.asm.mixin.injection;
@@ -71,41 +71,41 @@ import com.google.common.primitives.Longs;
* <dt>ordinal</dt>
* <dd>The ordinal position of the constant opcode to match. The default value
* is <b>-1</b> which supresses ordinal matching</dd>
* <dt><em>named argument</em> nullValue</dt>
* <dt><i>named argument:</i> nullValue</dt>
* <dd>To match <tt>null</tt> literals in the method body, set this to
* <tt>true</tt></dd>
* <dt><em>named argument</em> intValue</dt>
* <dt><i>named argument:</i> intValue</dt>
* <dd>To match <tt>int</tt> literals in the method body. See also the
* <em>expandZeroConditions</em> argument below for concerns when matching
* conditional zeroes.</dd>
* <dt><em>named argument</em> floatValue</dt>
* <dt><i>named argument:</i> floatValue</dt>
* <dd>To match <tt>float</tt> literals in the method body.</dd>
* <dt><em>named argument</em> longValue</dt>
* <dt><i>named argument:</i> longValue</dt>
* <dd>To match <tt>long</tt> literals in the method body.</dd>
* <dt><em>named argument</em> doubleValue</dt>
* <dt><i>named argument:</i> doubleValue</dt>
* <dd>To match <tt>double</tt> literals in the method body.</dd>
* <dt><em>named argument</em> stringValue</dt>
* <dt><i>named argument:</i> stringValue</dt>
* <dd>To match {@link String} literals in the method body.</dd>
* <dt><em>named argument</em> classValue</dt>
* <dt><i>named argument:</i> classValue</dt>
* <dd>To match {@link Class} literals in the method body.</dd>
* <dt><em>named argument</em> log</dt>
* <dt><i>named argument:</i> log</dt>
* <dd>Enable debug logging when searching for matching opcodes.</dd>
* <dt><em>named argument</em> expandZeroConditions</dt>
* <dt><i>named argument:</i> expandZeroConditions</dt>
* <dd>See the {@link Constant#expandZeroConditions} option, this argument
* should be a list of {@link Condition} names</dd>
* </dl>
*
* <p>Examples:</p>
* <blockquote><pre>
* // Find all integer constans with value 4
* <del>// Find all integer constans with value 4</del>
* &#064;At(value = "CONSTANT", args = "intValue=4")</pre>
* </blockquote>
* <blockquote><pre>
* // Find the String literal "foo"
* <del>// Find the String literal "foo"</del>
* &#064;At(value = "CONSTANT", args = "stringValue=foo"</pre>
* </blockquote>
* <blockquote><pre>
* // Find all integer constants with value 0 and expand conditionals
* <del>// Find integer constants with value 0 and expand conditionals</del>
* &#064;At(
* value = "CONSTANT",
* args = {
@@ -49,21 +49,33 @@ import org.spongepowered.asm.util.Bytecode;
* <dl>
* <dt>target</dt>
* <dd>A {@link ITargetSelector Target Selector} which identifies the target
* field.</dd>
* field.</dd>
* <dt>opcode</dt>
* <dd>The {@link Opcodes opcode} of the field access, must be one of
* GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.</dd>
* GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.</dd>
* <dt>ordinal</dt>
* <dd>The ordinal position of the field access to match. For example if the
* field is referenced 3 times and you want to match the 3rd then you can
* specify an <em>ordinal</em> of <b>2</b> (ordinals are zero-indexed). The
* default value is <b>-1</b> which supresses ordinal matching</dd>
* field is referenced 3 times and you want to match the 3rd then you can
* specify an <em>ordinal</em> of <b>2</b> (ordinals are zero-indexed). The
* default value is <b>-1</b> which supresses ordinal matching</dd>
* <dt><i>named argument:</i> array</dt>
* <dd>For matching accesses to an array field element following a GETFIELD or
* GETSTATIC. Specify <tt>get</tt>, <tt>set</tt> or <tt>length</tt> to match
* the desired operation.</dd>
* <dt><i>named argument:</i> fuzz</dt>
* <dd>When matching array operations using <tt>array</tt> the injection point
* will by default search up to 8 instructions after the matched field insn.
* However in some cases the array operation may be further from the matched
* GETFIELD or GETSTATIC and the amount to search (the "fuzz factor" can be
* specified using this argument. Likewise to optimise the search against
* false positives, this value can be specified as a lower value if desired.
* Has no effect if <tt>array</tt> is not specified.</dd>
* </dl>
*
* <p>Example:</p>
* <blockquote><pre>
* <blockquote><code>
* &#064;At(value = "FIELD", target="field_59_z:I", opcode = Opcodes.GETFIELD)
* </pre>
* </code>
* </blockquote>
*
* <p>Matching array access:</p>
@@ -72,9 +84,10 @@ import org.spongepowered.asm.util.Bytecode;
* operation. To enable this behaviour specify the <tt>array</tt> named-argument
* with the desired operation:</p>
*
* <blockquote><pre>
* &#064;At(value = "FIELD", target="myIntArray:[I", args = "array=get")
* </pre>
* <blockquote><code>
* &#064;At(value = "FIELD", target="myIntArray:[I", opcode
* = Opcodes.GETFIELD, args = "array=get")
* </code>
* </blockquote>
*
* <p>See {@link Redirect} for information on array element redirection.</p>
@@ -52,7 +52,7 @@ import com.google.common.base.Strings;
* {@link org.spongepowered.asm.mixin.injection.At At}:</p>
*
* <dl>
* <dt><em>named argument</em> class (or specify using <tt>target</tt></dt>
* <dt><i>named argument:</i> class (or specify using <tt>target</tt></dt>
* <dd>The value of the NEW node to look for, the fully-qualified class name
* </dd>
* <dt>ordinal</dt>
@@ -70,16 +70,16 @@ import com.google.common.base.Strings;
*
* <p>Examples:</p>
* <blockquote><pre>
* // Find all NEW opcodes for <tt>String</tt>
* <del>// Find all NEW opcodes for <tt>String</tt></del>
* &#064;At(value = "NEW", args = "class=java/lang/String")</pre>
* </blockquote>
* <blockquote><pre>
* // Find all NEW opcodes for <tt>String</tt>
* <del>// Find all NEW opcodes for <tt>String</tt></del>
* &#064;At(value = "NEW", target = "java/lang/String"</pre>
* </blockquote>
* <blockquote><pre>
* // Find all NEW opcodes for <tt>String</tt> which are constructed using the
* // ctor which takes an array of <tt>char</tt>
* <del>// Find all NEW opcodes for <tt>String</tt> which are constructed
* // using the ctor which takes an array of <tt>char</tt></del>
* &#064;At(value = "NEW", target = "([C)Ljava/lang/String;"</pre>
* </blockquote>
*
@@ -64,7 +64,7 @@ import org.spongepowered.asm.mixin.injection.struct.InjectionPointData;
* the method is invoked 3 times and you want to match the 3rd then you can
* specify an <em>ordinal</em> of <b>2</b> (ordinals are zero-indexed). The
* default value is <b>-1</b> which supresses ordinal matching</dd>
* <dt><em>named argument</em> ldc</dt>
* <dt><i>named argument:</i> ldc</dt>
* <dd>The value of the LDC node to look for prior to the method invocation
* </dd>
* </dl>
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Built-in {@link org.spongepowered.asm.mixin.injection.InjectionPoint
* injection point} classes.
*/
package org.spongepowered.asm.mixin.injection.points;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Dynamic target selectors provide custom logic for selecting injector targets.
*/
package org.spongepowered.asm.mixin.injection.selectors.dynamic;
@@ -0,0 +1,31 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Target selectors are consumed by injectors and injection points when
* identifying target members in a class or inside a method, see {@link
* org.spongepowered.asm.mixin.injection.selectors.ITargetSelector}.
*/
package org.spongepowered.asm.mixin.injection.selectors;
@@ -48,43 +48,51 @@ import com.google.common.base.Objects;
import com.google.common.base.Strings;
/**
* <p>Target selector, also used as a general-purpose information bundle about a
* member (method or field) parsed from a String token in another annotation,
* this is used where target members need to be specified as Strings in order to
* parse the String representation to something useful. See
* {@link ITargetSelector} for other supported selector types.</p>
* <p>Struct which defines an <b>Explcit Target selector</b>, See
* {@link ITargetSelector} for other supported selector types. This struct is
* also used as a general-purpose information bundle about a member (method or
* field) parsed from a String token in another annotation, this is used where
* target members need to be specified as Strings in order to parse the String
* representation to something useful.</p>
*
* <p>Some examples:</p>
* <blockquote><pre>
* // references a method or field called func_1234_a, if there are multiple
* // members with the same signature, matches the first occurrence
* func_1234_a
* <del>// references a method or field called func_1234_a, if there are
* // multiple members with the same signature, matches the first occurrence
*</del> func_1234_a
*
* // references a method or field called func_1234_a, if there are multiple
* // members with the same signature, matches all occurrences
* <del>// references a method or field called func_1234_a, if there are
* // multiple members with matching name, matches all occurrences</del>
* func_1234_a*
*
* // references a method called func_1234_a which takes 3 ints and returns
* // a bool
* <del>// references all methods which take 3 ints and return a bool</del>
* *(III)Z
*
* <del>// references a method called func_1234_a which takes 3 ints and
* // returns a bool</del>
* func_1234_a(III)Z
*
* // references a field called field_5678_z which is a String
* <del>// references a field called field_5678_z which is a String</del>
* field_5678_z:Ljava/lang/String;
*
* // references a ctor which takes a single String argument
* <del>// references a ctor which takes a single String argument</del>
* &lt;init&gt;(Ljava/lang/String;)V
*
* // references a method called func_1234_a in class foo.bar.Baz
* <del>// references a method called func_1234_a in class foo.bar.Baz</del>
* Lfoo/bar/Baz;func_1234_a
*
* // references a field called field_5678_z in class com.example.Dave
* Lcom/example/Dave;field_5678_z
* <del>// references a field called field_5678_z in class com.example.Dave
*</del> Lcom/example/Dave;field_5678_z
*
* // references a method called func_1234_a in class foo.bar.Baz which takes
* // three doubles and returns void
* <del>// references a field called field_5678_z in class com.example.Dave
* // which is of type String</del>
* Lcom/example/Dave;field_5678_z:Ljava/lang/String;
*
* <del>// references a method called func_1234_a in class foo.bar.Baz which
* // takes three doubles and returns void</del>
* Lfoo/bar/Baz;func_1234_a(DDD)V
*
* // alternate syntax for the same
* <del>// alternate syntax for the same</del>
* foo.bar.Baz.func_1234_a(DDD)V</pre>
* </blockquote>
*/
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Internal data bundles used by injectors during application.
*/
package org.spongepowered.asm.mixin.injection.struct;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Throwable classes (errors and exceptions) for injectors.
*/
package org.spongepowered.asm.mixin.injection.throwables;
@@ -0,0 +1,34 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Primary interaction points (
* {@link org.spongepowered.asm.mixin.Mixin &#64;Mixin} and
* {@link org.spongepowered.asm.mixin.MixinEnvironment &#64;MixinEnvironment})
* and annotations (eg&#46;
* {@link org.spongepowered.asm.mixin.Mixin &#64;Mixin},
* {@link org.spongepowered.asm.mixin.Shadow &#64;Shadow}) for mixin consumers.
*/
package org.spongepowered.asm.mixin;
@@ -0,0 +1,31 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Refmaps are data bundles which map string references to obfuscated
* counterparts at runtime, see {@link
* org.spongepowered.asm.mixin.refmap.ReferenceMapper}.
*/
package org.spongepowered.asm.mixin.refmap;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Internal data bundles used by mixin during application.
*/
package org.spongepowered.asm.mixin.struct;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Mixin throwables and throwable base classes.
*/
package org.spongepowered.asm.mixin.throwables;
@@ -112,9 +112,9 @@ public final class ClassInfo {
}
/**
* When using {@link ClassInfo#forType}, determines whether an array type
* should be returned as declared (eg. as <tt>Object</tt>) or whether the
* element type should be returned instead.
* When using {@link ClassInfo#forType ClassInfo.forType}, determines
* whether an array type should be returned as declared (eg. as <tt>Object
* </tt>) or whether the element type should be returned instead.
*/
public static enum TypeLookup {
@@ -974,7 +974,7 @@ public final class ClassInfo {
return this.name;
}
public MethodMapper getMethodMapper() {
MethodMapper getMethodMapper() {
return this.methodMapper;
}
@@ -42,7 +42,7 @@ import org.spongepowered.asm.util.Annotations;
* Information about an interface being runtime-patched onto a mixin target
* class, see {@link org.spongepowered.asm.mixin.Implements Implements}
*/
public final class InterfaceInfo {
final class InterfaceInfo {
/**
* Parent mixin
@@ -44,7 +44,7 @@ import com.google.common.base.Strings;
/**
* Maintains method remaps for a target class
*/
public class MethodMapper {
class MethodMapper {
/**
* Logger
@@ -69,7 +69,7 @@ import org.spongepowered.asm.util.perf.Profiler.Section;
/**
* Heart of the Mixin pipeline
*/
public class MixinProcessor {
class MixinProcessor {
/**
* Phase during which an error occurred, delegates to functionality in
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Internal mixin transformation pipeline extensions.
*/
package org.spongepowered.asm.mixin.transformer.ext.extensions;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Internal mixin transformation pipeline extension interface and registry of
* active extensions.
*/
package org.spongepowered.asm.mixin.transformer.ext;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Meta annotations applied by the mixin processor to fingerprint mixin actions.
*/
package org.spongepowered.asm.mixin.transformer.meta;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Internal mixin transformation pipeline classes.
*/
package org.spongepowered.asm.mixin.transformer;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Mixin transformation pipeline throwables.
*/
package org.spongepowered.asm.mixin.transformer.throwables;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Structs for method and field mappings.
*/
package org.spongepowered.asm.obfuscation.mapping.common;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Structs for method and field mappings with specific behaviour for ForgeGradle
* 3 and above.
*/
package org.spongepowered.asm.obfuscation.mapping.fg3;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Structs for method and field mappings with specific behaviour for MCP
*/
package org.spongepowered.asm.obfuscation.mapping.mcp;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Interface for structs for method and field mappings.
*/
package org.spongepowered.asm.obfuscation.mapping;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Obfuscation-related structs for interoperability with the annotation
* processor and runtime obfuscation utilities.
*/
package org.spongepowered.asm.obfuscation;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* The Mixin runtime and utilities.
*/
package org.spongepowered.asm;
@@ -0,0 +1,31 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Mixin service interface, with base classes for all the moving parts of the
* Mixin transformation pipeline and supporting infrastructure. Abstracted here
* and implemented by platform-specific modules.
*/
package org.spongepowered.asm.service;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Specialised ASM utility and base classes used by the mixin processor.
*/
package org.spongepowered.asm.transformers;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Utilities, abstractions and specialised subclasses used by Mixin for
* interacting with ASM.
*/
package org.spongepowered.asm.util.asm;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Logging abstraction to provide a unified logging interface for classes which
* operate both at runtime and in the AP.
*/
package org.spongepowered.asm.util.logging;
@@ -0,0 +1,30 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Utility classes used by the entire Mixin pipeline, including utilities for
* working with bytecode as well as general-purpose tools and parsers.
*/
package org.spongepowered.asm.util;
@@ -0,0 +1,29 @@
/*
* This file is part of Mixin, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Performance profiling for Mixin.
*/
package org.spongepowered.asm.util.perf;