001 /*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006 package org.util.xml.element;
007
008 import java.net.*;
009 import java.io.*;
010
011 /**
012 *
013 * @author masaru
014 */
015 public abstract class Element {
016
017 public abstract boolean isTagElement();
018 public abstract boolean isTextElement();
019
020 private URI documentbase_;
021 public void setDocumentBase(URI documentbase) {
022 documentbase_ = documentbase;
023 }
024 public URI getDocumentBase() {
025 return documentbase_;
026 }
027
028 public String toString(int space){
029 return toString();
030 }
031
032 public void write(Writer writer) throws IOException {
033 writer.write(toString());
034 }
035
036 protected static String tabtext_ = " ";
037 public static void setTabText(String tabtext) {
038 tabtext_ = tabtext;
039 }
040 public String putTab(int tab) {
041 StringBuffer sb = new StringBuffer();
042 for(int i=0;i<tab;i++) sb.append(tabtext_);
043 return sb.toString();
044 }
045 }