proguard.classfile.util.renderer.MemberViewModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proguard-core Show documentation
Show all versions of proguard-core Show documentation
ProGuardCORE is a free library to read, analyze, modify, and write Java class files.
package proguard.classfile.util.renderer;
import proguard.classfile.Clazz;
import proguard.classfile.Member;
import proguard.classfile.constant.Constant;
/**
* This utility class serves as a base class for {@link FieldViewModel} and {@link MethodViewModel}.
* It keeps track of the Member to be rendered and its associated Clazz.
*
* @author Kymeng Tang
*/
public abstract class MemberViewModel extends ProcessableViewModel {
protected Pair model;
protected Object processingInfo;
/**
* A utility class for keeping track of pairs, e.g.{@link Clazz} and {@link Member}
*
* @param A generic class.
* @param Another generic class.
*/
public static class Pair {
public K key;
public V value;
public Pair(K key, V value) {
this.key = key;
this.value = value;
}
}
/**
* A constructor to keep track of the {@link Member} object to be rendered and its associated
* {@link Clazz}
*
* @param clazz The {@link Clazz} that the {@link Constant} entry belongs to.
* @param member The {@link Member} object to be rendered.
*/
protected MemberViewModel(Clazz clazz, Member member) {
this.model = new Pair<>(clazz, member);
this.processingFlags = renderProcessingFlags(member.getProcessingFlags());
this.processingInfo = member.getProcessingInfo();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy