|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
gate.creole.CreoleXmlHandler
This is a SAX handler for processing creole.xml
files.
It would have been better to write it using DOM or JDOM but....
Resource data objects are created and added to the CREOLE register.
URLs for resource JAR files are added to the GATE class loader.
Field Summary | |
private SimpleErrorHandler |
_seh
This object indicates what to do when the parser encounts an error |
private StringBuffer |
contentBuffer
This is used to capture all data within two tags before calling the actual characters method |
private Stack |
contentStack
A stack to stuff PCDATA onto for reading back at element ends. |
private URL |
creoleFileUrl
The URL to the creole.xml file being parsed. |
private Attributes |
currentAttributes
The current element's attribute list |
private FeatureMap |
currentAutoinstanceParams
This field represents the params map required for autoinstantiation Its a map from param name to param value. |
private List |
currentAutoinstances
This field holds autoinstanceParams describing the resource that needs to be instantiated |
private Parameter |
currentParam
The current parameter |
private List |
currentParamDisjunction
The current parameter disjunction |
private ParameterList |
currentParamList
The current parameter list |
private static boolean |
DEBUG
Debug flag |
private boolean |
readCharacterStatus
This is a variable that shows if characters have been read |
private CreoleRegister |
register
The register object that we add ResourceData objects to during parsing. |
private ResourceData |
resourceData
The current resource data object |
private URL |
sourceUrl
The source URL of the directory file being parsed. |
Constructor Summary | |
CreoleXmlHandler(CreoleRegister register,
URL directoryUrl,
URL creoleFileUrl)
Construction |
Method Summary | |
private String |
attributes2String(Attributes atts)
A verboase method for Attributes |
void |
characters(char[] text,
int start,
int length)
Called when the SAX parser encounts text (PCDATA) in the XML doc |
void |
charactersAction(char[] text,
int start,
int length)
This method is called when all characters between specific tags have been read completely |
private void |
checkStack(String methodName,
String elementName)
Utility function to throw exceptions on stack errors. |
void |
endDocument()
Called when the SAX parser encounts the end of the XML document |
void |
endElement(String uri,
String qName,
String elementName)
Called when the SAX parser encounts the end of an XML element. |
void |
error(SAXParseException ex)
Called for parse errors. |
void |
fatalError(SAXParseException ex)
Called for fatal errors. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Called when the SAX parser encounts white space |
void |
startDocument()
Called when the SAX parser encounts the beginning of the XML document |
void |
startElement(String uri,
String qName,
String elementName,
Attributes atts)
Called when the SAX parser encounts the beginning of an XML element |
void |
warning(SAXParseException ex)
Called for warnings. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, 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 |
Field Detail |
private Stack contentStack
private ResourceData resourceData
private ParameterList currentParamList
private List currentParamDisjunction
private Parameter currentParam
private Attributes currentAttributes
private static final boolean DEBUG
private URL sourceUrl
private URL creoleFileUrl
private SimpleErrorHandler _seh
private FeatureMap currentAutoinstanceParams
private List currentAutoinstances
private StringBuffer contentBuffer
private boolean readCharacterStatus
private CreoleRegister register
Constructor Detail |
public CreoleXmlHandler(CreoleRegister register, URL directoryUrl, URL creoleFileUrl)
Method Detail |
public void startDocument() throws GateSaxException
GateSaxException
public void endDocument() throws GateSaxException
GateSaxException
private String attributes2String(Attributes atts)
public void startElement(String uri, String qName, String elementName, Attributes atts) throws SAXException
SAXException
private void checkStack(String methodName, String elementName) throws GateSaxException
GateSaxException
public void endElement(String uri, String qName, String elementName) throws GateSaxException, SAXException
GateSaxException
SAXException
public void characters(char[] text, int start, int length) throws SAXException
SAXException
public void charactersAction(char[] text, int start, int length) throws SAXException
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
SAXException
public void error(SAXParseException ex) throws SAXException
SAXException
public void fatalError(SAXParseException ex) throws SAXException
SAXException
public void warning(SAXParseException ex) throws SAXException
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |