public class XStreamAttributeCopier extends Object
Constructor and Description |
---|
XStreamAttributeCopier() |
Modifier and Type | Method and Description |
---|---|
static com.thoughtworks.xstream.io.HierarchicalStreamReader |
copyXml(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
StringWriter writer,
Map<String,String> attributeMap)
Copies the entire XML element
reader is currently at into writer and returns a
new reader ready to read the copied element. |
static void |
copyXmlNamespaceDeclarationsIntoContext(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Copies the namespace declarations on the XML element
reader is currently at into context . |
public static com.thoughtworks.xstream.io.HierarchicalStreamReader copyXml(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, StringWriter writer, Map<String,String> attributeMap)
reader
is currently at into writer
and returns a
new reader ready to read the copied element. After the call, reader
will be at the end
of the element that was copied.
If attributeMap
is provided, the attributes will be added to the copy.
reader
- the reader currently at the XML element you want to copywriter
- the writer that the element will be copied intoattributeMap
- the map of attribute names to values that will be added as attributes of
the copy, may be nullcom.thoughtworks.xstream.converters.ConversionException
- if a parser to use for the new reader can't be createdpublic static void copyXmlNamespaceDeclarationsIntoContext(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
reader
is currently at into context
. The namespace declarations will be available in context
at the key CswConstants.NAMESPACE_DECLARATIONS
. The new namespace declarations will be added to any
existing ones already in context
.reader
- the reader currently at the XML element with namespace declarations you want to
copycontext
- the UnmarshallingContext
that the namespace declarations will be copied
toThis work is licensed under a Creative Commons Attribution 4.0 International License.