1 /* 2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 */ 4 /* 5 * Licensed to the Apache Software Foundation (ASF) under one or more 6 * contributor license agreements. See the NOTICE file distributed with 7 * this work for additional information regarding copyright ownership. 8 * The ASF licenses this file to You under the Apache License, Version 2.0 9 * (the "License"); you may not use this file except in compliance with 10 * the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 22 package com.sun.org.apache.xml.internal.serialize; 23 24 25 import java.io.IOException; 26 import org.w3c.dom.Element; 27 import org.w3c.dom.Document; 28 import org.w3c.dom.DocumentFragment; 29 30 31 32 /** 33 * Interface for a DOM serializer implementation. 34 * 35 * 36 * @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a> 37 * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a> 38 * 39 * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation 40 * is replaced by that of Xalan. Main class 41 * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced 42 * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. 43 */ 44 @Deprecated 45 public interface DOMSerializer 46 { 47 48 49 /** 50 * Serialized the DOM element. Throws an exception only if 51 * an I/O exception occured while serializing. 52 * 53 * @param elem The element to serialize 54 * @throws IOException An I/O exception occured while 55 * serializing 56 */ 57 public void serialize( Element elem ) 58 throws IOException; 59 60 61 /** 62 * Serializes the DOM document. Throws an exception only if 63 * an I/O exception occured while serializing. 64 * 65 * @param doc The document to serialize 66 * @throws IOException An I/O exception occured while 67 * serializing 68 */ 69 public void serialize( Document doc ) 70 throws IOException; 71 72 73 /** 74 * Serializes the DOM document fragment. Throws an exception 75 * only if an I/O exception occured while serializing. 76 * 77 * @param frag The document fragment to serialize 78 * @throws IOException An I/O exception occured while 79 * serializing 80 */ 81 public void serialize( DocumentFragment frag ) 82 throws IOException; 83 84 85 }