Annotation Type Slice


  • @Documented
    @Retention(CLASS)
    public @interface Slice
    The Slice annotation denotes a specific area in which an injection point may be placed in. Note that injection points may react to the slice, so slices are much more than a simple filter. More specifically, the HEAD injection point will inject before the first instruction in the slice, while TAIL will inject before the last return instruction within the slice (and will throw an error if there are no return instructions, contrary to other injection points).

    For most other injection points (such as INVOKE or CONSTANT), a slice can be seen as a simple range filter.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      At from
      An injection point that matches the first instruction within the slice.
      java.lang.String id
      The identifier of the slice.
      At to
      An injection point that matches the last instruction within the slice.
    • Element Detail

      • from

        At from
        An injection point that matches the first instruction within the slice.
        Returns:
        The first instruction to match
        Default:
        @org.spongepowered.asm.mixin.injection.At("HEAD")
      • id

        java.lang.String id
        The identifier of the slice. This attribute is in turn used for At.slice().

        If the attribute is left to the default value (and empty string), then the specified slice is the default slice within the context. As such it will apply to any Ats where the slice id wasn't explicitly defined.

        Defining multiple slices with the same name within the same context is not permitted (this includes the default slice id "" [an empty string]).

        Note that micromixin-transformer as well as the accompanying documentation only partly implements id() as well as At.slice(); significant derivations are to be expected between micromixin-transformer's behaviour (as well as the documented behaviour) and the spongeian transformer behaviour (as well as it's documentation). As such, usage of these attributes ought to be avoided in environments where usage of micromixin-transformer is expected and the spongeian documentation should be consulted before making use of this attribute.

        Returns:
        The identifier of the slice
        See Also:
        At.slice()
        Default:
        ""
      • to

        At to
        An injection point that matches the last instruction within the slice.
        Returns:
        The last instruction of the slice
        Default:
        @org.spongepowered.asm.mixin.injection.At("TAIL")