类 ReplaceFieldWithGetterAccess

java.lang.Object
net.neoforged.neoforge.coremods.ReplaceFieldWithGetterAccess
所有已实现的接口:
cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>

public class ReplaceFieldWithGetterAccess extends Object implements cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>
Replaces direct field access in a class with access to the getter.

The field specified by fieldName must be private and non-static. The method-call the field-access is redirected to does not take any parameters and returns an object of the same type as the field. If no methodName is passed, any method matching the described signature will be used as callable method.

  • 嵌套类概要

    从接口继承的嵌套类/接口 cpw.mods.modlauncher.api.ITransformer

    cpw.mods.modlauncher.api.ITransformer.Target<T>
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private final Map<String,String>
     
    private final Set<cpw.mods.modlauncher.api.ITransformer.Target<org.objectweb.asm.tree.ClassNode>>
     

    从接口继承的字段 cpw.mods.modlauncher.api.ITransformer

    DEFAULT_LABEL
  • 构造器概要

    构造器
    构造器
    说明
    ReplaceFieldWithGetterAccess(String className, Map<String,String> fieldToMethod)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    cpw.mods.modlauncher.api.TransformerVoteResult
    castVote(cpw.mods.modlauncher.api.ITransformerVotingContext context)
     
    cpw.mods.modlauncher.api.TargetType<org.objectweb.asm.tree.ClassNode>
     
    private static void
    redirectFieldToMethod(org.objectweb.asm.tree.ClassNode classNode, String fieldName, @Nullable String methodName)
     
    Set<cpw.mods.modlauncher.api.ITransformer.Target<org.objectweb.asm.tree.ClassNode>>
     
    org.objectweb.asm.tree.ClassNode
    transform(org.objectweb.asm.tree.ClassNode input, cpw.mods.modlauncher.api.ITransformerVotingContext context)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 cpw.mods.modlauncher.api.ITransformer

    labels
  • 字段详细资料

    • fieldToMethod

      private final Map<String,String> fieldToMethod
    • targets

      private final Set<cpw.mods.modlauncher.api.ITransformer.Target<org.objectweb.asm.tree.ClassNode>> targets
  • 构造器详细资料

    • ReplaceFieldWithGetterAccess

      public ReplaceFieldWithGetterAccess(String className, Map<String,String> fieldToMethod)
  • 方法详细资料

    • getTargetType

      public cpw.mods.modlauncher.api.TargetType<org.objectweb.asm.tree.ClassNode> getTargetType()
      指定者:
      getTargetType 在接口中 cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>
    • targets

      public Set<cpw.mods.modlauncher.api.ITransformer.Target<org.objectweb.asm.tree.ClassNode>> targets()
      指定者:
      targets 在接口中 cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>
    • transform

      public org.objectweb.asm.tree.ClassNode transform(org.objectweb.asm.tree.ClassNode input, cpw.mods.modlauncher.api.ITransformerVotingContext context)
      指定者:
      transform 在接口中 cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>
    • castVote

      public cpw.mods.modlauncher.api.TransformerVoteResult castVote(cpw.mods.modlauncher.api.ITransformerVotingContext context)
      指定者:
      castVote 在接口中 cpw.mods.modlauncher.api.ITransformer<org.objectweb.asm.tree.ClassNode>
    • redirectFieldToMethod

      private static void redirectFieldToMethod(org.objectweb.asm.tree.ClassNode classNode, String fieldName, @Nullable @Nullable String methodName)