jun.xml.write
类 XmlWriter

java.lang.Object
  继承者 jun.xml.write.XmlWriter

public class XmlWriter
extends java.lang.Object

Makes writing XML much much easier.


字段摘要
static java.lang.String lineSeparator
           
 
构造方法摘要
XmlWriter(java.io.Writer writer)
          Create an XmlWriter on top of an existing java.io.Writer.
 
方法摘要
 XmlWriter A(java.lang.String attr, boolean value)
           
 XmlWriter A(java.lang.String attr, int value)
           
 XmlWriter A(java.lang.String attr, java.lang.String value)
          Write an attribute out for the current entity.
 void close()
          Close this writer.
 XmlWriter E()
          End the current entity.
 XmlWriter endEntity()
           
static void main(java.lang.String[] args)
          Replace a string with another string inside a larger string, for the first n values of the search string.
 XmlWriter S(java.lang.String name)
          Begin to output an entity.
static void test1()
           
static void test2()
           
 XmlWriter W(java.lang.String text)
          Output body text.
 XmlWriter writeAttribute(java.lang.String attr, java.lang.String value)
           
 XmlWriter writeEntity(java.lang.String name)
           
 XmlWriter writeText(java.lang.String text)
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

lineSeparator

public static java.lang.String lineSeparator
构造方法详细信息

XmlWriter

public XmlWriter(java.io.Writer writer)
Create an XmlWriter on top of an existing java.io.Writer.

方法详细信息

S

public XmlWriter S(java.lang.String name)
            throws java.lang.Exception
Begin to output an entity.

参数:
String - name of entity.
抛出:
java.lang.Exception

writeEntity

public XmlWriter writeEntity(java.lang.String name)
                      throws java.lang.Exception
抛出:
java.lang.Exception

A

public XmlWriter A(java.lang.String attr,
                   java.lang.String value)
            throws java.lang.Exception
Write an attribute out for the current entity. Any xml characters in the value are escaped. Currently it does not actually throw the exception, but the api is set that way for future changes.

参数:
String - name of attribute.
String - value of attribute.
抛出:
java.lang.Exception

A

public XmlWriter A(java.lang.String attr,
                   int value)
            throws java.lang.Exception
抛出:
java.lang.Exception

A

public XmlWriter A(java.lang.String attr,
                   boolean value)
            throws java.lang.Exception
抛出:
java.lang.Exception

writeAttribute

public XmlWriter writeAttribute(java.lang.String attr,
                                java.lang.String value)
                         throws java.lang.Exception
抛出:
java.lang.Exception

E

public XmlWriter E()
            throws java.lang.Exception
End the current entity. This will throw an exception if it is called when there is not a currently open entity.

抛出:
java.lang.Exception

endEntity

public XmlWriter endEntity()
                    throws java.lang.Exception
抛出:
java.lang.Exception

close

public void close()
           throws java.lang.Exception
Close this writer. It does not close the underlying writer, but does throw an exception if there are as yet unclosed tags.

抛出:
java.lang.Exception

W

public XmlWriter W(java.lang.String text)
            throws java.lang.Exception
Output body text. Any xml characters are escaped.

抛出:
java.lang.Exception

writeText

public XmlWriter writeText(java.lang.String text)
                    throws java.lang.Exception
抛出:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Replace a string with another string inside a larger string, for the first n values of the search string.

参数:
text - String to do search and replace in
repl - String to search for
with - String to replace with
n - int values to replace
抛出:
java.lang.Exception

test1

public static void test1()
                  throws java.lang.Exception
抛出:
java.lang.Exception

test2

public static void test2()
                  throws java.lang.Exception
抛出:
java.lang.Exception