1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /*
  17. * $Id: DOMSerializer.java,v 1.3 2004/02/17 04:18:18 minchau Exp $
  18. */
  19. package com.sun.org.apache.xml.internal.serializer;
  20. import java.io.IOException;
  21. import org.w3c.dom.Node;
  22. /**
  23. * Interface for a DOM serializer implementation.
  24. * <p>
  25. * The DOM serializer is a facet of a serializer. A serializer may or may
  26. * not support a DOM serializer.
  27. * <p>
  28. * Example:
  29. * <pre>
  30. * Document doc;
  31. * Serializer ser;
  32. * OutputStream os;
  33. *
  34. * ser.setOutputStream( os );
  35. * ser.asDOMSerializer( doc );
  36. * </pre>
  37. *
  38. *
  39. * @version Alpha
  40. * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
  41. * @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
  42. */
  43. public interface DOMSerializer
  44. {
  45. /**
  46. * Serializes the DOM node. Throws an exception only if an I/O
  47. * exception occured while serializing.
  48. *
  49. * @param node the DOM node to serialize
  50. * @throws IOException if an I/O exception occured while serializing
  51. */
  52. public void serialize(Node node) throws IOException;
  53. }