01: /*
02: * Copyright (C) 2006, 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 18. October 2007 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.io.xml;
12:
13: import java.util.List;
14:
15: import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
16:
17: /**
18: * A generic interface for all {@link HierarchicalStreamWriter} implementations generating a
19: * DOM.
20: *
21: * @author Jörg Schaible
22: * @since 1.2.1
23: */
24: public interface DocumentWriter extends HierarchicalStreamWriter {
25:
26: /**
27: * Retrieve a {@link List} with the top elements. In the standard use case this list will
28: * only contain a single element. Additional elements can only occur, if
29: * {@link HierarchicalStreamWriter#startNode(String)} of the implementing
30: * {@link HierarchicalStreamWriter} was called multiple times with an empty node stack. Such
31: * a situation occurs calling
32: * {@link com.thoughtworks.xstream.XStream#marshal(Object, HierarchicalStreamWriter)}
33: * multiple times directly.
34: *
35: * @return a {@link List} with top nodes
36: * @since 1.2.1
37: */
38: List getTopLevelNodes();
39: }
|