|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
crn.CRNFileParser
Parses the XML file containg the description of the CRN.
Field Summary | |
private java.util.Hashtable |
caseReferences
The hashtable mapping the IEs to the ArrayLists containg the names of referring cases (Strings). |
private java.util.ArrayList |
cases
A list of parsed cases. |
private IE |
currentIE
The current IE tag. |
private java.util.ArrayList |
ies
A list of parsed IEs. |
private boolean |
inCases
Indicates whether the parser is in the Cases section. |
private boolean |
inIE
Indicates whether the parser is in the IE section. |
private boolean |
inIEs
Indicates whether the parser is in the IEs section. |
private boolean |
inWeights
Indicates whether the parser is in the Weights section. |
private org.xml.sax.Locator |
locator
The SAX locator. |
private java.util.Hashtable |
weights
The hashtable mapping the IEs' names (String) to their values (Float). |
Constructor Summary | |
CRNFileParser()
Constructor. |
Method Summary | |
private void |
ClearData()
Clears all the internal data, so the parser is ready to parse a new file. |
private static javax.xml.parsers.SAXParser |
CreateSAXParser()
Creates an instance of the SAXParser. |
void |
endElement(java.lang.String uriNamespace,
java.lang.String qualifiedName,
java.lang.String simpleName)
|
private CRN |
GetCRN()
Creates the CRN according to the data read from the file. |
CRN |
Parse(java.lang.String fileName)
Parses the given file. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
|
void |
startElement(java.lang.String uriNamespace,
java.lang.String simpleName,
java.lang.String qualifiedName,
org.xml.sax.Attributes attributes)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Hashtable caseReferences
private java.util.Hashtable weights
private IE currentIE
private java.util.ArrayList cases
private java.util.ArrayList ies
private boolean inCases
private boolean inIEs
private boolean inIE
private boolean inWeights
private org.xml.sax.Locator locator
Constructor Detail |
public CRNFileParser()
Method Detail |
public CRN Parse(java.lang.String fileName) throws java.lang.Exception, java.io.IOException, org.xml.sax.SAXException
fileName
- The name of the file to be parsed.
java.lang.Exception
- Thrown in case of error.
java.io.IOException
- In case of any IO error.
org.xml.sax.SAXException
- In case of some parsing error.private void ClearData()
private CRN GetCRN()
private static javax.xml.parsers.SAXParser CreateSAXParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
- If it was imposible to create a parser satisfing the current configuration.
org.xml.sax.SAXException
public void startElement(java.lang.String uriNamespace, java.lang.String simpleName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
org.xml.sax.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String uriNamespace, java.lang.String qualifiedName, java.lang.String simpleName)
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void setDocumentLocator(org.xml.sax.Locator locator)
ContentHandler.setDocumentLocator(org.xml.sax.Locator)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |