It's possible to register a SerializationModifier to modify the xml serialization output for specific needs. To do this you need to write a modifier class that implements the com.jaxfront.core.dom.SerializationModifier interface.
Codeblock |
---|
theme | Eclipse |
---|
language | java |
---|
linenumbers | true |
---|
|
public static class Mody implements SerializationModifier {
public void modifyStartTag(Type type, StringBuffer ser, int start) {
if (v.dom.getRootType().equals(type)) {
System.out.println(type.getName());
System.out.println(ser);
ser.insert(start, " xmlns=\"acme.com.mst\"");
}
}
public void modifySimpleTagValue(Type type, String value, StringBuffer serialization) {
}
public void modifyCompositeTagValue(Type type, String value, StringBuffer serialization, int start) {
}
}
|
Here is the code to register your implmentation.
Codeblock |
---|
theme | Eclipse |
---|
language | java |
---|
linenumbers | true |
---|
|
dom.setSerializationModifier (modifier); |