public class Outline extends Object implements Serializable
An <outline>
is an XML element containing at least one required attribute, text, and zero or more additional
attributes. An <outline>
may contain zero or more <outline>
sub-elements. No attribute may be
repeated within the same <outline>
element.
Instances are unmodifiable and threadsafe.
Constructor and Description |
---|
Outline(Map<String,String> attributes,
List<Outline> subElements) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getAttribute(String key)
Convenience method.
|
Map<String,String> |
getAttributes() |
Outline |
getSubElement(int index) |
List<Outline> |
getSubElements() |
String |
getText()
Convenience method.
|
int |
hashCode() |
String |
toString() |
public Outline(Map<String,String> attributes, List<Outline> subElements)
attributes
- a Map
, can not be null
, can not contain null
or blank String
as keysubElements
- a List
, can not be null
IllegalArgumentException
- if either argument null
or if attributes
contains a blank keypublic String getAttribute(String key)
getAttributes().get(key);
key
- a String
, can not be nullnull
if not availablepublic String getText()
getAttributes().get("text");
As per the specification of OPML 2.0, the text attribute is required. However, it is not in the version 1.0 spec.null
if not availablepublic Outline getSubElement(int index)
index
- index of the element to returnOutline
at the given index, or null
if there is no element at that indexCopyright © 2019. All rights reserved.