View Javadoc
1   package org.codehaus.plexus.util.xml.pull;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with 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,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.IOException;
23  import java.io.OutputStream;
24  import java.io.Writer;
25  
26  /**
27   *
28   */
29  public interface XmlSerializer
30  {
31  
32      void setFeature( String name, boolean state )
33          throws IllegalArgumentException, IllegalStateException;
34  
35      boolean getFeature( String name );
36  
37      void setProperty( String name, Object value )
38          throws IllegalArgumentException, IllegalStateException;
39  
40      Object getProperty( String name );
41  
42      void setOutput( OutputStream os, String encoding )
43          throws IOException, IllegalArgumentException, IllegalStateException;
44  
45      void setOutput( Writer writer )
46          throws IOException, IllegalArgumentException, IllegalStateException;
47  
48      void startDocument( String encoding, Boolean standalone )
49          throws IOException, IllegalArgumentException, IllegalStateException;
50  
51      void endDocument()
52          throws IOException, IllegalArgumentException, IllegalStateException;
53  
54      void setPrefix( String prefix, String namespace )
55          throws IOException, IllegalArgumentException, IllegalStateException;
56  
57      String getPrefix( String namespace, boolean generatePrefix )
58          throws IllegalArgumentException;
59  
60      int getDepth();
61  
62      String getNamespace();
63  
64      String getName();
65  
66      XmlSerializer startTag( String namespace, String name )
67          throws IOException, IllegalArgumentException, IllegalStateException;
68  
69      XmlSerializer attribute( String namespace, String name, String value )
70          throws IOException, IllegalArgumentException, IllegalStateException;
71  
72      XmlSerializer endTag( String namespace, String name )
73          throws IOException, IllegalArgumentException, IllegalStateException;
74  
75      XmlSerializer text( String text )
76          throws IOException, IllegalArgumentException, IllegalStateException;
77  
78      XmlSerializer text( char[] buf, int start, int len )
79          throws IOException, IllegalArgumentException, IllegalStateException;
80  
81      void cdsect( String text )
82          throws IOException, IllegalArgumentException, IllegalStateException;
83  
84      void entityRef( String text )
85          throws IOException, IllegalArgumentException, IllegalStateException;
86  
87      void processingInstruction( String text )
88          throws IOException, IllegalArgumentException, IllegalStateException;
89  
90      void comment( String text )
91          throws IOException, IllegalArgumentException, IllegalStateException;
92  
93      void docdecl( String text )
94          throws IOException, IllegalArgumentException, IllegalStateException;
95  
96      void ignorableWhitespace( String text )
97          throws IOException, IllegalArgumentException, IllegalStateException;
98  
99      void flush()
100         throws IOException;
101 }