|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.purl.sword.base.XmlElement
public class XmlElement
Parent class for all classes that represent an XML element. This provides some common utility methods that are useful for marshalling and unmarshalling data.
| Field Summary | |
|---|---|
protected static String |
DATE_FORMAT
The Date format that is used to parse dates to and from the ISO format in the XML data. |
protected String |
localName
|
protected String |
prefix
The name to use for the prefix. |
| Constructor Summary | |
|---|---|
XmlElement(String localName)
|
|
XmlElement(String prefix,
String localName)
Create a new instance. |
|
| Method Summary | |
|---|---|
protected String |
dateToString(Date date)
Convert the date to a string. |
String |
getQualifiedName()
Retrieve the qualified name for this object. |
String |
getQualifiedName(String name)
Retrieve the qualified name. |
protected boolean |
isInstanceOf(nu.xom.Element element,
String localName,
String namespaceURI)
Determines if the specified element is an instance of the element name. |
protected Date |
stringToDate(String date)
Convert the string into a Date object. |
protected boolean |
unmarshallBoolean(nu.xom.Element element)
Extract a boolean value from the specified element. |
protected Date |
unmarshallDate(nu.xom.Element element)
Extract an date value from the specified element. |
protected int |
unmarshallInteger(nu.xom.Element element)
Extract an integer value from the specified element. |
protected String |
unmarshallString(nu.xom.Element element)
Extract a string value from the specified element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String prefix
protected String localName
protected static final String DATE_FORMAT
| Constructor Detail |
|---|
public XmlElement(String localName)
localName -
public XmlElement(String prefix,
String localName)
| Method Detail |
|---|
protected boolean unmarshallBoolean(nu.xom.Element element)
throws UnmarshallException
element - The element that contains the boolean value.
UnmarshallException - If the element does not contain a single child, or if
the child does not contain the value 'true' or 'false'.
protected String unmarshallString(nu.xom.Element element)
throws UnmarshallException
element - The element that contains the string value.
UnmarshallException - If the element does not contain a single child.
protected int unmarshallInteger(nu.xom.Element element)
throws UnmarshallException
element - The element that contains the integer.
UnmarshallException - If the element does not contain a single child, or if
the child does not contain the valid integer.
protected Date unmarshallDate(nu.xom.Element element)
throws UnmarshallException
element - The element that contains the date.
UnmarshallException - If the element does not contain a single child, or if
the child does not contain the valid date.protected String dateToString(Date date)
date - The Date object.
protected Date stringToDate(String date)
throws ParseException
date - The date, represented as a string.
ParseException - If the string does not match the format
of yyyy-MM-ddTHH:mm:ssZ.
protected boolean isInstanceOf(nu.xom.Element element,
String localName,
String namespaceURI)
element - The specified element.localName - The local name for the element.namespaceURI - The namespace for the element.
public String getQualifiedName()
public String getQualifiedName(String name)
name - the specified local name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||