summaryrefslogtreecommitdiff
path: root/test/cuchaz/enigma/EntryFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/cuchaz/enigma/EntryFactory.java')
-rw-r--r--test/cuchaz/enigma/EntryFactory.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/cuchaz/enigma/EntryFactory.java b/test/cuchaz/enigma/EntryFactory.java
new file mode 100644
index 0000000..b275719
--- /dev/null
+++ b/test/cuchaz/enigma/EntryFactory.java
@@ -0,0 +1,52 @@
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 ******************************************************************************/
12package cuchaz.enigma;
13
14import cuchaz.enigma.analysis.EntryReference;
15import cuchaz.enigma.mapping.BehaviorEntry;
16import cuchaz.enigma.mapping.ClassEntry;
17import cuchaz.enigma.mapping.ConstructorEntry;
18import cuchaz.enigma.mapping.FieldEntry;
19import cuchaz.enigma.mapping.MethodEntry;
20
21public class EntryFactory
22{
23 public static ClassEntry newClass( String name )
24 {
25 return new ClassEntry( name );
26 }
27
28 public static FieldEntry newField( String className, String fieldName )
29 {
30 return new FieldEntry( newClass( className ), fieldName );
31 }
32
33 public static MethodEntry newMethod( String className, String methodName, String methodSignature )
34 {
35 return new MethodEntry( newClass( className ), methodName, methodSignature );
36 }
37
38 public static ConstructorEntry newConstructor( String className, String signature )
39 {
40 return new ConstructorEntry( newClass( className ), signature );
41 }
42
43 public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByMethod( String fieldClassName, String fieldName, String callerClassName, String callerName, String callerSignature )
44 {
45 return new EntryReference<FieldEntry,BehaviorEntry>( newField( fieldClassName, fieldName ), newMethod( callerClassName, callerName, callerSignature ) );
46 }
47
48 public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByConstructor( String fieldClassName, String fieldName, String callerClassName, String callerSignature )
49 {
50 return new EntryReference<FieldEntry,BehaviorEntry>( newField( fieldClassName, fieldName ), newConstructor( callerClassName, callerSignature ) );
51 }
52}