|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.purl.sword.base.XmlElement
public abstract 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 static String[] |
DATE_FORMATS
Array of possible date formats that are permitted for date elements. |
protected XmlName |
xmlName
|
| Constructor Summary | |
|---|---|
XmlElement(String localName)
Create a new instance. |
|
XmlElement(String prefix,
String localName)
Create a new instance. |
|
XmlElement(String prefix,
String localName,
String namespaceUri)
Create a new insatnce. |
|
XmlElement(XmlName name)
|
|
| Method Summary | |
|---|---|
protected SwordValidationInfo |
createValidAttributeInfo(String name,
String content)
|
String |
getQualifiedName()
Retrieve the qualified name for this object. |
String |
getQualifiedName(String name)
Retrieve the qualified name. |
String |
getQualifiedNameWithPrefix(String prefix,
String name)
Get the qualified name for the given prefix and name |
XmlName |
getXmlName()
|
protected SwordValidationInfo |
handleIncorrectElement(nu.xom.Element element,
Properties validationProperties)
|
protected boolean |
isInstanceOf(nu.xom.Element element,
String localName,
String namespaceURI)
Determines if the specified element is an instance of the element name. |
protected boolean |
isInstanceOf(nu.xom.Element element,
XmlName xmlName)
|
protected void |
processUnexpectedAttributes(nu.xom.Element element,
ArrayList<SwordValidationInfo> attributeItems)
|
protected void |
processUnexpectedAttributes(nu.xom.Element element,
SwordValidationInfo info)
Add the information to the unmarshall attribute section of the specified info object. |
protected boolean |
unmarshallBoolean(nu.xom.Element element)
Extract a boolean 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. |
abstract SwordValidationInfo |
validate(Properties validationContext)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected XmlName xmlName
protected static final String DATE_FORMAT
protected static final String[] DATE_FORMATS
| Constructor Detail |
|---|
public XmlElement(String localName)
localName - The local name for the element.
public XmlElement(String prefix,
String localName)
prefix - The prefix for the element.localName - The local name for the element.
public XmlElement(String prefix,
String localName,
String namespaceUri)
prefix - The prefix.localName - The element's local name.namespaceUri - The namespace URI.public XmlElement(XmlName name)
name - | Method Detail |
|---|
public XmlName getXmlName()
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 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.
protected boolean isInstanceOf(nu.xom.Element element,
XmlName xmlName)
element - xmlName -
public String getQualifiedName()
public String getQualifiedName(String name)
name - the specified local name.
public String getQualifiedNameWithPrefix(String prefix,
String name)
prefix - the prefixname - the name
public abstract SwordValidationInfo validate(Properties validationContext)
protected void processUnexpectedAttributes(nu.xom.Element element,
ArrayList<SwordValidationInfo> attributeItems)
protected void processUnexpectedAttributes(nu.xom.Element element,
SwordValidationInfo info)
element - info -
protected SwordValidationInfo handleIncorrectElement(nu.xom.Element element,
Properties validationProperties)
throws UnmarshallException
UnmarshallException
protected SwordValidationInfo createValidAttributeInfo(String name,
String content)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||