|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.uwyn.rife.xml.Xml2Data
com.uwyn.rife.database.Xml2Datasources
public class Xml2Datasources
This class parses an XML file to create a set of Datasource
objects.
An example of the parsable datasource file:
<datasources>
<datasource name="postgres">
<driver>org.postgresql.Driver</driver>
<url>jdbc:postgres://localhost/database</url>
<user>username</user>
<password>password</user>
<poolsize>5</poolsize>
</datasource>
</datasources>
An explaination of terms:
| Constructor Summary | |
|---|---|
Xml2Datasources()
|
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Called when text data is encountered, usually between tags. |
protected void |
clear()
Clears the information in this datasource. |
void |
endElement(String namespaceURI,
String localName,
String qName)
Called when the end tag of an XML element is encountered |
HashMap<String,Datasource> |
getDatasources()
Return the created datasources. |
void |
startDocument()
Called when the beginng of the document to be parsed is found |
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
Called when the start tag of an XML element is encountered |
| Methods inherited from class com.uwyn.rife.xml.Xml2Data |
|---|
createErrorRedirector, disableValidation, enableValidation, error, fatalError, getErrorRedirector, getResourceFinder, getXmlPath, processXml, processXml, processXml, warning |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Xml2Datasources()
| Method Detail |
|---|
public HashMap<String,Datasource> getDatasources()
protected void clear()
public void startDocument()
startDocument in interface ContentHandlerstartDocument in class DefaultHandler
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
startElement in interface ContentHandlerstartElement in class DefaultHandlernamespaceURI - the URI of the namespace of the start taglocalName - the local name of the starting elementqName - the qualified name of the starting elementatts - the attributes of the starting element
public void endElement(String namespaceURI,
String localName,
String qName)
endElement in interface ContentHandlerendElement in class DefaultHandlernamespaceURI - the URI of the namespace of the ending elementlocalName - the local name of the ending elementqName - the qualified name of the ending element
public void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerch - a character array of the encountered text contentstart - the index in the array at which the content startslength - the length of the data stored in the character array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||