01: /*
02: * Created on Jun 2, 2004
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package org.xdev.base.core.compiler.instruction;
08:
09: import java.util.HashMap;
10:
11: import org.jdom.Element;
12:
13: /**
14: * @author AYegorov
15: *
16: * TODO To change the template for this generated type comment go to
17: * Window - Preferences - Java - Code Style - Code Templates
18: */
19: public abstract class AbstractPropertyInstruction extends
20: AbstractDynamicInstruction {
21:
22: /**
23: * @param id
24: * @param properties
25: */
26: public AbstractPropertyInstruction(String id, HashMap properties) {
27: super (id, properties);
28: // TODO Auto-generated constructor stub
29: }
30:
31: /* (non-Javadoc)
32: * @see org.xdev.base.core.compiler.instruction.AbstractDynamicInstruction#matchClass(org.jdom.Element)
33: */
34: protected Class matchClass(Object elm) throws Exception {
35:
36: Class cls = null;
37:
38: if (this .hasMatched(elm)) {
39:
40: cls = this .getClassProperty("type-class");
41:
42: }
43:
44: return cls;
45: }
46:
47: protected abstract boolean hasMatched(Object elm) throws Exception;
48:
49: /* (non-Javadoc)
50: * @see org.xdev.base.core.compiler.instruction.AbstractInstruction#getType(org.jdom.Element)
51: */
52: protected Class getType(Object elm) {
53: return this .getClassProperty("element-class");
54: }
55:
56: }
|