1
2
3
4
5
6
7
8
9
10
11 package com.legstar.coxb.impl.reflect;
12
13 import com.legstar.coxb.CobolBindingException;
14 import com.legstar.coxb.ICobolComplexBinding;
15 import com.legstar.coxb.transform.AbstractJavaToHostTransformer;
16 import com.legstar.coxb.util.JAXBAnnotationException;
17 import com.legstar.coxb.util.JAXBElementDescriptor;
18
19
20
21
22
23
24
25 public class ReflectJavaToHostTransformer extends AbstractJavaToHostTransformer {
26
27
28
29
30 private JAXBElementDescriptor _jaxbElementDescriptor;
31
32
33
34
35
36
37
38
39
40
41 public ReflectJavaToHostTransformer(
42 final String jaxbPackageName,
43 final String jaxbType) throws ReflectBindingException {
44 try {
45 _jaxbElementDescriptor = new JAXBElementDescriptor(jaxbPackageName,
46 jaxbType);
47 } catch (JAXBAnnotationException e) {
48 throw new ReflectBindingException(e);
49 }
50 }
51
52
53 public ICobolComplexBinding getBinding() throws CobolBindingException {
54 try {
55 CComplexReflectBinding ccem = new CComplexReflectBinding(
56 getObjectFactory(), getJaxbClass());
57 return ccem;
58 } catch (ReflectBindingException e) {
59 throw new CobolBindingException(e);
60 }
61 }
62
63
64
65
66 public Object getObjectFactory() {
67 return _jaxbElementDescriptor.getObjectFactory();
68 }
69
70
71
72
73 public Class < ? > getJaxbClass() {
74 return _jaxbElementDescriptor.getJaxbClass();
75 }
76
77
78
79
80 public JAXBElementDescriptor getJaxbElementDescriptor() {
81 return _jaxbElementDescriptor;
82 }
83 }