Package cpw.mods.modlauncher
Class VotingContext
java.lang.Object
cpw.mods.modlauncher.VotingContext
- All Implemented Interfaces:
ITransformerVotingContext
The internal vote context structure.
-
Nested Class Summary
Nested classes/interfaces inherited from interface cpw.mods.modlauncher.api.ITransformerVotingContext
ITransformerVotingContext.ClassPredicate, ITransformerVotingContext.FieldPredicate, ITransformerVotingContext.InsnPredicate, ITransformerVotingContext.MethodPredicate -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVotingContext(String className, boolean classExists, Supplier<byte[]> sha256sum, List<ITransformerActivity> activities, String reason) -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyClassPredicate(ITransformerVotingContext.ClassPredicate classPredicate) Return the result of applying the supplied class predicate to the current class node.booleanapplyFieldPredicate(ITransformerVotingContext.FieldPredicate fieldPredicate) Return the result of applying the supplied field predicate to the current field node.booleanapplyInstructionPredicate(ITransformerVotingContext.InsnPredicate insnPredicate) Return the result of applying the supplied instruction predicate to the current method node.booleanapplyMethodPredicate(ITransformerVotingContext.MethodPredicate methodPredicate) Return the result of applying the supplied method predicate to the current method node.booleanbyte[](package private) <T> voidsetNode(T node) private Object[]toObjectArray(org.objectweb.asm.tree.AbstractInsnNode insnNode)
-
Field Details
-
EMPTY
-
className
-
classExists
private final boolean classExists -
sha256
-
auditActivities
-
reason
-
node
-
-
Constructor Details
-
VotingContext
VotingContext(String className, boolean classExists, Supplier<byte[]> sha256sum, List<ITransformerActivity> activities, String reason)
-
-
Method Details
-
getClassName
- Specified by:
getClassNamein interfaceITransformerVotingContext- Returns:
- The class name being transformed
-
doesClassExist
public boolean doesClassExist()- Specified by:
doesClassExistin interfaceITransformerVotingContext- Returns:
- If the class already existed
-
getInitialClassSha256
public byte[] getInitialClassSha256()- Specified by:
getInitialClassSha256in interfaceITransformerVotingContext- Returns:
- The initial sha256 checksum of the class bytes.
-
getAuditActivities
- Specified by:
getAuditActivitiesin interfaceITransformerVotingContext- Returns:
- The activities already performed on this class. This list is read only, but will change as activities happen.
-
getReason
- Specified by:
getReasonin interfaceITransformerVotingContext
-
setNode
<T> void setNode(T node) -
applyFieldPredicate
Description copied from interface:ITransformerVotingContextReturn the result of applying the supplied field predicate to the current field node. Can only be used on a Field target.- Specified by:
applyFieldPredicatein interfaceITransformerVotingContext- Parameters:
fieldPredicate- The field predicate- Returns:
- true if the predicate passed
-
applyMethodPredicate
Description copied from interface:ITransformerVotingContextReturn the result of applying the supplied method predicate to the current method node. Can only be used on a Method target.- Specified by:
applyMethodPredicatein interfaceITransformerVotingContext- Parameters:
methodPredicate- The method predicate- Returns:
- true if the predicate passed
-
applyClassPredicate
Description copied from interface:ITransformerVotingContextReturn the result of applying the supplied class predicate to the current class node. Can only be used on a Class target.- Specified by:
applyClassPredicatein interfaceITransformerVotingContext- Parameters:
classPredicate- The class predicate- Returns:
- true if the predicate passed
-
applyInstructionPredicate
Description copied from interface:ITransformerVotingContextReturn the result of applying the supplied instruction predicate to the current method node. Can only be used on a Method target.- Specified by:
applyInstructionPredicatein interfaceITransformerVotingContext- Parameters:
insnPredicate- The insn predicate- Returns:
- true if the predicate passed
-
toObjectArray
-