Interface MappingTree
- All Superinterfaces:
MappingTreeView
- All Known Subinterfaces:
VisitableMappingTree
- All Known Implementing Classes:
MemoryMappingTree
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 MappingTreeView
MappingTreeView.ClassMappingView, MappingTreeView.ElementMappingView, MappingTreeView.FieldMappingView, MappingTreeView.MemberMappingView, MappingTreeView.MetadataEntryView, MappingTreeView.MethodArgMappingView, MappingTreeView.MethodMappingView, MappingTreeView.MethodVarMappingView -
Field Summary
Fields inherited from interface 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.MethodMappingdefault voidpropagateOuterClassNames(boolean processRemappedDstNames) Searches for inner classes whose effective destination name contains outer classes referenced via their source name, scans the tree for potential mappings for these enclosing classes, and applies the latters' destination names to the formers' fully qualified name.default voidpropagateOuterClassNames(String srcNamespace, Collection<String> dstNamespaces, boolean processRemappedDstNames) Searches for inner classes whose effective destination name contains outer classes referenced via their source name, scans the tree for potential mappings for these enclosing classes, and applies the latters' destination names to the formers' fully qualified name.@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 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.
-
propagateOuterClassNames
default void propagateOuterClassNames(boolean processRemappedDstNames) Searches for inner classes whose effective destination name contains outer classes referenced via their source name, scans the tree for potential mappings for these enclosing classes, and applies the latters' destination names to the formers' fully qualified name.For example, it takes a class
class_1$class_2that doesn't have a mapping, tries to findclass_1, which let's say has the mappingSomeClass, and changes the former's destination name toSomeClass$class_2.Equivalent of
OuterClassNamePropagator, but more efficient since the tree's existing class map can be reused.- Parameters:
processRemappedDstNames- Whether already remapped destination names should also get their unmapped outer classes replaced.
-
propagateOuterClassNames
default void propagateOuterClassNames(String srcNamespace, Collection<String> dstNamespaces, boolean processRemappedDstNames) Searches for inner classes whose effective destination name contains outer classes referenced via their source name, scans the tree for potential mappings for these enclosing classes, and applies the latters' destination names to the formers' fully qualified name.For example, it takes a class
class_1$class_2that doesn't have a mapping, tries to findclass_1, which let's say has the mappingSomeClass, and changes the former's destination name toSomeClass$class_2.Equivalent of
OuterClassNamePropagator, but more efficient since the tree's existing class map can be reused.- Parameters:
srcNamespace- The namespace where the original/unmapped outer class names originate from.dstNamespaces- The namespaces where outer class names shall be propagated.processRemappedDstNames- Whether already remapped destination names should also get their unmapped outer classes replaced.
-
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.
-