请问java的api中有个叫Document的类?

xwei520 2004-07-23 09:33:51
它是属于javaAPI中哪一个包的??一般在什么情况下会用??
...全文
364 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
52juanjuan 2004-07-23
  • 打赏
  • 举报
回复
up.
xwei520 2004-07-23
  • 打赏
  • 举报
回复
是的!~谢谢帮助!~
tsingien 2004-07-23
  • 打赏
  • 举报
回复
不知道楼主说的是不是这个?
org.w3c.dom
Interface Document

public interface Document
extends Node

The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.

Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.

Method Summary
Attr createAttribute(String name)
Creates an Attr of the given name.
Attr createAttributeNS(String namespaceURI, String qualifiedName)
Creates an attribute of the given qualified name and namespace URI.
CDATASection createCDATASection(String data)
Creates a CDATASection node whose value is the specified string.
Comment createComment(String data)
Creates a Comment node given the specified string.
DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object.
Element createElement(String tagName)
Creates an element of the type specified.
Element createElementNS(String namespaceURI, String qualifiedName)
Creates an element of the given qualified name and namespace URI.
EntityReference createEntityReference(String name)
Creates an EntityReference object.
ProcessingInstruction createProcessingInstruction(String target, String data)
Creates a ProcessingInstruction node given the specified name and data strings.
Text createTextNode(String data)
Creates a Text node given the specified string.
DocumentType getDoctype()
The Document Type Declaration (see DocumentType) associated with this document.
Element getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
Element getElementById(String elementId)
Returns the Element whose ID is given by elementId.
NodeList getElementsByTagName(String tagname)
Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
NodeList getElementsByTagNameNS(String namespaceURI, String localName)
Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
DOMImplementation getImplementation()
The DOMImplementation object that handles this document.
Node importNode(Node importedNode, boolean deep)
Imports a node from another document to this document.
liusoft 2004-07-23
  • 打赏
  • 举报
回复
org.w3c.dom.Document

是用在处理XML文档的时候
jackson所需要的所有jar jackson-all-1.6.2.jar jackson-core-asl-1.6.2.jar jackson-mapper-asl-1.6.2.jar jakarta-oro.jar 1. 背景 目前维护的产品使用jackson处理json,现整理一下jackson相关资料,希望对初次接触jackson的新手有所帮助。 jackson主页: http://jackson.codehaus.org/ jackson document: http://wiki.fasterxml.com/JacksonJavaDocs JacksonInFiveMinutes: http://wiki.fasterxml.com/JacksonInFiveMinutes 本文主要内容译自JacksonInFiveMinutes,增加了部分示例,转载请注明出处。 受java平台上各种处理xml的库(StAX, JAXB等)启发,Jackson提供一种处理json的java库。Jackson的目标是为开发者提供快速、准确、轻量级和用起来最爽的json处理库。本文将概括介绍Jackson的主要功能和相关功能的使用示例。 2. 使用方式 Jackson提供三种可选的json处理方式: 1) Streaming API 又称Incremental parsing/generation, 受StAX API启发,以非关联递增方式读写json内容。 通过 org.codehaus.jackson.JsonParser读取,通过org.codehaus.jackson.JsonGenerator写入。 2) Tree Model 通过基于内存的树形结构来描述json数据,和 XML DOM似。通过org.codehaus.jackson.map.ObjectMapper构建树,树由JsonNode节点组成。 3) Data Binding 基于属性访问或注解的方式将json和POJO对象互相转换, 受JAXB基于注解的处理方式启发。通过org.codehaus.jackson.map.ObjectMapper读写json数据。它包含两种型: 3.1 Simple Data Binding 用于json和Java Maps, Lists, Strings, Numbers, Booleans and nulls的相互转换。 3.2 Full Data Binding 用于json和Java Bean的相互转换。 下面从使用的角度上比较三种处理方式: Streaming API 执行效率最高,读写速度最快,另外两种方式都基于它实现; Tree Model 是最灵活的; Data Binding 通常是最方便使用的;

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧