public class CrafterXStreamMarshaller
extends org.springframework.oxm.xstream.XStreamMarshaller
XStreamMarshaller that:
unsupportedClasses property to exclude any unwanted classes from being
marshalled/unmarshalled| Modifier and Type | Field and Description |
|---|---|
static String |
DOCUMENT_CLASS_ALIAS |
static String |
ITEM_CLASS_ALIAS |
protected boolean |
suppressXmlDeclaration |
static String |
TREE_CLASS_ALIAS |
protected Class[] |
unsupportedClasses |
static String |
XML_DECLARATION |
| Constructor and Description |
|---|
CrafterXStreamMarshaller() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
customizeXStream(com.thoughtworks.xstream.XStream xstream) |
void |
marshalWriter(Object graph,
Writer writer,
com.thoughtworks.xstream.converters.DataHolder dataHolder)
Just as super(), but instead of a
CompactWriter creates a EscapingCompactWriter. |
void |
setSuppressXmlDeclaration(boolean suppressXmlDeclaration) |
void |
setUnsupportedClasses(Class[] unsupportedClasses) |
boolean |
supports(Class clazz)
Returns true if the specified class:
Is NOT the same, a subclass or subinterface of one of the unsupported classes.
Is the the same, a subclass or subinterface of one of the supported classes.
Also returns true if there aren't any unsupported or supported classes.
|
afterPropertiesSet, buildXStream, configureXStream, constructXStream, convertXStreamException, getDefaultEncoding, getXStream, marshalDomNode, marshalOutputStream, marshalOutputStream, marshalSaxHandlers, marshalWriter, marshalXmlEventWriter, marshalXmlStreamWriter, setAliases, setAliasesByType, setAnnotatedClasses, setAutodetectAnnotations, setBeanClassLoader, setConverterLookup, setConverterRegistry, setConverters, setEncoding, setFieldAliases, setImplicitCollections, setMapper, setMapperWrappers, setMarshallingStrategy, setMode, setNameCoder, setOmittedFields, setReflectionProvider, setStreamDriver, setSupportedClasses, setUseAttributeFor, setUseAttributeForTypes, unmarshalDomNode, unmarshalInputStream, unmarshalInputStream, unmarshalReader, unmarshalReader, unmarshalSaxReader, unmarshalStreamSource, unmarshalXmlEventReader, unmarshalXmlStreamReaderbuildDocument, createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, isProcessExternalEntities, isSupportDtd, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, setProcessExternalEntities, setSupportDtd, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSourcepublic static final String XML_DECLARATION
public static final String ITEM_CLASS_ALIAS
public static final String TREE_CLASS_ALIAS
public static final String DOCUMENT_CLASS_ALIAS
protected Class[] unsupportedClasses
protected boolean suppressXmlDeclaration
public void setUnsupportedClasses(Class[] unsupportedClasses)
public void setSuppressXmlDeclaration(boolean suppressXmlDeclaration)
protected void customizeXStream(com.thoughtworks.xstream.XStream xstream)
customizeXStream in class org.springframework.oxm.xstream.XStreamMarshallerpublic boolean supports(Class clazz)
supports in interface org.springframework.oxm.Marshallersupports in interface org.springframework.oxm.Unmarshallersupports in class org.springframework.oxm.xstream.XStreamMarshallerpublic void marshalWriter(Object graph, Writer writer, com.thoughtworks.xstream.converters.DataHolder dataHolder) throws org.springframework.oxm.XmlMappingException, IOException
CompactWriter creates a EscapingCompactWriter.
Also if the object graph is a Dom4j document, the document is written directly instead of using XStream.marshalWriter in class org.springframework.oxm.xstream.XStreamMarshallerorg.springframework.oxm.XmlMappingExceptionIOExceptionCopyright © 2018 CrafterCMS. All rights reserved.