summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/mapping/ProcyonEntryFactory.java
diff options
context:
space:
mode:
authorGravatar lclc982016-06-30 00:49:21 +1000
committerGravatar GitHub2016-06-30 00:49:21 +1000
commit4be005617b3b8c3578cca07c5d085d12916f0d1d (patch)
treedb163431f38703e26da417ef05eaea2b27a498b9 /src/cuchaz/enigma/mapping/ProcyonEntryFactory.java
parentSome small changes to fix idea importing (diff)
downloadenigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.tar.gz
enigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.tar.xz
enigma-fork-4be005617b3b8c3578cca07c5d085d12916f0d1d.zip
Json format (#2)
* Added new format * Fixed bug * Updated Version
Diffstat (limited to 'src/cuchaz/enigma/mapping/ProcyonEntryFactory.java')
-rw-r--r--src/cuchaz/enigma/mapping/ProcyonEntryFactory.java55
1 files changed, 0 insertions, 55 deletions
diff --git a/src/cuchaz/enigma/mapping/ProcyonEntryFactory.java b/src/cuchaz/enigma/mapping/ProcyonEntryFactory.java
deleted file mode 100644
index 777a12e..0000000
--- a/src/cuchaz/enigma/mapping/ProcyonEntryFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
1/*******************************************************************************
2 * Copyright (c) 2015 Jeff Martin.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser General Public
5 * License v3.0 which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/lgpl.html
7 *
8 * Contributors:
9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/
11package cuchaz.enigma.mapping;
12
13import com.strobel.assembler.metadata.FieldDefinition;
14import com.strobel.assembler.metadata.MethodDefinition;
15
16
17public class ProcyonEntryFactory {
18
19 public static FieldEntry getFieldEntry(FieldDefinition def) {
20 return new FieldEntry(
21 new ClassEntry(def.getDeclaringType().getInternalName()),
22 def.getName(),
23 new Type(def.getErasedSignature())
24 );
25 }
26
27 public static MethodEntry getMethodEntry(MethodDefinition def) {
28 return new MethodEntry(
29 new ClassEntry(def.getDeclaringType().getInternalName()),
30 def.getName(),
31 new Signature(def.getErasedSignature())
32 );
33 }
34
35 public static ConstructorEntry getConstructorEntry(MethodDefinition def) {
36 if (def.isTypeInitializer()) {
37 return new ConstructorEntry(
38 new ClassEntry(def.getDeclaringType().getInternalName())
39 );
40 } else {
41 return new ConstructorEntry(
42 new ClassEntry(def.getDeclaringType().getInternalName()),
43 new Signature(def.getErasedSignature())
44 );
45 }
46 }
47
48 public static BehaviorEntry getBehaviorEntry(MethodDefinition def) {
49 if (def.isConstructor() || def.isTypeInitializer()) {
50 return getConstructorEntry(def);
51 } else {
52 return getMethodEntry(def);
53 }
54 }
55}