Class UnpickV2Remapper
java.lang.Object
daomephsta.unpick.constantmappers.datadriven.parser.v2.UnpickV2Remapper
- All Implemented Interfaces:
UnpickV2Reader.Visitor
public class UnpickV2Remapper extends java.lang.Object implements UnpickV2Reader.Visitor
Remaps names and descriptors of target method definitions, then makes a delegate visitor visit the remapped target methods.
All other visitor methods only delegate to the delegate visitor.
-
Constructor Summary
Constructors Constructor Description UnpickV2Remapper(java.util.Map<java.lang.String,java.lang.String> classMappings, java.util.Map<MethodKey,java.lang.String> methodMappings, UnpickV2Reader.Visitor delegate)Creates a newUnpickV2Remapper.UnpickV2Remapper(java.util.Map<java.lang.String,java.lang.String> classMappings, java.util.Map<MethodKey,java.lang.String> methodMappings, java.util.Map<FieldKey,java.lang.String> fieldMappings, UnpickV2Reader.Visitor delegate)Creates a newUnpickV2Remapper. -
Method Summary
Modifier and Type Method Description voidendVisit()Visits the end of the file.voidstartVisit()Visits the start of the file.voidvisitFlagConstantDefinition(java.lang.String group, java.lang.String owner, java.lang.String name, java.lang.String value, java.lang.String descriptor)Visits a flag constant definition (start tokenflag).
valueanddescriptorwill either both have a value or both be null.voidvisitLineNumber(int lineNumber)Visits the line number.voidvisitSimpleConstantDefinition(java.lang.String group, java.lang.String owner, java.lang.String name, java.lang.String value, java.lang.String descriptor)Visits a simple constant definition (start tokenconstant).
valueanddescriptorwill either both have a value or both be null.UnpickV2Reader.TargetMethodDefinitionVisitorvisitTargetMethodDefinition(java.lang.String owner, java.lang.String name, java.lang.String descriptor)Visits a target method definition (start tokentarget_method).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
UnpickV2Remapper
public UnpickV2Remapper(java.util.Map<java.lang.String,java.lang.String> classMappings, java.util.Map<MethodKey,java.lang.String> methodMappings, UnpickV2Reader.Visitor delegate)Creates a newUnpickV2Remapper.- Parameters:
classMappings- a mapping of old class names to new class names.methodMappings- a mapping of old method names, owner classes, and descriptors; to new method names.delegate- the visitor that should visit the remapped target method definitions. All other visitor methods only delegate to the delegate visitor.
-
UnpickV2Remapper
public UnpickV2Remapper(java.util.Map<java.lang.String,java.lang.String> classMappings, java.util.Map<MethodKey,java.lang.String> methodMappings, java.util.Map<FieldKey,java.lang.String> fieldMappings, UnpickV2Reader.Visitor delegate)Creates a newUnpickV2Remapper.- Parameters:
classMappings- a mapping of old class names to new class names.methodMappings- a mapping of old method names, owner classes, and descriptors; to new method names.fieldMappings- a mapping of old field names and owner classes to new field names.delegate- the visitor that should visit the remapped target method definitions. All other visitor methods only delegate to the delegate visitor.
-
-
Method Details
-
visitTargetMethodDefinition
public UnpickV2Reader.TargetMethodDefinitionVisitor visitTargetMethodDefinition(java.lang.String owner, java.lang.String name, java.lang.String descriptor)Description copied from interface:UnpickV2Reader.VisitorVisits a target method definition (start tokentarget_method).- Specified by:
visitTargetMethodDefinitionin interfaceUnpickV2Reader.Visitor- Parameters:
owner- the internal name of the method's owner class.name- the method's Java identifier.descriptor- the method's descriptor.- Returns:
- an instance of
TargetMethodDefinitionVisitorthat should visit the parameter and return groups of the target method definition, or null if they should not be visited.
-
startVisit
public void startVisit()Description copied from interface:UnpickV2Reader.VisitorVisits the start of the file. This is the first method called.- Specified by:
startVisitin interfaceUnpickV2Reader.Visitor
-
visitLineNumber
public void visitLineNumber(int lineNumber)Description copied from interface:UnpickV2Reader.VisitorVisits the line number.- Specified by:
visitLineNumberin interfaceUnpickV2Reader.Visitor- Parameters:
lineNumber- the number of the line that is about to be visited.
-
visitSimpleConstantDefinition
public void visitSimpleConstantDefinition(java.lang.String group, java.lang.String owner, java.lang.String name, java.lang.String value, java.lang.String descriptor)Description copied from interface:UnpickV2Reader.VisitorVisits a simple constant definition (start tokenconstant).
valueanddescriptorwill either both have a value or both be null.- Specified by:
visitSimpleConstantDefinitionin interfaceUnpickV2Reader.Visitor- Parameters:
group- the id of the constant's constant group.owner- the internal name of the constant's owner class.name- the constant's Java identifier.value- the constant's value as aString, or null if it is not specified (will be resolved at runtime).descriptor- the constant's descriptor, or null if it is not specified (will be resolved at runtime).
-
visitFlagConstantDefinition
public void visitFlagConstantDefinition(java.lang.String group, java.lang.String owner, java.lang.String name, java.lang.String value, java.lang.String descriptor)Description copied from interface:UnpickV2Reader.VisitorVisits a flag constant definition (start tokenflag).
valueanddescriptorwill either both have a value or both be null.- Specified by:
visitFlagConstantDefinitionin interfaceUnpickV2Reader.Visitor- Parameters:
group- the id of the constant's constant group.owner- the internal name of the constant's owner class.name- the constant's Java identifier.value- the constant's value as aString, or null if it is not specified (will be resolved at runtime).descriptor- the constant's descriptor, or null if it is not specified (will be resolved at runtime).
-
endVisit
public void endVisit()Description copied from interface:UnpickV2Reader.VisitorVisits the end of the file. This is the last method called.- Specified by:
endVisitin interfaceUnpickV2Reader.Visitor
-