Class EmptyElementFilter

java.lang.Object
net.fabricmc.mappingio.adapter.ForwardingMappingVisitor
net.fabricmc.mappingio.adapter.EmptyElementFilter
All Implemented Interfaces:
MappingVisitor

public class EmptyElementFilter extends ForwardingMappingVisitor
A mapping visitor that filters out elements which effectively don't contain any data. Elements are only forwarded if they have:
  • a non-null comment,
  • a non-null or non-equal destination name,
  • a non-null or non-equal destination descriptor,
  • or a child element to which one of these points applies.
API Note:
Extending this class is allowed, but no guarantees are made regarding the stability of its protected members.
  • Field Details

    • treatSrcOnDstAsEmpty

      protected final boolean treatSrcOnDstAsEmpty
    • relayHeaderElements

      protected boolean relayHeaderElements
    • relayMetadata

      protected boolean relayMetadata
    • dstNsCount

      protected int dstNsCount
    • memberKind

      protected MappedElementKind memberKind
    • localKind

      protected MappedElementKind localKind
    • classSrcName

      protected String classSrcName
    • memberSrcName

      protected String memberSrcName
    • memberSrcDesc

      protected String memberSrcDesc
    • localSrcName

      protected String localSrcName
    • localLvIndex

      protected int localLvIndex
    • argPosition

      protected int argPosition
    • varLvtRowIndex

      protected int varLvtRowIndex
    • varStartOpIdx

      protected int varStartOpIdx
    • varEndOpIdx

      protected int varEndOpIdx
    • classDstNames

      protected String[] classDstNames
    • memberDstNames

      protected String[] memberDstNames
    • memberDstDescs

      protected String[] memberDstDescs
    • localDstNames

      protected String[] localDstNames
    • classComment

      protected String classComment
    • memberComment

      protected String memberComment
    • localComment

      protected String localComment
    • forwardClass

      protected boolean forwardClass
    • forwardMember

      protected boolean forwardMember
    • forwardLocal

      protected boolean forwardLocal
    • forwardedClass

      protected boolean forwardedClass
    • forwardedMember

      protected boolean forwardedMember
    • forwardedLocal

      protected boolean forwardedLocal
    • visitClass

      protected boolean visitClass
    • visitMember

      protected boolean visitMember
    • visitLocal

      protected boolean visitLocal
  • Constructor Details

    • EmptyElementFilter

      public EmptyElementFilter(MappingVisitor next)
      Creates a new EmptyElementFilter that treats destination names and descriptors which are equal to their source counterparts as empty.
      Parameters:
      next - The next visitor to forward the data to.
    • EmptyElementFilter

      public EmptyElementFilter(MappingVisitor next, boolean treatSrcOnDstAsEmpty)
      Parameters:
      next - The next visitor to forward the data to.
      treatSrcOnDstAsEmpty - Whether destination names and descriptors that are equal to their source counterparts should be treated as empty.
  • Method Details