|
JHotDraw 7.0.6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnanoxml.XMLElement
public class XMLElement
XMLElement is a representation of an XML object. The object is able to parse XML code.
XMLElement xml = new XMLElement();
FileReader reader = new FileReader("filename.xml");
xml.parseFromReader(reader);
enumerateAttributeNames.
The attribute values can be retrieved using the method
getStringAttribute.
The following example shows how to list the attributes of an element:
XMLElement element = ...;
Iterator iter = element.getAttributeNames();
while (iter.hasNext()) {
String key = (String) iter.next();
String value = element.getStringAttribute(key);
System.out.println(key + " = " + value);
}
iterateChildren.
The number of child iterator can be retrieved using
countChildren.
<title>The Title</title>
getContent.
createElement
which has to return a new copy of the receiver.
XMLParseException| Field Summary | |
|---|---|
static int |
NANOXML_MAJOR_VERSION
Major version of NanoXML. |
static int |
NANOXML_MINOR_VERSION
Minor version of NanoXML. |
| Constructor Summary | |
|---|---|
|
XMLElement()
Creates and initializes a new XML element. |
|
XMLElement(boolean skipLeadingWhitespace)
Creates and initializes a new XML element. |
|
XMLElement(java.util.HashMap entities)
Creates and initializes a new XML element. |
|
XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace)
Creates and initializes a new XML element. |
|
XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean ignoreCase)
Creates and initializes a new XML element. |
protected |
XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean fillBasicConversionTable,
boolean ignoreCase)
Creates and initializes a new XML element. |
protected |
XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean fillBasicConversionTable,
boolean ignoreCase,
boolean encodeUnicodeCharacters)
|
| Method Summary | |
|---|---|
void |
addChild(XMLElement child)
Adds a child element. |
protected boolean |
checkCDATA(java.lang.StringBuffer buf)
Scans a special tag and if the tag is a CDATA section, append its content to buf. |
protected boolean |
checkLiteral(java.lang.String literal)
Scans the data for literal text. |
int |
countChildren()
Returns the number of child iterator of the element. |
protected XMLElement |
createElement()
Creates a new similar XML element. |
XMLElement |
createElement(java.lang.String name)
Creates a new similar XML element. |
java.util.Iterator |
enumerateAttributeNames()
Enumerates the attribute names. |
protected XMLParseException |
expectedInput(java.lang.String charSet)
Creates a parse exception for when the next character read is not the character that was expected. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns an attribute of the element. |
java.lang.Object |
getAttribute(java.lang.String name,
java.util.Map valueSet,
java.lang.String defaultKey,
boolean allowLiterals)
Returns an attribute by looking up a key in a hashtable. |
java.lang.Object |
getAttribute(java.lang.String name,
java.lang.Object defaultValue)
Returns an attribute of the element. |
boolean |
getBooleanAttribute(java.lang.String name,
boolean defaultValue)
|
boolean |
getBooleanAttribute(java.lang.String name,
java.lang.String trueValue,
java.lang.String falseValue,
boolean defaultValue)
Returns an attribute of the element. |
java.util.ArrayList |
getChildren()
Returns the child iterator as a ArrayList. |
java.lang.String |
getContent()
Returns the PCDATA content of the object. |
double |
getDoubleAttribute(java.lang.String name)
Returns an attribute of the element. |
double |
getDoubleAttribute(java.lang.String name,
double defaultValue)
Returns an attribute of the element. |
double |
getDoubleAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiteralNumbers)
Returns an attribute by looking up a key in a hashtable. |
int |
getIntAttribute(java.lang.String name)
Returns an attribute of the element. |
int |
getIntAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiteralNumbers)
Returns an attribute by looking up a key in a hashtable. |
int |
getIntAttribute(java.lang.String name,
int defaultValue)
Returns an attribute of the element. |
int |
getIntAttribute(java.lang.String name,
int min,
int max,
int defaultValue)
|
int |
getLineNr()
Returns the line nr in the source data on which the element is found. |
java.lang.String |
getName()
Returns the name of the element. |
java.lang.String |
getStringAttribute(java.lang.String name)
Returns an attribute of the element. |
java.lang.String |
getStringAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiterals)
Returns an attribute by looking up a key in a hashtable. |
java.lang.String |
getStringAttribute(java.lang.String name,
java.lang.String defaultValue)
Returns an attribute of the element. |
protected XMLParseException |
invalidValue(java.lang.String name,
java.lang.String value)
Creates a parse exception for when an invalid value is given to a method. |
protected XMLParseException |
invalidValueSet(java.lang.String name)
Creates a parse exception for when an invalid valueset is given to a method. |
java.util.Iterator |
iterateChildren()
Enumerates the child iterator. |
void |
parseCharArray(char[] input,
int offset,
int end)
Reads one XML element from a char array and parses it. |
void |
parseCharArray(char[] input,
int offset,
int end,
int startingLineNr)
Reads one XML element from a char array and parses it. |
void |
parseFromReader(java.io.Reader reader)
Reads one XML element from a java.io.Reader and parses it. |
void |
parseFromReader(java.io.Reader reader,
int startingLineNr)
Reads one XML element from a java.io.Reader and parses it. |
void |
parseString(java.lang.String string)
Reads one XML element from a String and parses it. |
void |
parseString(java.lang.String string,
int offset)
Reads one XML element from a String and parses it. |
void |
parseString(java.lang.String string,
int offset,
int end)
Reads one XML element from a String and parses it. |
void |
parseString(java.lang.String string,
int offset,
int end,
int startingLineNr)
Reads one XML element from a String and parses it. |
void |
print(java.io.PrintWriter writer)
Writes the XML element to a print writer and indents the elements. |
protected void |
print(java.io.PrintWriter writer,
int indent)
Writes the XML element to a print writer and indents the elements. |
protected char |
readChar()
Reads a character from a reader. |
void |
removeAttribute(java.lang.String name)
Removes an attribute. |
void |
removeChild(XMLElement child)
Removes a child element. |
protected void |
resolveEntity(java.lang.StringBuffer buf)
Resolves an entity. |
protected void |
scanElement(XMLElement elt)
Scans an XML element. |
protected void |
scanIdentifier(java.lang.StringBuffer result)
Scans an identifier from the current reader. |
protected void |
scanPCData(java.lang.StringBuffer data)
Scans a #PCDATA element. |
protected void |
scanString(java.lang.StringBuffer string)
This method scans a delimited string from the current reader. |
protected char |
scanWhitespace()
This method scans an identifier from the current reader. |
protected char |
scanWhitespace(java.lang.StringBuffer result)
This method scans an identifier from the current reader. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Adds or modifies an attribute. |
void |
setContent(java.lang.String content)
Changes the content string. |
void |
setDoubleAttribute(java.lang.String name,
double value)
Adds or modifies an attribute. |
void |
setIntAttribute(java.lang.String name,
int value)
Adds or modifies an attribute. |
void |
setName(java.lang.String name)
Changes the name of the element. |
protected void |
skipComment()
Skips a comment. |
protected void |
skipSpecialTag(int bracketLevel)
Skips a special tag or comment. |
protected XMLParseException |
syntaxError(java.lang.String context)
Creates a parse exception for when a syntax error occured. |
java.lang.String |
toString()
Writes the XML element to a string. |
protected XMLParseException |
unexpectedEndOfData()
Creates a parse exception for when the end of the data input has been reached. |
protected XMLParseException |
unknownEntity(java.lang.String name)
Creates a parse exception for when an entity could not be resolved. |
protected void |
unreadChar(char ch)
Pushes a character back to the read-back buffer. |
void |
write(java.io.Writer writer)
Writes the XML element to a writer. |
protected void |
writeEncoded(java.io.Writer writer,
java.lang.String str)
Writes a string encoded to a writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NANOXML_MAJOR_VERSION
NANOXML_MINOR_VERSION,
Constant Field Valuespublic static final int NANOXML_MINOR_VERSION
NANOXML_MAJOR_VERSION,
Constant Field Values| Constructor Detail |
|---|
public XMLElement()
new XMLElement(new HashMap(), false, true)
XMLElement(HashMap),
XMLElement(boolean),
XMLElement(HashMap, boolean)public XMLElement(java.util.HashMap entities)
new XMLElement(entities, false, true)
entities - The entity conversion table.
entities != null
XMLElement(),
XMLElement(boolean),
XMLElement(HashMap, boolean)public XMLElement(boolean skipLeadingWhitespace)
new XMLElement(new HashMap(), skipLeadingWhitespace, true)
skipLeadingWhitespace - true if leading and trailing whitespace in PCDATA
content has to be removed.
XMLElement(),
XMLElement(HashMap),
XMLElement(HashMap, boolean)
public XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace)
new XMLElement(entities, skipLeadingWhitespace, true)
entities - The entity conversion table.skipLeadingWhitespace - true if leading and trailing whitespace in PCDATA
content has to be removed.
entities != null
XMLElement(),
XMLElement(boolean),
XMLElement(HashMap)
public XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean ignoreCase)
entities - The entity conversion table.skipLeadingWhitespace - true if leading and trailing whitespace in PCDATA
content has to be removed.ignoreCase - true if the case of element and attribute names have
to be ignored.
entities != null
XMLElement(),
XMLElement(boolean),
XMLElement(HashMap),
XMLElement(HashMap, boolean)
protected XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean fillBasicConversionTable,
boolean ignoreCase)
This constructor should only be called from
createElement
to create child iterator.
entities - The entity conversion table.skipLeadingWhitespace - true if leading and trailing whitespace in PCDATA
content has to be removed.fillBasicConversionTable - true if the basic entities need to be added to
the entity list.ignoreCase - true if the case of element and attribute names have
to be ignored.
entities != null
fillBasicConversionTable == false
then entities contains at least the following
entries: amp, lt, gt,
apos and quot
createElement()
protected XMLElement(java.util.HashMap entities,
boolean skipLeadingWhitespace,
boolean fillBasicConversionTable,
boolean ignoreCase,
boolean encodeUnicodeCharacters)
| Method Detail |
|---|
public void addChild(XMLElement child)
child - The child element to add.
child != null
child.getName() != null
child does not have a parent element
countChildren(),
iterateChildren(),
getChildren(),
removeChild(XMLElement)
public void setAttribute(java.lang.String name,
java.lang.Object value)
name - The name of the attribute.value - The value of the attribute.
name != null
name is a valid XML identifier
value != null
public void setIntAttribute(java.lang.String name,
int value)
name - The name of the attribute.value - The value of the attribute.
name != null
name is a valid XML identifier
public void setDoubleAttribute(java.lang.String name,
double value)
name - The name of the attribute.value - The value of the attribute.
name != null
name is a valid XML identifier
public int countChildren()
result >= 0
addChild(XMLElement),
iterateChildren(),
getChildren(),
removeChild(XMLElement)public java.util.Iterator enumerateAttributeNames()
result != null
public java.util.Iterator iterateChildren()
result != null
public java.util.ArrayList getChildren()
result != null
addChild(XMLElement),
countChildren(),
iterateChildren(),
removeChild(XMLElement)public java.lang.String getContent()
null is returned.
setContent(String)public int getLineNr()
0 there is no associated source data.
result >= 0
public java.lang.Object getAttribute(java.lang.String name)
null is returned.
name - The name of the attribute.
name != null
name is a valid XML identifier
public java.lang.Object getAttribute(java.lang.String name,
java.lang.Object defaultValue)
defaultValue is returned.
name - The name of the attribute.defaultValue - Key to use if the attribute is missing.
name != null
name is a valid XML identifier
public java.lang.Object getAttribute(java.lang.String name,
java.util.Map valueSet,
java.lang.String defaultKey,
boolean allowLiterals)
As an example, if valueSet contains the mapping "one" =>
"1"
and the element contains the attribute attr="one", then
getAttribute("attr", mapping, defaultKey, false) returns
"1".
name - The name of the attribute.valueSet - HashMap mapping keySet().iterator to values.defaultKey - Key to use if the attribute is missing.allowLiterals - true if literals are valid.
name != null
name is a valid XML identifier
valueSet != null
valueSet are strings
setAttribute(String, Object),
removeAttribute(String),
enumerateAttributeNames(),
getAttribute(String),
getAttribute(String, Object)public java.lang.String getStringAttribute(java.lang.String name)
null is returned.
name - The name of the attribute.
name != null
name is a valid XML identifier
setAttribute(String, Object),
removeAttribute(String),
enumerateAttributeNames(),
getStringAttribute(String, String),
getStringAttribute(String, HashMap, String, boolean)
public java.lang.String getStringAttribute(java.lang.String name,
java.lang.String defaultValue)
defaultValue is returned.
name - The name of the attribute.defaultValue - Key to use if the attribute is missing.
name != null
name is a valid XML identifier
setAttribute(String, Object),
removeAttribute(String),
enumerateAttributeNames(),
getStringAttribute(String),
getStringAttribute(String, HashMap, String, boolean)
public java.lang.String getStringAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiterals)
As an example, if valueSet contains the mapping "one" =>
"1"
and the element contains the attribute attr="one", then
getAttribute("attr", mapping, defaultKey, false) returns
"1".
name - The name of the attribute.valueSet - HashMap mapping keySet().iterator to values.defaultKey - Key to use if the attribute is missing.allowLiterals - true if literals are valid.
name != null
name is a valid XML identifier
valueSet != null
valueSet are strings
valueSet are strings
setAttribute(String, Object),
removeAttribute(String),
enumerateAttributeNames(),
getStringAttribute(String),
getStringAttribute(String, String)public int getIntAttribute(java.lang.String name)
0 is returned.
name - The name of the attribute.
name != null
name is a valid XML identifier
setIntAttribute(String, int),
enumerateAttributeNames(),
getIntAttribute(String, int),
getIntAttribute(String, HashMap, String, boolean)
public int getIntAttribute(java.lang.String name,
int defaultValue)
defaultValue is returned.
name - The name of the attribute.defaultValue - Key to use if the attribute is missing.
name != null
name is a valid XML identifier
setIntAttribute(String, int),
enumerateAttributeNames(),
getIntAttribute(String),
getIntAttribute(String, HashMap, String, boolean)
public int getIntAttribute(java.lang.String name,
int min,
int max,
int defaultValue)
public int getIntAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiteralNumbers)
As an example, if valueSet contains the mapping "one" => 1
and the element contains the attribute attr="one", then
getIntAttribute("attr", mapping, defaultKey, false) returns
1.
name - The name of the attribute.valueSet - HashMap mapping keySet().iterator to values.defaultKey - Key to use if the attribute is missing.allowLiteralNumbers - true if literal numbers are valid.
name != null
name is a valid XML identifier
valueSet != null
valueSet are strings
valueSet are Integer objects
defaultKey is either null, a
key in valueSet or an integer.
setIntAttribute(String, int),
enumerateAttributeNames(),
getIntAttribute(String),
getIntAttribute(String, int)public double getDoubleAttribute(java.lang.String name)
0.0 is returned.
name - The name of the attribute.
name != null
name is a valid XML identifier
setDoubleAttribute(String, double),
enumerateAttributeNames(),
getDoubleAttribute(String, double),
getDoubleAttribute(String, HashMap, String, boolean)
public double getDoubleAttribute(java.lang.String name,
double defaultValue)
defaultValue is returned.
name - The name of the attribute.defaultValue - Key to use if the attribute is missing.
name != null
name is a valid XML identifier
setDoubleAttribute(String, double),
enumerateAttributeNames(),
getDoubleAttribute(String),
getDoubleAttribute(String, HashMap, String, boolean)
public double getDoubleAttribute(java.lang.String name,
java.util.HashMap valueSet,
java.lang.String defaultKey,
boolean allowLiteralNumbers)
As an example, if valueSet contains the mapping "one" =>
1.0
and the element contains the attribute attr="one", then
getDoubleAttribute("attr", mapping, defaultKey, false)
returns 1.0.
name - The name of the attribute.valueSet - HashMap mapping keySet().iterator to values.defaultKey - Key to use if the attribute is missing.allowLiteralNumbers - true if literal numbers are valid.
name != null
name is a valid XML identifier
valueSet != null
valueSet are strings
valueSet are Double objects
defaultKey is either null, a
key in valueSet or a double.
setDoubleAttribute(String, double),
enumerateAttributeNames(),
getDoubleAttribute(String),
getDoubleAttribute(String, double)
public boolean getBooleanAttribute(java.lang.String name,
java.lang.String trueValue,
java.lang.String falseValue,
boolean defaultValue)
defaultValue is returned.
If the value of the attribute is equal to trueValue,
true is returned.
If the value of the attribute is equal to falseValue,
false is returned.
If the value doesn't match trueValue or
falseValue, an exception is thrown.
name - The name of the attribute.trueValue - The value associated with true.falseValue - The value associated with true.defaultValue - Value to use if the attribute is missing.
name != null
name is a valid XML identifier
trueValue and falseValue
are different strings.
setAttribute(String, Object),
removeAttribute(String),
enumerateAttributeNames()
public boolean getBooleanAttribute(java.lang.String name,
boolean defaultValue)
public java.lang.String getName()
setName(String)
public void parseFromReader(java.io.Reader reader)
throws java.io.IOException,
XMLParseException
reader - The reader from which to retrieve the XML data.
reader != null
reader is not closed
java.io.IOException - If an error occured while reading the input.
XMLParseException - If an error occured while parsing the read data.
public void parseFromReader(java.io.Reader reader,
int startingLineNr)
throws java.io.IOException,
XMLParseException
reader - The reader from which to retrieve the XML data.startingLineNr - The line number of the first line in the data.
reader != null
reader is not closed
java.io.IOException - If an error occured while reading the input.
XMLParseException - If an error occured while parsing the read data.
public void parseString(java.lang.String string)
throws XMLParseException
string - The reader from which to retrieve the XML data.
string != null
string.length() > 0
XMLParseException - If an error occured while parsing the string.
public void parseString(java.lang.String string,
int offset)
throws XMLParseException
string - The reader from which to retrieve the XML data.offset - The first character in string to scan.
string != null
offset < string.length()
offset >= 0
XMLParseException - If an error occured while parsing the string.
public void parseString(java.lang.String string,
int offset,
int end)
throws XMLParseException
string - The reader from which to retrieve the XML data.offset - The first character in string to scan.end - The character where to stop scanning.
This character is not scanned.
string != null
end <= string.length()
offset < end
offset >= 0
XMLParseException - If an error occured while parsing the string.
public void parseString(java.lang.String string,
int offset,
int end,
int startingLineNr)
throws XMLParseException
string - The reader from which to retrieve the XML data.offset - The first character in string to scan.end - The character where to stop scanning.
This character is not scanned.startingLineNr - The line number of the first line in the data.
string != null
end <= string.length()
offset < end
offset >= 0
XMLParseException - If an error occured while parsing the string.
public void parseCharArray(char[] input,
int offset,
int end)
throws XMLParseException
input - The reader from which to retrieve the XML data.offset - The first character in string to scan.end - The character where to stop scanning.
This character is not scanned.
input != null
end <= input.length
offset < end
offset >= 0
XMLParseException - If an error occured while parsing the string.
public void parseCharArray(char[] input,
int offset,
int end,
int startingLineNr)
throws XMLParseException
input - The reader from which to retrieve the XML data.offset - The first character in string to scan.end - The character where to stop scanning.
This character is not scanned.startingLineNr - The line number of the first line in the data.
input != null
end <= input.length
offset < end
offset >= 0
XMLParseException - If an error occured while parsing the string.public void removeChild(XMLElement child)
child - The child element to remove.
child != null
child is a child element of the receiver
addChild(XMLElement),
countChildren(),
iterateChildren(),
getChildren()public void removeAttribute(java.lang.String name)
name - The name of the attribute.
name != null
name is a valid XML identifier
null
public XMLElement createElement(java.lang.String name)
protected XMLElement createElement()
You should override this method when subclassing XMLElement.
public void setContent(java.lang.String content)
content - The new content string.public void setName(java.lang.String name)
name - The new name.
name != null
name is a valid XML identifier
getName()public java.lang.String toString()
toString in class java.lang.Objectwrite(Writer)
public void write(java.io.Writer writer)
throws java.io.IOException
writer - The writer to write the XML data to.
writer != null
writer is not closed
java.io.IOException - If the data could not be written to the writer.toString()public void print(java.io.PrintWriter writer)
writer - The writer to write the XML data to.
writer != null
writer is not closed
java.io.IOException - If the data could not be written to the writer.toString()
protected void print(java.io.PrintWriter writer,
int indent)
writer - The writer to write the XML data to.
writer != null
writer is not closed
indent - The indentation.
java.io.IOException - If the data could not be written to the writer.toString()
protected void writeEncoded(java.io.Writer writer,
java.lang.String str)
throws java.io.IOException
writer - The writer to write the XML data to.str - The string to write encoded.
writer != null
writer is not closed
str != null
java.io.IOException
protected void scanIdentifier(java.lang.StringBuffer result)
throws java.io.IOException
result.
result - The buffer in which the scanned identifier will be put.
result != null
java.io.IOException
protected char scanWhitespace()
throws java.io.IOException
java.io.IOException
protected char scanWhitespace(java.lang.StringBuffer result)
throws java.io.IOException
result.
result != null
java.io.IOException
protected void scanString(java.lang.StringBuffer string)
throws java.io.IOException
string.
string != null
java.io.IOException
protected void scanPCData(java.lang.StringBuffer data)
throws java.io.IOException
data.
data != null
java.io.IOException
protected boolean checkCDATA(java.lang.StringBuffer buf)
throws java.io.IOException
buf.
buf != null
java.io.IOException
protected void skipComment()
throws java.io.IOException
java.io.IOException
protected void skipSpecialTag(int bracketLevel)
throws java.io.IOException
bracketLevel - The number of open square brackets ([) that have
already been read.
bracketLevel >= 0
java.io.IOException
protected boolean checkLiteral(java.lang.String literal)
throws java.io.IOException
literal - the literal to check.
literal != null
java.io.IOException
protected char readChar()
throws java.io.IOException
java.io.IOException
protected void scanElement(XMLElement elt)
throws java.io.IOException
elt - The element that will contain the result.
elt != null
java.io.IOException
protected void resolveEntity(java.lang.StringBuffer buf)
throws java.io.IOException
buf.
buf - Where to put the entity value.
buf != null
java.io.IOExceptionprotected void unreadChar(char ch)
ch - The character to push back.
ch != '\0'
protected XMLParseException invalidValueSet(java.lang.String name)
name - The name of the entity.
name != null
protected XMLParseException invalidValue(java.lang.String name,
java.lang.String value)
name - The name of the entity.value - The value of the entity.
name != null
value != null
protected XMLParseException unexpectedEndOfData()
protected XMLParseException syntaxError(java.lang.String context)
context - The context in which the error occured.
context != null
context.length() > 0
protected XMLParseException expectedInput(java.lang.String charSet)
charSet - The set of characters (in human readable form) that was
expected.
charSet != null
charSet.length() > 0
protected XMLParseException unknownEntity(java.lang.String name)
name - The name of the entity.
name != null
name.length() > 0
|
Copyright 1996-2006 © JHotDraw.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||