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 TypeMethodDescriptionboolean
applyClassPredicate
(ITransformerVotingContext.ClassPredicate classPredicate) Return the result of applying the supplied class predicate to the current class node.boolean
applyFieldPredicate
(ITransformerVotingContext.FieldPredicate fieldPredicate) Return the result of applying the supplied field predicate to the current field node.boolean
applyInstructionPredicate
(ITransformerVotingContext.InsnPredicate insnPredicate) Return the result of applying the supplied instruction predicate to the current method node.boolean
applyMethodPredicate
(ITransformerVotingContext.MethodPredicate methodPredicate) Return the result of applying the supplied method predicate to the current method node.boolean
byte[]
(package private) <T> void
setNode
(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:
getClassName
in interfaceITransformerVotingContext
- Returns:
- The class name being transformed
-
doesClassExist
public boolean doesClassExist()- Specified by:
doesClassExist
in interfaceITransformerVotingContext
- Returns:
- If the class already existed
-
getInitialClassSha256
public byte[] getInitialClassSha256()- Specified by:
getInitialClassSha256
in interfaceITransformerVotingContext
- Returns:
- The initial sha256 checksum of the class bytes.
-
getAuditActivities
- Specified by:
getAuditActivities
in interfaceITransformerVotingContext
- Returns:
- The activities already performed on this class. This list is read only, but will change as activities happen.
-
getReason
- Specified by:
getReason
in interfaceITransformerVotingContext
-
setNode
<T> void setNode(T node) -
applyFieldPredicate
Description copied from interface:ITransformerVotingContext
Return the result of applying the supplied field predicate to the current field node. Can only be used on a Field target.- Specified by:
applyFieldPredicate
in interfaceITransformerVotingContext
- Parameters:
fieldPredicate
- The field predicate- Returns:
- true if the predicate passed
-
applyMethodPredicate
Description copied from interface:ITransformerVotingContext
Return the result of applying the supplied method predicate to the current method node. Can only be used on a Method target.- Specified by:
applyMethodPredicate
in interfaceITransformerVotingContext
- Parameters:
methodPredicate
- The method predicate- Returns:
- true if the predicate passed
-
applyClassPredicate
Description copied from interface:ITransformerVotingContext
Return the result of applying the supplied class predicate to the current class node. Can only be used on a Class target.- Specified by:
applyClassPredicate
in interfaceITransformerVotingContext
- Parameters:
classPredicate
- The class predicate- Returns:
- true if the predicate passed
-
applyInstructionPredicate
Description copied from interface:ITransformerVotingContext
Return the result of applying the supplied instruction predicate to the current method node. Can only be used on a Method target.- Specified by:
applyInstructionPredicate
in interfaceITransformerVotingContext
- Parameters:
insnPredicate
- The insn predicate- Returns:
- true if the predicate passed
-
toObjectArray
-