MCPcopy Create free account
hub / github.com/BaseXdb/basex / get

Method get

basex-core/src/main/java/org/basex/api/dom/BXNode.java:47–57  ·  view source on GitHub ↗

Creates a new DOM node instance for the input node. @param node input node @return DOM node, or null if input is no XML node

(final GNode node)

Source from the content-addressed store, hash-verified

45 * @return DOM node, or {@code null} if input is no XML node
46 */
47 public static BXNode get(final GNode node) {
48 return node instanceof final XNode xnode ? switch(node.kind()) {
49 case DOCUMENT -> new BXDoc(xnode);
50 case ELEMENT -> new BXElem(xnode);
51 case TEXT -> new BXText(xnode);
52 case COMMENT -> new BXComm(xnode);
53 case PROCESSING_INSTRUCTION -> new BXPI(xnode);
54 case ATTRIBUTE -> new BXAttr(new FAttr(xnode.qname(), xnode.string()));
55 default -> null;
56 } : null;
57 }
58
59 @Override
60 public String getNodeName() {

Callers 10

queryBindBXNodeMethod · 0.95
toJavaMethod · 0.95
toJavaMethod · 0.95
getFirstChildMethod · 0.95
getLastChildMethod · 0.95
getNextSiblingMethod · 0.95
getPreviousSiblingMethod · 0.95
getParentNodeMethod · 0.95
getOwnerDocumentMethod · 0.95
itemMethod · 0.95

Calls 3

kindMethod · 0.65
qnameMethod · 0.45
stringMethod · 0.45

Tested by 1

queryBindBXNodeMethod · 0.76