01: /*
02: * User: Michael Rettig
03: * Date: Sep 15, 2002
04: * Time: 9:52:39 PM
05: */
06: package net.sourceforge.jaxor.parser;
07:
08: import net.sourceforge.jaxor.util.ObjectUtils;
09:
10: public class Param {
11: private String _name;
12: private String _type;
13: private String _mapper;
14:
15: public Param() {
16: }
17:
18: public Param(Attribute attribute, Jaxor j) {
19: _name = attribute.getName();
20: _type = attribute.getType();
21: _mapper = attribute.getMapperName(j);
22: }
23:
24: public String getName() {
25: return _name;
26: }
27:
28: public void setMapper(String mapper) {
29: _mapper = mapper;
30: }
31:
32: public String getType() {
33: return _type;
34: }
35:
36: public void setName(String name) {
37: _name = name;
38: }
39:
40: public void setType(String type) {
41: _type = type;
42: }
43:
44: public String getMapperParameter(Jaxor jaxor) {
45: if (ObjectUtils.isPrimitive(getType()))
46: return "";
47: else
48: return "new " + getMapperName(jaxor) + "(),";
49: }
50:
51: public String getMapperName(Jaxor jaxor) {
52: if (_mapper != null)
53: return _mapper;
54: return jaxor.getMapperName(getType());
55: }
56: }
|