01: package org.compass.core.converter.xsem;
02:
03: import java.io.Reader;
04:
05: import org.compass.core.converter.ConversionException;
06: import org.compass.core.xml.AliasedXmlObject;
07: import org.compass.core.xml.XmlObject;
08:
09: /**
10: * Converts an {@link XmlObject} to and from an xml string.
11: *
12: * @author kimchy
13: */
14: public interface XmlContentConverter {
15:
16: /**
17: * Converts an {@link org.compass.core.xml.XmlObject} into an xml string.
18: *
19: * @param xmlObject The xml object to convert to an xml string
20: * @return An xml string representation of the xml object
21: * @throws org.compass.core.converter.ConversionException
22: * Failed to convert the xml object to an xml string
23: */
24: String toXml(XmlObject xmlObject) throws ConversionException;
25:
26: /**
27: * Converts an xml string into an {@link org.compass.core.xml.AliasedXmlObject}.
28: *
29: * @param alias The alias the aliases xml object is associated with
30: * @param xml The xml string that will be converted into an aliases xml object
31: * @return The aliases xml object that is the restult of the xml parsed
32: * @throws ConversionException
33: */
34: AliasedXmlObject fromXml(String alias, Reader xml)
35: throws ConversionException;
36:
37: }
|