|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.groboclown.xml.resource.v1.XMLBaseResource
A base XML resource class, which implements the IXMLResource in an easily subclassable way, such that each subclass can use the IXMLSubResource interface.
Defined as abstract, because it doesn't do anything on its own.
Constructor Summary | |
XMLBaseResource()
|
Method Summary | |
protected void |
finishedXMLLoading()
Called when the XML element has completed loading its attributes and all of its children. |
void |
initializeAttributesFromXML(String uri,
String localName,
String rawName,
Attributes attributes,
IXMLResource parent)
Called when the instance is being initialized with XML attribute data. |
void |
initializeChildrenFromXML(IXMLResource[] children)
Called when the instance is being initialized with its XML children. |
void |
initializeDataFromXML(char[] ch,
int start,
int length)
Called when the instance is being initialized with XML character data. |
protected boolean |
loadXMLChild(IXMLResource child)
Called when the instance is being initialized with its XML children. |
protected boolean |
parseXMLAttribute(String uri,
String localName,
String rawName,
String name,
String value,
IXMLResource parent)
Called when the instance is being initialized with XML attribute data. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public XMLBaseResource()
Method Detail |
public void initializeAttributesFromXML(String uri, String localName, String rawName, Attributes attributes, IXMLResource parent) throws SAXException
initializeAttributesFromXML
in interface IXMLResource
uri
- the URI of the element tag's namespace.localName
- name of the XML element tag without the namespace.rawName
- full name of the XML element, with namespace.attributes
- list of all attributes and their values and types.parent
- the parent node who contains this node. Useful if the
children need to register themselves with the parent. Can be
null
if this node has no parent.SAXException
- thrown on any kind of error.public void initializeDataFromXML(char[] ch, int start, int length) throws SAXException
This implementation doesn't do anything.
initializeDataFromXML
in interface IXMLResource
ch
- a part of the XML data. It should never be used outside
the boundaries of the other parameters.start
- the start of the character data ch
where
this data is found.length
- the length of the character data in ch
where
this data is found.SAXException
- thrown on any kind of error.public void initializeChildrenFromXML(IXMLResource[] children) throws SAXException
initializeChildrenFromXML
in interface IXMLResource
children
- the IXMLResource
instances loaded
from the XML file, who were contained within this instance's
XML start and end tags.SAXException
- thrown on any kind of error.protected boolean parseXMLAttribute(String uri, String localName, String rawName, String name, String value, IXMLResource parent) throws SAXException
Subclasses which extend this method must have at the beginning:
if (super.parseXMLAttribute( uri, localName, rawName, name, value, parent )) return true;
uri
- the URI of the element tag's namespace.localName
- name of the XML element tag without the namespace.rawName
- full name of the XML element, with namespace.name
- the attribute namevalue
- the attribute valueparent
- the parent node who contains this node. Useful if the
children need to register themselves with the parent. Can be
null
if this node has no parent.SAXException
- thrown on any kind of error.protected boolean loadXMLChild(IXMLResource child) throws SAXException
Subclasses which extend this method must have at the beginning:
if (super.loadXMLChild( child )) return true;
children
- the IXMLResource
instances loaded
from the XML file, who were contained within this instance's
XML start and end tags.SAXException
- thrown on any kind of error.protected void finishedXMLLoading() throws SAXException
You should call the super's version of this method before using your own implementation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |