01: package com.xoetrope.builder.generic;
02:
03: import java.util.ArrayList;
04: import java.util.Properties;
05:
06: /**
07: * An instruction store
08: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
09: * the GNU Public License (GPL), please see license.txt for more details. If
10: * you make commercial use of this software you must purchase a commercial
11: * license from Xoetrope.</p>
12: */
13: public class XInstructionMapping {
14: // Package scope variables
15: String id;
16: String typeName;
17:
18: ArrayList instructions;
19: private XInstructionProcessor processor;
20:
21: /**
22: * Creates a new instance of XInstructionMapping
23: * @param identifier the file format attribute used to identify the component type
24: */
25: public XInstructionMapping(String identifier) {
26: id = identifier;
27:
28: instructions = new ArrayList();
29: }
30:
31: /**
32: * Add an instruction
33: * @param instruction the instruction
34: */
35: public void addInstruction(Properties instruction) {
36: instructions.add(instruction);
37: }
38:
39: /**
40: * Get the instruction processor
41: * @return the processor or null if none has been set or if the builder provides
42: * the required methods
43: */
44: public XInstructionProcessor getProcessor() {
45: return processor;
46: }
47:
48: /**
49: * Set the custom builder.
50: * @param p
51: */
52: public void setProcessor(XInstructionProcessor p) {
53: processor = p;
54: }
55: }
|