Skip to content

Commit

Permalink
Improve documentation (closed #47).
Browse files Browse the repository at this point in the history
  • Loading branch information
joehni committed Dec 23, 2016
1 parent 38d5ae5 commit cad98fd
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005 Joe Walnes.
* Copyright (C) 2006, 2007, 2011, 2014 XStream Committers.
* Copyright (C) 2006, 2007, 2011, 2014, 2016 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -51,11 +51,18 @@ public interface HierarchicalStreamReader extends ErrorReporter, Closeable {

/**
* Get the value of an attribute of the current node.
* <p>
* If no such attribute exists, the method returns null.
* </p>
*/
String getAttribute(String name);

/**
* Get the value of an attribute of the current node, by index.
* <p>
* Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing
* index. Typically some kind of RuntimeException is thrown.
* </p>
*/
String getAttribute(int index);

Expand All @@ -66,11 +73,19 @@ public interface HierarchicalStreamReader extends ErrorReporter, Closeable {

/**
* Name of attribute in current node.
* <p>
* Note, the behavior of this method is dependent on the underlying parser when calling it with a non-existing
* index. Typically some kind of RuntimeException is thrown.
* </p>
*/
String getAttributeName(int index);

/**
* Names of attributes.
* Iterator with the names of the attributes.
* <p>
* Note, the iterator is only valid as long as the internal state of the underlying parser is still at the start of
* the current element. The behavior is undefined if the parser moved on.
* </p>
*/
Iterator<String> getAttributeNames();

Expand Down

0 comments on commit cad98fd

Please sign in to comment.