Package org.adempiere.pipo2
Interface IPackSerializer
- All Known Implementing Classes:
JsonPackSerializer,SAXPackSerializer,YamlPackSerializer
public interface IPackSerializer
Format-agnostic serialization interface for 2Pack export.
Implementations write to XML (SAX), JSON, or YAML.
Each packOut operation uses one instance for its entire document lifecycle.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(String text) Write text content for the current element.default voidFinalize the document.voidendElement(String qName) Close the most recently opened element.voidstartElement(String qName, Attributes atts) Open an element (record or field).
-
Method Details
-
startElement
Open an element (record or field).- Parameters:
qName- element nameatts- element attributes (reference hints, type metadata)- Throws:
Exception
-
endElement
Close the most recently opened element.- Parameters:
qName- element name- Throws:
Exception
-
characters
Write text content for the current element.- Parameters:
text- content, may be null (treated as empty)- Throws:
Exception
-
endDocument
Finalize the document. Called once after the root element is closed. The default no-op is sufficient for JSON/YAML serializers that flush onendElement(java.lang.String); XML implementations override to callTransformerHandler.endDocument().- Throws:
Exception
-