IHandlerListDecorator.java
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader.core.event;
import java.util.List;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import com.mumfrey.liteloader.core.event.HandlerList.BakedHandlerList;
import com.mumfrey.liteloader.core.runtime.Obf;
/**
* Essentially a "mini plugin" for HandlerListClassLoader which allows
* alterations of the generated bytecode.
*
* @author Adam Mummery-Smith
*
* @param <T>
*/
public interface IHandlerListDecorator<T>
{
/**
* Get the template class name
*/
public abstract Obf getTemplate();
/**
* Prepare the decorator to accept the specified list of invokees
*/
public abstract void prepare(List<T> sortedList);
/**
* Create an instance of the handler class
*/
public abstract BakedHandlerList<T> createInstance(Class<BakedHandlerList<T>> handlerClass) throws Exception;
/**
* Called when populating the classNode
*/
public abstract void populateClass(String name, ClassNode classNode);
/**
* Called when processing the ctor
*/
public abstract void processCtor(ClassNode classNode, MethodNode method);
/**
* Called immediately before the interface method invocation bytecode is
* injected.
*/
public abstract void preInvokeInterfaceMethod(int handlerIndex, ClassNode classNode, MethodNode method, Type[] args);
/**
* Called immediately after the interface method invocation bytecode is
* injected.
*/
public abstract void postInvokeInterfaceMethod(int handlerIndex, ClassNode classNode, MethodNode method, Type[] args);
/**
* Called at the end of populateInterfaceMethod
*/
public abstract void populateInterfaceMethod(ClassNode classNode, MethodNode method);
}