Package org.testng.xml
Class TestNGContentHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.testng.xml.TestNGContentHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
public class TestNGContentHandler extends org.xml.sax.helpers.DefaultHandler
Suite definition parser utility.
-
-
Constructor Summary
Constructors Constructor Description TestNGContentHandler(java.lang.String fileName, boolean loadClasses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
void
error(org.xml.sax.SAXParseException e)
XmlSuite
getSuite()
org.xml.sax.InputSource
resolveEntity(java.lang.String systemId, java.lang.String publicId)
void
startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
NOTE: I only invoke xml*methods (e.g.void
xmlClasses(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlGroup(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlGroups(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlListener(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlListeners(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlMethodSelector(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlMethodSelectors(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlPackages(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlRun(boolean start, org.xml.sax.Attributes attributes)
Parsevoid
xmlSelectorClass(boolean start, org.xml.sax.Attributes attributes)
Parse
-
-
-
Method Detail
-
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String systemId, java.lang.String publicId) throws java.io.IOException, org.xml.sax.SAXException
- Specified by:
resolveEntity
in interfaceorg.xml.sax.EntityResolver
- Overrides:
resolveEntity
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
java.io.IOException
org.xml.sax.SAXException
-
xmlClasses
public void xmlClasses(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlListeners
public void xmlListeners(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlListener
public void xmlListener(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlPackages
public void xmlPackages(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlMethodSelectors
public void xmlMethodSelectors(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlSelectorClass
public void xmlSelectorClass(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlMethodSelector
public void xmlMethodSelector(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlRun
public void xmlRun(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlGroup
public void xmlGroup(boolean start, org.xml.sax.Attributes attributes)
Parse
-
xmlGroups
public void xmlGroups(boolean start, org.xml.sax.Attributes attributes)
Parse
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
NOTE: I only invoke xml*methods (e.g. xmlSuite()) if I am acting on both the start and the end of the tag. This way I can keep the treatment of this tag in one place. If I am only doing something when the tag opens, the code is inlined below in the startElement() method.- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
startElement
in classorg.xml.sax.helpers.DefaultHandler
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Overrides:
endElement
in classorg.xml.sax.helpers.DefaultHandler
-
error
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
- Specified by:
error
in interfaceorg.xml.sax.ErrorHandler
- Overrides:
error
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] ch, int start, int length)
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classorg.xml.sax.helpers.DefaultHandler
-
getSuite
public XmlSuite getSuite()
-
-