Package net.fabricmc.mappingio.tree
Interface MappingTree
- All Superinterfaces:
MappingTreeView
- All Known Subinterfaces:
VisitableMappingTree
- All Known Implementing Classes:
MemoryMappingTree
Mutable mapping tree.
All returned collections are to be assumed unmodifiable, unless explicitly stated otherwise.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceNested 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 -
Method Summary
Modifier and TypeMethodDescriptionMerges a class mapping into the tree.void@Nullable MappingTree.ClassMappingdefault @Nullable MappingTree.ClassMappingCollection<? extends MappingTree.ClassMapping> default @Nullable MappingTree.FieldMappingdefault @Nullable MappingTree.FieldMappingList<? extends MappingTree.MetadataEntry> List<? extends MappingTree.MetadataEntry> getMetadata(String key) default @Nullable MappingTree.MethodMappingdefault @Nullable MappingTree.MethodMapping@Nullable MappingTree.ClassMappingremoveClass(String srcName) Removes a class mapping from the tree.booleanremoveMetadata(String key) Removes all metadata entries whose key is equal to the passed one.setDstNamespaces(List<String> namespaces) Sets the tree's and all of its contained elements' destination namespace names.@Nullable StringsetSrcNamespace(String namespace) Sets the tree's and all of its contained elements' source namespace name.Methods inherited from interface net.fabricmc.mappingio.tree.MappingTreeView
accept, accept, getDstNamespaces, getMaxNamespaceId, getMinNamespaceId, getNamespaceId, getNamespaceName, getSrcNamespace, mapClassName, mapClassName, mapDesc, mapDesc, mapDesc, mapDesc
-
Method Details
-
setSrcNamespace
Sets the tree's and all of its contained elements' source namespace name.If the passed namespace name equals an existing destination namespace's name, implementors may choose to switch the two namespaces around, analogous to
MappingSourceNsSwitch. This has to be made clear in the implementation's documentation.- Returns:
- The previous source namespace name, if present.
- Implementation Requirements:
- If switching with an existing destination namespace is requested, but not supported, an
UnsupportedOperationExceptionmust be thrown.
-
setDstNamespaces
Sets the tree's and all of its contained elements' destination namespace names.Can be used to reorder and/or drop destination namespaces, analogous to
MappingDstNsReorder.Implementors may allow switching with the source namespace as well, analogous to
MappingSourceNsSwitch. This has to be made clear in the implementation's documentation.- Returns:
- The previous destination namespaces.
- Throws:
IllegalArgumentException- If the passed namespace names contain duplicates.- Implementation Requirements:
- If switching with the source namespace is requested, but not supported, an
UnsupportedOperationExceptionmust be thrown.
-
getMetadata
List<? extends MappingTree.MetadataEntry> getMetadata()- 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 interfaceMappingTreeView- Returns:
- An unmodifiable list of all currently present metadata entries 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
-
removeMetadata
Removes all metadata entries whose key is equal to the passed one.- Returns:
- Whether any entries have been removed.
-
getClasses
Collection<? extends MappingTree.ClassMapping> getClasses()- Specified by:
getClassesin interfaceMappingTreeView
-
getClass
- Specified by:
getClassin interfaceMappingTreeView
-
getClass
- Specified by:
getClassin interfaceMappingTreeView
-
addClass
Merges a class mapping into the tree.- Returns:
- The
MappingTree.ClassMappinginstance present in the tree after the merge has occurred. May or may not be the passed instance.
-
removeClass
Removes a class mapping from the tree.- Returns:
- The removed class mapping, if any.
-
getField
@Nullable default @Nullable MappingTree.FieldMapping getField(String srcClsName, String srcName, @Nullable @Nullable String srcDesc) - Specified by:
getFieldin interfaceMappingTreeView- See Also:
-
getField
@Nullable default @Nullable MappingTree.FieldMapping getField(String clsName, String name, @Nullable @Nullable String desc, int namespace) - Specified by:
getFieldin interfaceMappingTreeView
-
getMethod
@Nullable default @Nullable MappingTree.MethodMapping getMethod(String srcClsName, String srcName, @Nullable @Nullable String srcDesc) - Specified by:
getMethodin interfaceMappingTreeView- See Also:
-
getMethod
@Nullable default @Nullable MappingTree.MethodMapping getMethod(String clsName, String name, @Nullable @Nullable String desc, int namespace) - Specified by:
getMethodin interfaceMappingTreeView- Parameters:
desc- Can be either complete desc or parameter-only desc.
-