|
49 | 49 | import org.jibx.runtime.impl.StAXReaderWrapper;
|
50 | 50 | import org.jibx.runtime.impl.StAXWriter;
|
51 | 51 | import org.jibx.runtime.impl.UnmarshallingContext;
|
| 52 | +import org.w3c.dom.Node; |
| 53 | +import org.xml.sax.ContentHandler; |
| 54 | +import org.xml.sax.InputSource; |
| 55 | +import org.xml.sax.XMLReader; |
| 56 | +import org.xml.sax.ext.LexicalHandler; |
| 57 | + |
52 | 58 | import org.springframework.beans.factory.InitializingBean;
|
53 | 59 | import org.springframework.oxm.AbstractMarshaller;
|
54 | 60 | import org.springframework.oxm.XmlMappingException;
|
55 | 61 | import org.springframework.util.Assert;
|
56 | 62 | import org.springframework.util.StringUtils;
|
57 | 63 | import org.springframework.xml.stream.StaxEventContentHandler;
|
58 | 64 | import org.springframework.xml.stream.XmlEventStreamReader;
|
59 |
| -import org.w3c.dom.Node; |
60 |
| -import org.xml.sax.ContentHandler; |
61 |
| -import org.xml.sax.InputSource; |
62 |
| -import org.xml.sax.XMLReader; |
63 |
| -import org.xml.sax.ext.LexicalHandler; |
64 | 65 |
|
65 | 66 | /**
|
66 | 67 | * Implementation of the <code>Marshaller</code> and <code>Unmarshaller</code> interfaces for JiBX.
|
@@ -138,7 +139,15 @@ public void afterPropertiesSet() throws Exception {
|
138 | 139 | }
|
139 | 140 |
|
140 | 141 | public boolean supports(Class clazz) {
|
141 |
| - return targetClass.isAssignableFrom(clazz); |
| 142 | + Assert.notNull(clazz, "'clazz' must not be null"); |
| 143 | + String[] mappedClasses = bindingFactory.getMappedClasses(); |
| 144 | + String className = clazz.getName(); |
| 145 | + for (int i = 0; i < mappedClasses.length; i++) { |
| 146 | + if (className.equals(mappedClasses[i])) { |
| 147 | + return true; |
| 148 | + } |
| 149 | + } |
| 150 | + return false; |
142 | 151 | }
|
143 | 152 |
|
144 | 153 | /**
|
|
0 commit comments