4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sourceforge.mikutoga.xml;
10 import java.io.Closeable;
11 import java.io.Flushable;
12 import java.io.IOException;
15 * Appendable用XMLエクスポータ実装。
17 public class BasicXmlExporter extends AbstractXmlExporter{
19 private Appendable appendable = null;
25 public BasicXmlExporter(){
34 * @throws NullPointerException 引数がnull
36 public void setAppendable(Appendable app) throws NullPointerException{
37 if(app == null) throw new NullPointerException();
39 this.appendable = app;
46 * @param ch {@inheritDoc}
47 * @return {@inheritDoc}
48 * @throws IOException {@inheritDoc}
51 public Appendable append(char ch) throws IOException{
52 return this.appendable.append(ch);
57 * @param seq {@inheritDoc}
58 * @return {@inheritDoc}
59 * @throws IOException {@inheritDoc}
62 public Appendable append(CharSequence seq) throws IOException{
63 return this.appendable.append(seq);
68 * @param seq {@inheritDoc}
69 * @param start {@inheritDoc}
70 * @param end {@inheritDoc}
71 * @return {@inheritDoc}
72 * @throws IOException {@inheritDoc}
75 public Appendable append(CharSequence seq, int start, int end)
77 return this.appendable.append(seq, start, end);
83 * @throws IOException {@inheritDoc}
86 public void flush() throws IOException{
87 if(this.appendable instanceof Flushable){
88 ((Flushable)this.appendable).flush();
96 * @throws IOException {@inheritDoc}
99 public void close() throws IOException{
100 if(this.appendable instanceof Closeable){
101 ((Closeable)this.appendable).close();