public final class ConvenientXMLFormatter extends Object implements XMLDiffXFormatter
Nodes that have not changed are kept the way they are.
Elements that have been modified
Constructor and Description |
---|
ConvenientXMLFormatter(Writer w)
Creates a new formatter using the specified writer.
|
Modifier and Type | Method and Description |
---|---|
void |
declarePrefixMapping(PrefixMapping mapping)
Adds the prefix mapping to this class.
|
void |
delete(DiffXEvent e)
Formats the specified deleted event.
|
void |
format(DiffXEvent e)
Formats the specified event.
|
void |
insert(DiffXEvent e)
Formats the specified inserted event.
|
void |
setConfig(DiffXConfig config)
Sets the configuration to use with this formatter.
|
void |
setWriteXMLDeclaration(boolean show)
Set whether the formatter should include the XML declaration or not.
|
public ConvenientXMLFormatter(Writer w) throws NullPointerException
w
- The writer to use.NullPointerException
- If the specified writer is null
.public void format(DiffXEvent e) throws IOException
DiffXFormatter
format
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.public void insert(DiffXEvent e) throws IOException
DiffXFormatter
insert
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.public void delete(DiffXEvent e) throws IOException
DiffXFormatter
delete
in interface DiffXFormatter
e
- The event to formatIOException
- Should an I/O exception occurs while formatting.public void setConfig(DiffXConfig config)
DiffXFormatter
setConfig
in interface DiffXFormatter
config
- The configuration to use.public void setWriteXMLDeclaration(boolean show)
XMLDiffXFormatter
setWriteXMLDeclaration
in interface XMLDiffXFormatter
show
- true
to get the formatter to write the XML declaration;
false
otherwise.public void declarePrefixMapping(PrefixMapping mapping)
declarePrefixMapping
in interface XMLDiffXFormatter
mapping
- The prefix mapping to add.Copyright © 2007-2019. All Rights Reserved.