Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.logic.util.io

public Class XMLUtil

extends Object
Class Inheritance
Annotations
@AllowedToUseStandardStreams:Used for debugging only
Imports
java.io.StringWriter, java.util.AbstractList, .List, .Optional, .RandomAccess, javax.xml.transform.OutputKeys, .Transformer, .TransformerException, .TransformerFactory, javax.xml.transform.dom.DOMSource, javax.xml.transform.stream.StreamResult, org.jabref.architecture.AllowedToUseStandardStreams, org.slf4j.Logger, .LoggerFactory, org.w3c.dom.Document, .Element, .NamedNodeMap, .Node, .NodeList

Currently used for debugging only

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static List<Node>
public static Optional<String>
getAttributeContent(Node item, String attributeName)

Gets the content of an attribute.

public static Optional<Node>
getNode(Node item, String nodeName)

Gets a the first subnode with the specified tag name.

public static Optional<String>
getNodeContent(Node item, String nodeName)

Gets the content of a subnode.

public static List<Node>
getNodesByName(Node item, String nodeName)

Gets a list of subnodes with the specified tag name.

public static void
printDocument(Document doc)

Prints out the document to standard out.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

XMLUtilback to summary
private XMLUtil()

Method Detail

asListback to summary
public static List<Node> asList(NodeList n)
getAttributeContentback to summary
public static Optional<String> getAttributeContent(Node item, String attributeName)

Gets the content of an attribute. For example, <item attributeName="content" />

getNodeback to summary
public static Optional<Node> getNode(Node item, String nodeName)

Gets a the first subnode with the specified tag name. For example,

<item> <node>hit</node> <node>second hit, but not returned</node> </item>
<item>
<node>hit</node>
<node>second hit, but not returned</node>
</item>
getNodeContentback to summary
public static Optional<String> getNodeContent(Node item, String nodeName)

Gets the content of a subnode. For example,

<item> <nodeName>content</nodeName> </item>
<item>
<nodeName>content</nodeName>
</item>
getNodesByNameback to summary
public static List<Node> getNodesByName(Node item, String nodeName)

Gets a list of subnodes with the specified tag name. For example,

<item> <node>first hit</node> <node>second hit</node> </item>
<item>
<node>first hit</node>
<node>second hit</node>
</item>
printDocumentback to summary
public static void printDocument(Document doc)

Prints out the document to standard out. Used to generate files for test cases.

org.jabref.logic.util.io back to summary

private final Class XMLUtil.NodeListWrapper

extends AbstractList<Node>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess

Field Summary

Modifier and TypeField and Description
private final NodeList
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Node
get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

listback to summary
private final NodeList list

Constructor Detail

NodeListWrapperback to summary
pack-priv NodeListWrapper(NodeList list)

Method Detail

getback to summary
public Node get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override