Package net.fabricmc.mappingio.tree
Class MemoryMappingTree
java.lang.Object
net.fabricmc.mappingio.tree.MemoryMappingTree
- All Implemented Interfaces:
MappingVisitor,MappingTree,MappingTreeView,VisitableMappingTree
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.fabricmc.mappingio.tree.MappingTree
MappingTree.ClassMapping, MappingTree.ElementMapping, MappingTree.FieldMapping, MappingTree.MemberMapping, MappingTree.MetadataEntry, MappingTree.MethodArgMapping, MappingTree.MethodMapping, MappingTree.MethodVarMappingNested classes/interfaces inherited from interface net.fabricmc.mappingio.tree.MappingTreeView
MappingTreeView.ClassMappingView, MappingTreeView.ElementMappingView, MappingTreeView.FieldMappingView, MappingTreeView.MemberMappingView, MappingTreeView.MetadataEntryView, MappingTreeView.MethodArgMappingView, MappingTreeView.MethodMappingView, MappingTreeView.MethodVarMappingView -
Field Summary
Fields inherited from interface net.fabricmc.mappingio.tree.MappingTreeView
MIN_NAMESPACE_ID, NULL_NAMESPACE_ID, SRC_NAMESPACE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(MappingVisitor visitor, VisitOrder order) void@Nullable MappingTree.ClassMapping@Nullable MappingTree.ClassMappingCollection<? extends MappingTree.ClassMapping> List<? extends MappingTree.MetadataEntry> List<? extends MappingTree.MetadataEntry> getMetadata(String key) @Nullable String@Nullable MappingTree.ClassMappingremoveClass(String srcName) booleanremoveMetadata(String key) Removes all metadata entries whose key is equal to the passed one.voidreset()Reset the visitor including any chained visitors to allow for another independent visit (excluding visitEnd=false).setDstNamespaces(List<String> namespaces) voidsetHierarchyInfoProvider(@Nullable HierarchyInfoProvider<?> provider) voidsetIndexByDstNames(boolean indexByDstNames) @Nullable StringsetSrcNamespace(String namespace) booleanvisitClass(String srcName) voidvisitComment(MappedElementKind targetKind, String comment) Comment for the specified element (last content-visited or any parent).voidvisitDstName(MappedElementKind targetKind, int namespace, String name) Destination name for the current element.booleanvisitElementContent(MappedElementKind targetKind) Determine whether the element content (comment, sub-elements) should be visited.booleanvisitEnd()Finish the visitation pass.booleanvisitField(String srcName, @Nullable String srcDesc) voidvisitMetadata(String key, @Nullable String value) booleanvisitMethod(String srcName, @Nullable String srcDesc) booleanvisitMethodArg(int argPosition, int lvIndex, @Nullable String srcName) booleanvisitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable String srcName) voidvisitNamespaces(String srcNamespace, List<String> dstNamespaces) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.mappingio.tree.MappingTree
getField, getField, getMethod, getMethodMethods inherited from interface net.fabricmc.mappingio.tree.MappingTreeView
accept, getMaxNamespaceId, getMinNamespaceId, getNamespaceId, getNamespaceName, mapClassName, mapClassName, mapDesc, mapDesc, mapDesc, mapDescMethods inherited from interface net.fabricmc.mappingio.MappingVisitor
getFlags, visitContent, visitDstDesc, visitHeader
-
Constructor Details
-
MemoryMappingTree
public MemoryMappingTree() -
MemoryMappingTree
public MemoryMappingTree(boolean indexByDstNames) -
MemoryMappingTree
-
-
Method Details
-
setIndexByDstNames
public void setIndexByDstNames(boolean indexByDstNames) -
setHierarchyInfoProvider
-
getSrcNamespace
- Specified by:
getSrcNamespacein interfaceMappingTreeView- Returns:
- The source namespace, or
nullif the tree is uninitialized.
-
setSrcNamespace
- Specified by:
setSrcNamespacein interfaceMappingTree
-
getDstNamespaces
- Specified by:
getDstNamespacesin interfaceMappingTreeView- Returns:
- A list containing the destination namespaces, in order of their IDs. Can only be empty if the tree is uninitialized.
-
setDstNamespaces
- Specified by:
setDstNamespacesin interfaceMappingTree
-
getMetadata
- Specified by:
getMetadatain interfaceMappingTree- Specified by:
getMetadatain interfaceMappingTreeView- Returns:
- A modifiable list of all metadata entries currently present in the tree. The list's order is equal to the order in which the entries have been originally added.
-
getMetadata
- Specified by:
getMetadatain interfaceMappingTree- Specified by:
getMetadatain interfaceMappingTreeView- Returns:
- An unmodifiable list of all metadata entries currently present in the tree whose key is equal to the passed one. The list's order is equal to the order in which the entries have been originally added.
-
addMetadata
- Specified by:
addMetadatain interfaceMappingTree
-
removeMetadata
Description copied from interface:MappingTreeRemoves all metadata entries whose key is equal to the passed one.- Specified by:
removeMetadatain interfaceMappingTree- Returns:
- Whether or not any entries have been removed.
-
getClasses
- Specified by:
getClassesin interfaceMappingTree- Specified by:
getClassesin interfaceMappingTreeView
-
getClass
- Specified by:
getClassin interfaceMappingTree- Specified by:
getClassin interfaceMappingTreeView
-
getClass
- Specified by:
getClassin interfaceMappingTree- Specified by:
getClassin interfaceMappingTreeView
-
addClass
- Specified by:
addClassin interfaceMappingTree
-
removeClass
- Specified by:
removeClassin interfaceMappingTree
-
accept
- Specified by:
acceptin interfaceMappingTreeView- Throws:
IOException
-
reset
public void reset()Description copied from interface:MappingVisitorReset the visitor including any chained visitors to allow for another independent visit (excluding visitEnd=false).- Specified by:
resetin interfaceMappingVisitor
-
visitNamespaces
- Specified by:
visitNamespacesin interfaceMappingVisitor
-
visitMetadata
- Specified by:
visitMetadatain interfaceMappingVisitor
-
visitClass
- Specified by:
visitClassin interfaceMappingVisitor
-
visitField
- Specified by:
visitFieldin interfaceMappingVisitor
-
visitMethod
- Specified by:
visitMethodin interfaceMappingVisitor
-
visitMethodArg
- Specified by:
visitMethodArgin interfaceMappingVisitor
-
visitMethodVar
public boolean visitMethodVar(int lvtRowIndex, int lvIndex, int startOpIdx, int endOpIdx, @Nullable @Nullable String srcName) - Specified by:
visitMethodVarin interfaceMappingVisitor
-
visitEnd
public boolean visitEnd()Description copied from interface:MappingVisitorFinish the visitation pass.- Specified by:
visitEndin interfaceMappingVisitor- Returns:
- true if the visitation pass is final, false if it should be started over
-
visitDstName
Description copied from interface:MappingVisitorDestination name for the current element.- Specified by:
visitDstNamein interfaceMappingVisitor- Parameters:
namespace- namespace index, index into the dstNamespaces List inMappingVisitor.visitNamespaces(java.lang.String, java.util.List<java.lang.String>)name- destination name
-
visitElementContent
Description copied from interface:MappingVisitorDetermine whether the element content (comment, sub-elements) should be visited.Called after visiting the target itself (e.g. visitClass for targetKind=class), its dst names and descs, but before any child elements or the comment.
This is also a notification about all available dst names having been passed on.
- Specified by:
visitElementContentin interfaceMappingVisitor- Returns:
- true if the contents are to be visited, false otherwise
- Throws:
IOException
-
visitComment
Description copied from interface:MappingVisitorComment for the specified element (last content-visited or any parent).- Specified by:
visitCommentin interfaceMappingVisitor- Parameters:
comment- comment as a potentially multi-line string
-