Added @Override
This commit is contained in:
parent
03582973d7
commit
6ba9ad8116
|
|
@ -264,10 +264,12 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
// Marshalling
|
// Marshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
protected final void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
||||||
marshalSaxHandlers(graph, new DomContentHandler(node), null);
|
marshalSaxHandlers(graph, new DomContentHandler(node), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
protected final void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
||||||
throws XmlMappingException {
|
throws XmlMappingException {
|
||||||
Marshaller marshaller = xmlContext.createMarshaller();
|
Marshaller marshaller = xmlContext.createMarshaller();
|
||||||
|
|
@ -275,21 +277,25 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
marshal(graph, marshaller);
|
marshal(graph, marshaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalOutputStream(Object graph, OutputStream outputStream)
|
protected final void marshalOutputStream(Object graph, OutputStream outputStream)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
marshalWriter(graph, new OutputStreamWriter(outputStream, encoding));
|
marshalWriter(graph, new OutputStreamWriter(outputStream, encoding));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
protected final void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
||||||
Marshaller marshaller = xmlContext.createMarshaller();
|
Marshaller marshaller = xmlContext.createMarshaller();
|
||||||
marshaller.setWriter(writer);
|
marshaller.setWriter(writer);
|
||||||
marshal(graph, marshaller);
|
marshal(graph, marshaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException {
|
protected final void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException {
|
||||||
marshalSaxHandlers(graph, new StaxEventContentHandler(eventWriter), null);
|
marshalSaxHandlers(graph, new StaxEventContentHandler(eventWriter), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
protected final void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
||||||
marshalSaxHandlers(graph, new StaxStreamContentHandler(streamWriter), null);
|
marshalSaxHandlers(graph, new StaxStreamContentHandler(streamWriter), null);
|
||||||
}
|
}
|
||||||
|
|
@ -327,6 +333,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
// Unmarshalling
|
// Unmarshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
|
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
return createUnmarshaller().unmarshal(node);
|
return createUnmarshaller().unmarshal(node);
|
||||||
|
|
@ -336,6 +343,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
protected final Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
return createUnmarshaller().unmarshal(new InputSource(inputStream));
|
return createUnmarshaller().unmarshal(new InputSource(inputStream));
|
||||||
|
|
@ -345,6 +353,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
protected final Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
return createUnmarshaller().unmarshal(new InputSource(reader));
|
return createUnmarshaller().unmarshal(new InputSource(reader));
|
||||||
|
|
@ -354,6 +363,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalXmlEventReader(XMLEventReader eventReader) {
|
protected final Object unmarshalXmlEventReader(XMLEventReader eventReader) {
|
||||||
XMLReader reader = new StaxEventXmlReader(eventReader);
|
XMLReader reader = new StaxEventXmlReader(eventReader);
|
||||||
try {
|
try {
|
||||||
|
|
@ -364,6 +374,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
protected final Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
UnmarshalHandler unmarshalHandler = createUnmarshaller().createHandler();
|
UnmarshalHandler unmarshalHandler = createUnmarshaller().createHandler();
|
||||||
|
|
@ -378,6 +389,7 @@ public class CastorMarshaller extends AbstractMarshaller implements Initializing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader) {
|
protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader) {
|
||||||
XMLReader reader = new StaxStreamXmlReader(streamReader);
|
XMLReader reader = new StaxStreamXmlReader(streamReader);
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ class Jaxb1MarshallerBeanDefinitionParser extends AbstractSimpleBeanDefinitionPa
|
||||||
|
|
||||||
public static final String JAXB1_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jaxb.Jaxb1Marshaller";
|
public static final String JAXB1_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jaxb.Jaxb1Marshaller";
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBeanClassName(Element element) {
|
protected String getBeanClassName(Element element) {
|
||||||
return JAXB1_MARSHALLER_CLASS_NAME;
|
return JAXB1_MARSHALLER_CLASS_NAME;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,12 @@ class Jaxb2MarshallerBeanDefinitionParser extends AbstractSingleBeanDefinitionPa
|
||||||
|
|
||||||
private static final String JAXB2_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jaxb.Jaxb2Marshaller";
|
private static final String JAXB2_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jaxb.Jaxb2Marshaller";
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBeanClassName(Element element) {
|
protected String getBeanClassName(Element element) {
|
||||||
return JAXB2_MARSHALLER_CLASS_NAME;
|
return JAXB2_MARSHALLER_CLASS_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
|
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
|
||||||
String contextPath = element.getAttribute("contextPath");
|
String contextPath = element.getAttribute("contextPath");
|
||||||
if (StringUtils.hasText(contextPath)) {
|
if (StringUtils.hasText(contextPath)) {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ class JibxMarshallerBeanDefinitionParser extends AbstractSimpleBeanDefinitionPar
|
||||||
|
|
||||||
private static final String JIBX_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jibx.JibxMarshaller";
|
private static final String JIBX_MARSHALLER_CLASS_NAME = "org.springframework.oxm.jibx.JibxMarshaller";
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBeanClassName(Element element) {
|
protected String getBeanClassName(Element element) {
|
||||||
return JIBX_MARSHALLER_CLASS_NAME;
|
return JIBX_MARSHALLER_CLASS_NAME;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,12 @@ class XmlBeansMarshallerBeanDefinitionParser extends AbstractSingleBeanDefinitio
|
||||||
|
|
||||||
public static final String XML_BEANS_MARSHALLER_CLASS_NAME = "org.springframework.oxm.xmlbeans.XmlBeansMarshaller";
|
public static final String XML_BEANS_MARSHALLER_CLASS_NAME = "org.springframework.oxm.xmlbeans.XmlBeansMarshaller";
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getBeanClassName(Element element) {
|
protected String getBeanClassName(Element element) {
|
||||||
return XML_BEANS_MARSHALLER_CLASS_NAME;
|
return XML_BEANS_MARSHALLER_CLASS_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
|
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
|
||||||
String optionsName = element.getAttribute("options");
|
String optionsName = element.getAttribute("options");
|
||||||
if (StringUtils.hasText(optionsName)) {
|
if (StringUtils.hasText(optionsName)) {
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@ public class Jaxb1Marshaller extends AbstractJaxbMarshaller implements BeanClass
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final JAXBContext createJaxbContext() throws JAXBException {
|
protected final JAXBContext createJaxbContext() throws JAXBException {
|
||||||
if (!StringUtils.hasLength(getContextPath())) {
|
if (!StringUtils.hasLength(getContextPath())) {
|
||||||
throw new IllegalArgumentException("contextPath is required");
|
throw new IllegalArgumentException("contextPath is required");
|
||||||
|
|
@ -95,6 +96,7 @@ public class Jaxb1Marshaller extends AbstractJaxbMarshaller implements BeanClass
|
||||||
JAXBContext.newInstance(getContextPath());
|
JAXBContext.newInstance(getContextPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void initJaxbUnmarshaller(Unmarshaller unmarshaller) throws JAXBException {
|
protected void initJaxbUnmarshaller(Unmarshaller unmarshaller) throws JAXBException {
|
||||||
unmarshaller.setValidating(validating);
|
unmarshaller.setValidating(validating);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -267,6 +267,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
* JAXBContext
|
* JAXBContext
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
protected JAXBContext createJaxbContext() throws Exception {
|
protected JAXBContext createJaxbContext() throws Exception {
|
||||||
if (JaxbUtils.getJaxbVersion() < JaxbUtils.JAXB_2) {
|
if (JaxbUtils.getJaxbVersion() < JaxbUtils.JAXB_2) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
|
|
@ -330,6 +331,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
* Marshaller/Unmarshaller
|
* Marshaller/Unmarshaller
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void initJaxbMarshaller(Marshaller marshaller) throws JAXBException {
|
protected void initJaxbMarshaller(Marshaller marshaller) throws JAXBException {
|
||||||
if (schema != null) {
|
if (schema != null) {
|
||||||
marshaller.setSchema(schema);
|
marshaller.setSchema(schema);
|
||||||
|
|
@ -344,6 +346,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void initJaxbUnmarshaller(Unmarshaller unmarshaller) throws JAXBException {
|
protected void initJaxbUnmarshaller(Unmarshaller unmarshaller) throws JAXBException {
|
||||||
if (schema != null) {
|
if (schema != null) {
|
||||||
unmarshaller.setSchema(schema);
|
unmarshaller.setSchema(schema);
|
||||||
|
|
@ -454,6 +457,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
this.mimeContainer = mimeContainer;
|
this.mimeContainer = mimeContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String addMtomAttachment(byte[] data,
|
public String addMtomAttachment(byte[] data,
|
||||||
int offset,
|
int offset,
|
||||||
int length,
|
int length,
|
||||||
|
|
@ -464,6 +468,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
return addMtomAttachment(new DataHandler(dataSource), elementNamespace, elementLocalName);
|
return addMtomAttachment(new DataHandler(dataSource), elementNamespace, elementLocalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String addMtomAttachment(DataHandler dataHandler, String elementNamespace, String elementLocalName) {
|
public String addMtomAttachment(DataHandler dataHandler, String elementNamespace, String elementLocalName) {
|
||||||
String host = getHost(elementNamespace, dataHandler);
|
String host = getHost(elementNamespace, dataHandler);
|
||||||
String contentId = UUID.randomUUID() + "@" + host;
|
String contentId = UUID.randomUUID() + "@" + host;
|
||||||
|
|
@ -488,6 +493,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
return dataHandler.getName();
|
return dataHandler.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String addSwaRefAttachment(DataHandler dataHandler) {
|
public String addSwaRefAttachment(DataHandler dataHandler) {
|
||||||
String contentId = UUID.randomUUID() + "@" + dataHandler.getName();
|
String contentId = UUID.randomUUID() + "@" + dataHandler.getName();
|
||||||
mimeContainer.addAttachment(contentId, dataHandler);
|
mimeContainer.addAttachment(contentId, dataHandler);
|
||||||
|
|
@ -508,6 +514,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
this.mimeContainer = mimeContainer;
|
this.mimeContainer = mimeContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte[] getAttachmentAsByteArray(String cid) {
|
public byte[] getAttachmentAsByteArray(String cid) {
|
||||||
try {
|
try {
|
||||||
DataHandler dataHandler = getAttachmentAsDataHandler(cid);
|
DataHandler dataHandler = getAttachmentAsDataHandler(cid);
|
||||||
|
|
@ -518,6 +525,7 @@ public class Jaxb2Marshaller extends AbstractJaxbMarshaller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public DataHandler getAttachmentAsDataHandler(String contentId) {
|
public DataHandler getAttachmentAsDataHandler(String contentId) {
|
||||||
if (contentId.startsWith("cid:")) {
|
if (contentId.startsWith("cid:")) {
|
||||||
contentId = contentId.substring("cid:".length());
|
contentId = contentId.substring("cid:".length());
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
// Supported Marshalling
|
// Supported Marshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalOutputStream(Object graph, OutputStream outputStream)
|
protected void marshalOutputStream(Object graph, OutputStream outputStream)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
|
|
@ -184,6 +185,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
IMarshallingContext marshallingContext = createMarshallingContext();
|
IMarshallingContext marshallingContext = createMarshallingContext();
|
||||||
|
|
@ -194,6 +196,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
MarshallingContext marshallingContext = (MarshallingContext) createMarshallingContext();
|
MarshallingContext marshallingContext = (MarshallingContext) createMarshallingContext();
|
||||||
|
|
@ -210,6 +213,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
// Unsupported Marshalling
|
// Unsupported Marshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
// JiBX does not support DOM natively, so we write to a buffer first, and transform that to the Node
|
// JiBX does not support DOM natively, so we write to a buffer first, and transform that to the Node
|
||||||
|
|
@ -227,6 +231,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
||||||
throws XmlMappingException {
|
throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
|
|
@ -247,6 +252,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) {
|
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) {
|
||||||
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
||||||
marshalSaxHandlers(graph, contentHandler, null);
|
marshalSaxHandlers(graph, contentHandler, null);
|
||||||
|
|
@ -256,6 +262,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
// Unmarshalling
|
// Unmarshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
|
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
|
||||||
|
|
@ -266,6 +273,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
|
IUnmarshallingContext unmarshallingContext = createUnmarshallingContext();
|
||||||
|
|
@ -276,6 +284,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) {
|
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) {
|
||||||
try {
|
try {
|
||||||
UnmarshallingContext unmarshallingContext = (UnmarshallingContext) createUnmarshallingContext();
|
UnmarshallingContext unmarshallingContext = (UnmarshallingContext) createUnmarshallingContext();
|
||||||
|
|
@ -288,6 +297,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) {
|
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) {
|
||||||
try {
|
try {
|
||||||
XMLStreamReader streamReader = new XmlEventStreamReader(eventReader);
|
XMLStreamReader streamReader = new XmlEventStreamReader(eventReader);
|
||||||
|
|
@ -302,6 +312,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
// Unsupported Unmarshalling
|
// Unsupported Unmarshalling
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
|
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
Transformer transformer = transformerFactory.newTransformer();
|
Transformer transformer = transformerFactory.newTransformer();
|
||||||
|
|
@ -318,6 +329,7 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
return XmlObject.class.isAssignableFrom(clazz);
|
return XmlObject.class.isAssignableFrom(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
protected final void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
||||||
Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document) node : node.getOwnerDocument();
|
Document document = node.getNodeType() == Node.DOCUMENT_NODE ? (Document) node : node.getOwnerDocument();
|
||||||
Node xmlBeansNode = ((XmlObject) graph).newDomNode(getXmlOptions());
|
Node xmlBeansNode = ((XmlObject) graph).newDomNode(getXmlOptions());
|
||||||
|
|
@ -99,11 +100,13 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalOutputStream(Object graph, OutputStream outputStream)
|
protected final void marshalOutputStream(Object graph, OutputStream outputStream)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
((XmlObject) graph).save(outputStream, getXmlOptions());
|
((XmlObject) graph).save(outputStream, getXmlOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
protected final void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
||||||
throws XmlMappingException {
|
throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
|
|
@ -114,20 +117,24 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
protected final void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
||||||
((XmlObject) graph).save(writer, getXmlOptions());
|
((XmlObject) graph).save(writer, getXmlOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) {
|
protected final void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) {
|
||||||
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
||||||
marshalSaxHandlers(graph, contentHandler, null);
|
marshalSaxHandlers(graph, contentHandler, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
protected final void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
||||||
ContentHandler contentHandler = new StaxStreamContentHandler(streamWriter);
|
ContentHandler contentHandler = new StaxStreamContentHandler(streamWriter);
|
||||||
marshalSaxHandlers(graph, contentHandler, null);
|
marshalSaxHandlers(graph, contentHandler, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
|
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
XmlObject object = XmlObject.Factory.parse(node, getXmlOptions());
|
XmlObject object = XmlObject.Factory.parse(node, getXmlOptions());
|
||||||
|
|
@ -139,6 +146,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
protected final Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
XmlObject object = XmlObject.Factory.parse(inputStream, getXmlOptions());
|
XmlObject object = XmlObject.Factory.parse(inputStream, getXmlOptions());
|
||||||
|
|
@ -150,6 +158,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
protected final Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
||||||
try {
|
try {
|
||||||
XmlObject object = XmlObject.Factory.parse(reader, getXmlOptions());
|
XmlObject object = XmlObject.Factory.parse(reader, getXmlOptions());
|
||||||
|
|
@ -161,6 +170,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
protected final Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
XmlSaxHandler saxHandler = XmlObject.Factory.newXmlSaxHandler(getXmlOptions());
|
XmlSaxHandler saxHandler = XmlObject.Factory.newXmlSaxHandler(getXmlOptions());
|
||||||
|
|
@ -188,6 +198,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException {
|
protected final Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException {
|
||||||
XMLReader reader = new StaxEventXmlReader(eventReader);
|
XMLReader reader = new StaxEventXmlReader(eventReader);
|
||||||
try {
|
try {
|
||||||
|
|
@ -198,6 +209,7 @@ public class XmlBeansMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException {
|
protected final Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
XmlObject object = XmlObject.Factory.parse(streamReader, getXmlOptions());
|
XmlObject object = XmlObject.Factory.parse(streamReader, getXmlOptions());
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,7 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
protected void marshalDomNode(Object graph, Node node) throws XmlMappingException {
|
||||||
HierarchicalStreamWriter streamWriter;
|
HierarchicalStreamWriter streamWriter;
|
||||||
if (node instanceof Document) {
|
if (node instanceof Document) {
|
||||||
|
|
@ -362,11 +363,13 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
marshal(graph, streamWriter);
|
marshal(graph, streamWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException {
|
protected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter) throws XmlMappingException {
|
||||||
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
ContentHandler contentHandler = new StaxEventContentHandler(eventWriter);
|
||||||
marshalSaxHandlers(graph, contentHandler, null);
|
marshalSaxHandlers(graph, contentHandler, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
protected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
marshal(graph, new StaxWriter(new QNameMap(), streamWriter));
|
marshal(graph, new StaxWriter(new QNameMap(), streamWriter));
|
||||||
|
|
@ -376,11 +379,13 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalOutputStream(Object graph, OutputStream outputStream)
|
protected void marshalOutputStream(Object graph, OutputStream outputStream)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
marshalWriter(graph, new OutputStreamWriter(outputStream, getEncoding()));
|
marshalWriter(graph, new OutputStreamWriter(outputStream, getEncoding()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
protected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, LexicalHandler lexicalHandler)
|
||||||
throws XmlMappingException {
|
throws XmlMappingException {
|
||||||
SaxWriter saxWriter = new SaxWriter();
|
SaxWriter saxWriter = new SaxWriter();
|
||||||
|
|
@ -388,6 +393,7 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
marshal(graph, saxWriter);
|
marshal(graph, saxWriter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
protected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException {
|
||||||
if (streamDriver != null) {
|
if (streamDriver != null) {
|
||||||
marshal(graph, streamDriver.createWriter(writer));
|
marshal(graph, streamDriver.createWriter(writer));
|
||||||
|
|
@ -410,6 +416,7 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
|
protected Object unmarshalDomNode(Node node) throws XmlMappingException {
|
||||||
HierarchicalStreamReader streamReader;
|
HierarchicalStreamReader streamReader;
|
||||||
if (node instanceof Document) {
|
if (node instanceof Document) {
|
||||||
|
|
@ -424,6 +431,7 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
return unmarshal(streamReader);
|
return unmarshal(streamReader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException {
|
protected Object unmarshalXmlEventReader(XMLEventReader eventReader) throws XmlMappingException {
|
||||||
try {
|
try {
|
||||||
XMLStreamReader streamReader = new XmlEventStreamReader(eventReader);
|
XMLStreamReader streamReader = new XmlEventStreamReader(eventReader);
|
||||||
|
|
@ -434,14 +442,17 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException {
|
protected Object unmarshalXmlStreamReader(XMLStreamReader streamReader) throws XmlMappingException {
|
||||||
return unmarshal(new StaxReader(new QNameMap(), streamReader));
|
return unmarshal(new StaxReader(new QNameMap(), streamReader));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
protected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException {
|
||||||
return unmarshalReader(new InputStreamReader(inputStream, getEncoding()));
|
return unmarshalReader(new InputStreamReader(inputStream, getEncoding()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
protected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException {
|
||||||
if (streamDriver != null) {
|
if (streamDriver != null) {
|
||||||
return unmarshal(streamDriver.createReader(reader));
|
return unmarshal(streamDriver.createReader(reader));
|
||||||
|
|
@ -451,6 +462,7 @@ public class XStreamMarshaller extends AbstractMarshaller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
protected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource)
|
||||||
throws XmlMappingException, IOException {
|
throws XmlMappingException, IOException {
|
||||||
throw new UnsupportedOperationException(
|
throw new UnsupportedOperationException(
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import org.xml.sax.ContentHandler;
|
||||||
|
|
||||||
public class CastorMarshallerTest extends AbstractMarshallerTestCase {
|
public class CastorMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Marshaller createMarshaller() throws Exception {
|
protected Marshaller createMarshaller() throws Exception {
|
||||||
CastorMarshaller marshaller = new CastorMarshaller();
|
CastorMarshaller marshaller = new CastorMarshaller();
|
||||||
ClassPathResource mappingLocation = new ClassPathResource("mapping.xml", CastorMarshaller.class);
|
ClassPathResource mappingLocation = new ClassPathResource("mapping.xml", CastorMarshaller.class);
|
||||||
|
|
@ -33,6 +34,7 @@ public class CastorMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
return marshaller;
|
return marshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object createFlights() {
|
protected Object createFlights() {
|
||||||
Flight flight = new Flight();
|
Flight flight = new Flight();
|
||||||
flight.setNumber(42L);
|
flight.setNumber(42L);
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import org.springframework.oxm.Unmarshaller;
|
||||||
|
|
||||||
public class CastorUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
public class CastorUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlights(Object o) {
|
protected void testFlights(Object o) {
|
||||||
Flights flights = (Flights) o;
|
Flights flights = (Flights) o;
|
||||||
assertNotNull("Flights is null", flights);
|
assertNotNull("Flights is null", flights);
|
||||||
|
|
@ -32,12 +33,14 @@ public class CastorUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
testFlight(flights.getFlight()[0]);
|
testFlight(flights.getFlight()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlight(Object o) {
|
protected void testFlight(Object o) {
|
||||||
Flight flight = (Flight) o;
|
Flight flight = (Flight) o;
|
||||||
assertNotNull("Flight is null", flight);
|
assertNotNull("Flight is null", flight);
|
||||||
assertEquals("Number is invalid", 42L, flight.getNumber());
|
assertEquals("Number is invalid", 42L, flight.getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Unmarshaller createUnmarshaller() throws Exception {
|
protected Unmarshaller createUnmarshaller() throws Exception {
|
||||||
CastorMarshaller marshaller = new CastorMarshaller();
|
CastorMarshaller marshaller = new CastorMarshaller();
|
||||||
ClassPathResource mappingLocation = new ClassPathResource("mapping.xml", CastorMarshaller.class);
|
ClassPathResource mappingLocation = new ClassPathResource("mapping.xml", CastorMarshaller.class);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ public class Jaxb1MarshallerTest extends AbstractJaxbMarshallerTestCase {
|
||||||
|
|
||||||
private static final String CONTEXT_PATH = "org.springframework.oxm.jaxb1";
|
private static final String CONTEXT_PATH = "org.springframework.oxm.jaxb1";
|
||||||
|
|
||||||
|
@Override
|
||||||
protected final Marshaller createMarshaller() throws Exception {
|
protected final Marshaller createMarshaller() throws Exception {
|
||||||
Jaxb1Marshaller marshaller = new Jaxb1Marshaller();
|
Jaxb1Marshaller marshaller = new Jaxb1Marshaller();
|
||||||
marshaller.setContextPaths(new String[]{CONTEXT_PATH});
|
marshaller.setContextPaths(new String[]{CONTEXT_PATH});
|
||||||
|
|
@ -36,6 +37,7 @@ public class Jaxb1MarshallerTest extends AbstractJaxbMarshallerTestCase {
|
||||||
return marshaller;
|
return marshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object createFlights() {
|
protected Object createFlights() {
|
||||||
FlightType flight = new FlightTypeImpl();
|
FlightType flight = new FlightTypeImpl();
|
||||||
flight.setNumber(42L);
|
flight.setNumber(42L);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import org.springframework.oxm.jaxb1.Flights;
|
||||||
|
|
||||||
public class Jaxb1UnmarshallerTest extends AbstractUnmarshallerTestCase {
|
public class Jaxb1UnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Unmarshaller createUnmarshaller() throws Exception {
|
protected Unmarshaller createUnmarshaller() throws Exception {
|
||||||
Jaxb1Marshaller marshaller = new Jaxb1Marshaller();
|
Jaxb1Marshaller marshaller = new Jaxb1Marshaller();
|
||||||
marshaller.setContextPath("org.springframework.oxm.jaxb1");
|
marshaller.setContextPath("org.springframework.oxm.jaxb1");
|
||||||
|
|
@ -30,6 +31,7 @@ public class Jaxb1UnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
return marshaller;
|
return marshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlights(Object o) {
|
protected void testFlights(Object o) {
|
||||||
Flights flights = (Flights) o;
|
Flights flights = (Flights) o;
|
||||||
assertNotNull("Flights is null", flights);
|
assertNotNull("Flights is null", flights);
|
||||||
|
|
@ -37,6 +39,7 @@ public class Jaxb1UnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
testFlight(flights.getFlight().get(0));
|
testFlight(flights.getFlight().get(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlight(Object o) {
|
protected void testFlight(Object o) {
|
||||||
FlightType flight = (FlightType) o;
|
FlightType flight = (FlightType) o;
|
||||||
assertNotNull("Flight is null", flight);
|
assertNotNull("Flight is null", flight);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import org.springframework.xml.transform.StringResult;
|
||||||
|
|
||||||
public class JibxMarshallerTest extends AbstractMarshallerTestCase {
|
public class JibxMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Marshaller createMarshaller() throws Exception {
|
protected Marshaller createMarshaller() throws Exception {
|
||||||
JibxMarshaller marshaller = new JibxMarshaller();
|
JibxMarshaller marshaller = new JibxMarshaller();
|
||||||
marshaller.setTargetClass(Flights.class);
|
marshaller.setTargetClass(Flights.class);
|
||||||
|
|
@ -31,6 +32,7 @@ public class JibxMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
return marshaller;
|
return marshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object createFlights() {
|
protected Object createFlights() {
|
||||||
Flights flights = new Flights();
|
Flights flights = new Flights();
|
||||||
FlightType flight = new FlightType();
|
FlightType flight = new FlightType();
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import org.springframework.oxm.Unmarshaller;
|
||||||
|
|
||||||
public class JibxUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
public class JibxUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Unmarshaller createUnmarshaller() throws Exception {
|
protected Unmarshaller createUnmarshaller() throws Exception {
|
||||||
JibxMarshaller unmarshaller = new JibxMarshaller();
|
JibxMarshaller unmarshaller = new JibxMarshaller();
|
||||||
unmarshaller.setTargetClass(Flights.class);
|
unmarshaller.setTargetClass(Flights.class);
|
||||||
|
|
@ -27,6 +28,7 @@ public class JibxUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
return unmarshaller;
|
return unmarshaller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlights(Object o) {
|
protected void testFlights(Object o) {
|
||||||
Flights flights = (Flights) o;
|
Flights flights = (Flights) o;
|
||||||
assertNotNull("Flights is null", flights);
|
assertNotNull("Flights is null", flights);
|
||||||
|
|
@ -34,12 +36,14 @@ public class JibxUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
testFlight(flights.getFlight(0));
|
testFlight(flights.getFlight(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlight(Object o) {
|
protected void testFlight(Object o) {
|
||||||
FlightType flight = (FlightType) o;
|
FlightType flight = (FlightType) o;
|
||||||
assertNotNull("Flight is null", flight);
|
assertNotNull("Flight is null", flight);
|
||||||
assertEquals("Number is invalid", 42L, flight.getNumber());
|
assertEquals("Number is invalid", 42L, flight.getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void testUnmarshalPartialStaxSourceXmlStreamReader() throws Exception {
|
public void testUnmarshalPartialStaxSourceXmlStreamReader() throws Exception {
|
||||||
// JiBX does not support reading XML fragments, hence the override here
|
// JiBX does not support reading XML fragments, hence the override here
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import org.springframework.samples.flight.FlightsDocument.Flights;
|
||||||
|
|
||||||
public class XmlBeansMarshallerTest extends AbstractMarshallerTestCase {
|
public class XmlBeansMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Marshaller createMarshaller() throws Exception {
|
protected Marshaller createMarshaller() throws Exception {
|
||||||
return new XmlBeansMarshaller();
|
return new XmlBeansMarshaller();
|
||||||
}
|
}
|
||||||
|
|
@ -41,6 +42,7 @@ public class XmlBeansMarshallerTest extends AbstractMarshallerTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Object createFlights() {
|
protected Object createFlights() {
|
||||||
FlightsDocument flightsDocument = FlightsDocument.Factory.newInstance();
|
FlightsDocument flightsDocument = FlightsDocument.Factory.newInstance();
|
||||||
Flights flights = flightsDocument.addNewFlights();
|
Flights flights = flightsDocument.addNewFlights();
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,12 @@ import org.springframework.xml.transform.StringSource;
|
||||||
|
|
||||||
public class XmlBeansUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
public class XmlBeansUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
|
|
||||||
|
@Override
|
||||||
protected Unmarshaller createUnmarshaller() throws Exception {
|
protected Unmarshaller createUnmarshaller() throws Exception {
|
||||||
return new XmlBeansMarshaller();
|
return new XmlBeansMarshaller();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlights(Object o) {
|
protected void testFlights(Object o) {
|
||||||
FlightsDocument flightsDocument = (FlightsDocument) o;
|
FlightsDocument flightsDocument = (FlightsDocument) o;
|
||||||
assertNotNull("FlightsDocument is null", flightsDocument);
|
assertNotNull("FlightsDocument is null", flightsDocument);
|
||||||
|
|
@ -43,6 +45,7 @@ public class XmlBeansUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
testFlight(flights.getFlightArray(0));
|
testFlight(flights.getFlightArray(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void testFlight(Object o) {
|
protected void testFlight(Object o) {
|
||||||
FlightType flight = null;
|
FlightType flight = null;
|
||||||
if (o instanceof FlightType) {
|
if (o instanceof FlightType) {
|
||||||
|
|
@ -56,6 +59,7 @@ public class XmlBeansUnmarshallerTest extends AbstractUnmarshallerTestCase {
|
||||||
assertEquals("Number is invalid", 42L, flight.getNumber());
|
assertEquals("Number is invalid", 42L, flight.getNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void testUnmarshalPartialStaxSourceXmlStreamReader() throws Exception {
|
public void testUnmarshalPartialStaxSourceXmlStreamReader() throws Exception {
|
||||||
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
|
||||||
XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(INPUT_STRING));
|
XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(INPUT_STRING));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue