Serializer:

机翻

/*
    使用用于控制空格,规范化,缩进,换行和基本URI的各种选项以特定编码输出Document对象
*/

Serializer(OutputStream out)                 :创建一个使用UTF-8编码的新序列化程序。
Serializer(OutputStream out, String encoding):创建一个使用指定编码的新序列化程序。

protected void breakLine():将当前换行符串写入基础输出流并按当前级别和缩进属性指定的缩进。

void flush()

protected int getColumnNumber():返回输出流的当前列号。
String getEncoding()           :返回此序列化程序使用的字符编码的名称。
int getIndent()                :返回此序列化程序缩进的空格数。
String getLineSeparator()      :返回用作行分隔符的字符串
int getMaxLength()             :返回首选的最大行长度。

void setIndent(int indent)
void setLineSeparator(String lineSeparator)
void setMaxLength(int maxLength)

boolean getPreserveBaseURI()             :如果此序列化程序通过插入额外的xml:base属性来保留原始基URI,则返回true。
boolean    getUnicodeNormalizationFormC():指示序列化是否将使用规范化形式C(NFC)对所有数据执行Unicode规范化。
void setPreserveBaseURI(boolean preserve)
void setUnicodeNormalizationFormC(boolean normalize)

void setOutputStream(OutputStream out):刷新上一个输出流并将进一步的输出重定向到新的输出流。

protected void write(Attribute attribute)  :以name =“value”的形式写入属性
protected void write(Comment comment)      :使用当前选项将注释写入输出流
protected void    write(DocType doctype)   :使用当前选项将DocType对象写入输出流
void write(Document doc)                   :使用当前选项将文档序列化到输出流。
protected void    write(Element element)   :使用当前选项将元素序列化到输出流
protected void    write(Text text)         :使用当前选项将Text对象写入输出流。
protected void    writeChild(Node node)    :使用当前选项将子节点写入输出流。

protected void    write(ProcessingInstruction instruction)    :使用当前选项将处理指令写入输出流。
protected void    writeAttributes(Element element)            :将指定元素的所有属性一次一个地写入输出流,由空格分隔。
protected void    writeEmptyElementTag(Element element)       :为元素写入一个空元素标记,包括其所有名称空间声明和属性。
protected void    writeEndTag(Element element)                :为</ name>形式的元素写入结束标记。
protected void    writeNamespaceDeclarations(Element element) :将指定元素的所有名称空间声明属性写入输出流,一次一个,用空格分隔。

protected void    writeAttributeValue(String value) :将字符串写入基础输出流。
protected void    writeEscaped(String text)         :将字符串写入基础输出流。

protected void    writeNamespaceDeclaration(String prefix, String uri):以xmlns:prefix =“uri”或xmlns =“uri”的形式写入名称空间声明。

protected void    writeXMLDeclaration()         :将XML声明写入输出流,然后换行。
protected void    writeRaw(String text)         :将字符串写入基础输出流。
protected void    writeStartTag(Element element):为元素写入start-tag,包括其所有名称空间声明和属性。

nu.xom:Serializer的更多相关文章

  1. nu.xom:Document

    Document: 机翻 Document(Document doc):创建此文档的副本. Document(Element root):使用指定的根元素创建新的Document对象. DocType ...

  2. nu.xom:Element

    Element: 机翻 Element(Element element) :通过深复制,创建一个element Element(String name) :创建一个没有命名空间的element Ele ...

  3. nu.xom:Attribute

    Attribute: 机翻 Attribute copy():生成一份当前Attribute的拷贝,但是它没有依附任何Element Node getChild(int position) :因为At ...

  4. json转xml报[java.lang.NoClassDefFoundError: nu/xom/Serializer]

    原文:http://blog.csdn.net/figo645/article/details/48413571 开始学习JSON了,那么很自然的,我开始要熟悉一些基本的JSON语法 {}代表对象,[ ...

  5. XML2JSON 的【net.sf.json.JSONException: nu.xom.ParsingException must be followed by either attribute specifications, ">" or "/>"】问题解决办法

    在使用JSon-Lib库进行XML2JSon的转换时,在JUnit测试时没有什么问题,但是在Tomcat里面跑的时候,抛出了下面的异常,查找了google,发现关于这方便的文章比较少,即使有,也需要F ...

  6. drf之序列化组件(一):Serializer

    序列化组件:Serializer.ModelSerializer.ListModelSerializer Serializer  偏底层  ModelSerializer       重点  List ...

  7. tomcat启动报错:serializer.jar (系统找不到指定的文件。)

    下载最新对应版本的tomcat.移除之前的tomcat.删除原本全部tomcat的目录. 疑似tomcat的lib包被动过.

  8. 转载:JSONObject简介

    转载网址:http://www.cnblogs.com/java-pan/archive/2012/04/07/JSONObject.html JSONObject简介   本节摘要:之前对JSON做 ...

  9. json:JSONObject包的具体使用(JSONObject-lib包是一个beans,collections,maps,java arrays和xml和JSON互相转换的包)

    1.JSONObject介绍 JSONObject-lib包是一个beans,collections,maps,java arrays和xml和JSON互相转换的包. 2.下载jar包 http:// ...

随机推荐

  1. LINE_NO in format of XXXX example -> Line 10 is 0010

    select case when length(line_no) = 1 then to_char(line_no) when length(line_no) = 2 then '00' || lin ...

  2. CentOS安装mysq

    一安装依赖 yum -y install libaio.so.1 libgcc_s.so.1 libstdc++.so.6 yum -y update libstdc++-4.4.7-4.el6.x8 ...

  3. 程序跳过UAC研究及实现思路(两种方法,现在可能都不行了)

    网上很对跳过UAC资料都是说如果让UAC弹出窗体,并没有真正跳过弹窗,这里结合动态提权+计划任务实现真正意义上的跳过UAC弹窗,运行程序的时候可以不出现UAC窗体,并且程序还是以高权限运行. vist ...

  4. 逆向工程mybatis-geneator.xml

    <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE generatorConfiguration ...

  5. CEGUI 0.7.7 VS2010+SP3 编译过程

    1 在官方网站http://www.cegui.org.uk/ 下载最新的CEGUI 源代码 版本是0.7.7 2 下载编译需要用到的依赖文件包 将解压后的文件夹 Dependencies 和CEGU ...

  6. ab fails to connect to localhost

    The following command fails: $ ab -n 1 localhost:8000/ ... Benchmarking localhost (be patient)...apr ...

  7. 信鸽推送在springboot中出现jar包冲突问题

    错误提示 : java.lang.NoSuchMethodError: org.json.JSONObject.put(Ljava/lang/String;Ljava/util/Collection; ...

  8. ios开发系列之内存泄漏分析(上)

    ios自从引入ARC机制后,一般的内存管理就可以不用我们码农来负责了,但是一些操作如果不注意,还是会引起内存泄漏. 本文主要介绍一下内存泄漏的原理.常规的检测方法以及出现的常用场景和修改方法. 1.  ...

  9. 关于exe4j打包问题

    一.eclipse导出jar Export-->Runnable JAR file 这里有两种情况: 选择 Package required libraries into generated j ...

  10. SSM(三)Mybatis动态SQL

    1.查询语句,where: <resultMap id="xxx" type="xx..Student" autoMapping="false& ...