diff options
| author | 2015-03-11 11:03:16 -0400 | |
|---|---|---|
| committer | 2015-03-11 11:03:16 -0400 | |
| commit | e33b4003a5c423894e7aef575faff359dd1d33b1 (patch) | |
| tree | 6fa674b5ff8dbc699a44b6423149ad7e6eaae250 /src/cuchaz/enigma/mapping/EntryFactory.java | |
| parent | nothing of consequence (diff) | |
| download | enigma-fork-e33b4003a5c423894e7aef575faff359dd1d33b1.tar.gz enigma-fork-e33b4003a5c423894e7aef575faff359dd1d33b1.tar.xz enigma-fork-e33b4003a5c423894e7aef575faff359dd1d33b1.zip | |
generalized field matching
added method matching
Diffstat (limited to 'src/cuchaz/enigma/mapping/EntryFactory.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/EntryFactory.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cuchaz/enigma/mapping/EntryFactory.java b/src/cuchaz/enigma/mapping/EntryFactory.java index 333bb09..7bc6183 100644 --- a/src/cuchaz/enigma/mapping/EntryFactory.java +++ b/src/cuchaz/enigma/mapping/EntryFactory.java | |||
| @@ -138,6 +138,10 @@ public class EntryFactory { | |||
| 138 | public static BehaviorEntry getBehaviorEntry(String className, String behaviorName, String behaviorSignature) { | 138 | public static BehaviorEntry getBehaviorEntry(String className, String behaviorName, String behaviorSignature) { |
| 139 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); | 139 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); |
| 140 | } | 140 | } |
| 141 | |||
| 142 | public static BehaviorEntry getBehaviorEntry(String className, String behaviorName) { | ||
| 143 | return getBehaviorEntry(new ClassEntry(className), behaviorName); | ||
| 144 | } | ||
| 141 | 145 | ||
| 142 | public static BehaviorEntry getBehaviorEntry(ClassEntry classEntry, String behaviorName, Signature behaviorSignature) { | 146 | public static BehaviorEntry getBehaviorEntry(ClassEntry classEntry, String behaviorName, Signature behaviorSignature) { |
| 143 | if (behaviorName.equals("<init>")) { | 147 | if (behaviorName.equals("<init>")) { |
| @@ -149,6 +153,14 @@ public class EntryFactory { | |||
| 149 | } | 153 | } |
| 150 | } | 154 | } |
| 151 | 155 | ||
| 156 | public static BehaviorEntry getBehaviorEntry(ClassEntry classEntry, String behaviorName) { | ||
| 157 | if(behaviorName.equals("<clinit>")) { | ||
| 158 | return new ConstructorEntry(classEntry); | ||
| 159 | } else { | ||
| 160 | throw new IllegalArgumentException("Only class initializers don't have signatures"); | ||
| 161 | } | ||
| 162 | } | ||
| 163 | |||
| 152 | public static BehaviorEntry getBehaviorEntry(MethodDefinition def) { | 164 | public static BehaviorEntry getBehaviorEntry(MethodDefinition def) { |
| 153 | if (def.isConstructor() || def.isTypeInitializer()) { | 165 | if (def.isConstructor() || def.isTypeInitializer()) { |
| 154 | return getConstructorEntry(def); | 166 | return getConstructorEntry(def); |