欢迎光临散文网 会员登陆 & 注册

尚硅谷丨2022版JavaWeb教程(全新技术栈,全程实战)

2022-09-10 21:08 作者:您家水费超了  | 我要投稿

Node.ELEMENT_NODE点进去会发现这是一个,接口类型中的静态常量类型为short

public static final short ELEMENT_NODE              = 1;
/**
 * The node is an <code>Attr</code>.
 */
public static final short ATTRIBUTE_NODE            = 2;
/**
 * The node is a <code>Text</code> node.
 */
public static final short TEXT_NODE                 = 3;
/**
 * The node is a <code>CDATASection</code>.
 */
public static final short CDATA_SECTION_NODE        = 4;
/**
 * The node is an <code>EntityReference</code>.
 */
public static final short ENTITY_REFERENCE_NODE     = 5;
/**
 * The node is an <code>Entity</code>.
 */
public static final short ENTITY_NODE               = 6;
/**
 * The node is a <code>ProcessingInstruction</code>.
 */
public static final short PROCESSING_INSTRUCTION_NODE = 7;
/**
 * The node is a <code>Comment</code>.
 */
public static final short COMMENT_NODE              = 8;
/**
 * The node is a <code>Document</code>.
 */
public static final short DOCUMENT_NODE             = 9;
/**
 * The node is a <code>DocumentType</code>.
 */
public static final short DOCUMENT_TYPE_NODE        = 10;
/**
 * The node is a <code>DocumentFragment</code>.
 */
public static final short DOCUMENT_FRAGMENT_NODE    = 11;
/**
 * The node is a <code>Notation</code>.
 */
public static final short NOTATION_NODE             = 12;
与w3c包中的beanNode类中的对象调用的getNodeTye(返回值也为short)进行比较
 以此来进行判断 是否类型相同 大佬就大佬NB

尚硅谷丨2022版JavaWeb教程(全新技术栈,全程实战)的评论 (共 条)

分享到微博请遵守国家法律