diff options
| author | 2015-02-03 22:00:53 -0500 | |
|---|---|---|
| committer | 2015-02-03 22:00:53 -0500 | |
| commit | 52ab426d8fad3dbee7e728f523a35af94facebda (patch) | |
| tree | 146fadfd8e639a909d6c1d6a193e7eddeab0be4a /test/cuchaz/enigma/EntryFactory.java | |
| download | enigma-fork-52ab426d8fad3dbee7e728f523a35af94facebda.tar.gz enigma-fork-52ab426d8fad3dbee7e728f523a35af94facebda.tar.xz enigma-fork-52ab426d8fad3dbee7e728f523a35af94facebda.zip | |
oops, don't depend on local procyon project
Diffstat (limited to 'test/cuchaz/enigma/EntryFactory.java')
| -rw-r--r-- | test/cuchaz/enigma/EntryFactory.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/cuchaz/enigma/EntryFactory.java b/test/cuchaz/enigma/EntryFactory.java new file mode 100644 index 0000000..d9317ef --- /dev/null +++ b/test/cuchaz/enigma/EntryFactory.java | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2014 Jeff Martin.\ | ||
| 3 | * | ||
| 4 | * All rights reserved. This program and the accompanying materials | ||
| 5 | * are made available under the terms of the GNU Public License v3.0 | ||
| 6 | * which accompanies this distribution, and is available at | ||
| 7 | * http://www.gnu.org/licenses/gpl.html | ||
| 8 | * | ||
| 9 | * Contributors: | ||
| 10 | * Jeff Martin - initial API and implementation | ||
| 11 | ******************************************************************************/ | ||
| 12 | package cuchaz.enigma; | ||
| 13 | |||
| 14 | import cuchaz.enigma.analysis.EntryReference; | ||
| 15 | import cuchaz.enigma.mapping.BehaviorEntry; | ||
| 16 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 17 | import cuchaz.enigma.mapping.ConstructorEntry; | ||
| 18 | import cuchaz.enigma.mapping.FieldEntry; | ||
| 19 | import cuchaz.enigma.mapping.MethodEntry; | ||
| 20 | |||
| 21 | public class EntryFactory { | ||
| 22 | |||
| 23 | public static ClassEntry newClass(String name) { | ||
| 24 | return new ClassEntry(name); | ||
| 25 | } | ||
| 26 | |||
| 27 | public static FieldEntry newField(String className, String fieldName) { | ||
| 28 | return new FieldEntry(newClass(className), fieldName); | ||
| 29 | } | ||
| 30 | |||
| 31 | public static MethodEntry newMethod(String className, String methodName, String methodSignature) { | ||
| 32 | return new MethodEntry(newClass(className), methodName, methodSignature); | ||
| 33 | } | ||
| 34 | |||
| 35 | public static ConstructorEntry newConstructor(String className, String signature) { | ||
| 36 | return new ConstructorEntry(newClass(className), signature); | ||
| 37 | } | ||
| 38 | |||
| 39 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByMethod(FieldEntry fieldEntry, String callerClassName, String callerName, String callerSignature) { | ||
| 40 | return new EntryReference<FieldEntry,BehaviorEntry>(fieldEntry, "", newMethod(callerClassName, callerName, callerSignature)); | ||
| 41 | } | ||
| 42 | |||
| 43 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByConstructor(FieldEntry fieldEntry, String callerClassName, String callerSignature) { | ||
| 44 | return new EntryReference<FieldEntry,BehaviorEntry>(fieldEntry, "", newConstructor(callerClassName, callerSignature)); | ||
| 45 | } | ||
| 46 | |||
| 47 | public static EntryReference<BehaviorEntry,BehaviorEntry> newBehaviorReferenceByMethod(BehaviorEntry behaviorEntry, String callerClassName, String callerName, String callerSignature) { | ||
| 48 | return new EntryReference<BehaviorEntry,BehaviorEntry>(behaviorEntry, "", newMethod(callerClassName, callerName, callerSignature)); | ||
| 49 | } | ||
| 50 | |||
| 51 | public static EntryReference<BehaviorEntry,BehaviorEntry> newBehaviorReferenceByConstructor(BehaviorEntry behaviorEntry, String callerClassName, String callerSignature) { | ||
| 52 | return new EntryReference<BehaviorEntry,BehaviorEntry>(behaviorEntry, "", newConstructor(callerClassName, callerSignature)); | ||
| 53 | } | ||
| 54 | } | ||