OSDN Git Service

空白出力のサポート
authorOlyutorskii <olyutorskii@users.osdn.me>
Tue, 9 Aug 2011 07:40:44 +0000 (16:40 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Tue, 9 Aug 2011 07:40:44 +0000 (16:40 +0900)
src/main/java/jp/sourceforge/mikutoga/xml/BasicXmlExporter.java

index 4b31cc6..33ca677 100644 (file)
@@ -240,6 +240,29 @@ public class BasicXmlExporter {
     }
 
     /**
+     * 空白を出力する。
+     * @return this本体
+     * @throws IOException 出力エラー
+     */
+    public BasicXmlExporter sp() throws IOException{
+        this.appendable.append(" ");
+        return this;
+    }
+
+    /**
+     * 空白を指定回数出力する。
+     * @param count 空白回数。0以下の場合は何も出力しない。
+     * @return this本体
+     * @throws IOException 出力エラー
+     */
+    public BasicXmlExporter sp(int count) throws IOException{
+        for(int ct = 1; ct <= count; ct++){
+            this.appendable.append(" ");
+        }
+        return this;
+    }
+
+    /**
      * インデントを出力する。
      * インデント単位文字列をネストレベル回数分出力する。
      * @return this本体