org.testng.xml
Class TestNGContentHandler

java.lang.Object  extended by org.xml.sax.helpers.DefaultHandler      extended by org.testng.xml.TestNGContentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class TestNGContentHandler
extends DefaultHandler

Suite definition parser utility.

Author:
Cedric Beust, Alexandru Popescu


Constructor Summary
TestNGContentHandler(String fileName, boolean loadClasses)
           
 
Method Summary
 voidcharacters(char[] ch, int start, int length)
           
 voidendElement(String uri, String localName, String qName)
           
 voiderror(SAXParseException e)
           
 XmlSuitegetSuite()
           
 InputSourceresolveEntity(String systemId, String publicId)
           
 voidstartElement(String uri, String localName, String qName, Attributes attributes)
          NOTE: I only invoke xml*methods (e.g.
 voidxmlClasses(boolean start, Attributes attributes)
          Parse
 voidxmlGroup(boolean start, Attributes attributes)
          Parse
 voidxmlListener(boolean start, Attributes attributes)
          Parse
 voidxmlListeners(boolean start, Attributes attributes)
          Parse
 voidxmlMethodSelector(boolean start, Attributes attributes)
          Parse
 voidxmlMethodSelectors(boolean start, Attributes attributes)
          Parse
 voidxmlPackages(boolean start, Attributes attributes)
          Parse
 voidxmlRun(boolean start, Attributes attributes)
          Parse
 voidxmlSelectorClass(boolean start, Attributes attributes)
          Parse
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestNGContentHandler

public TestNGContentHandler(String fileName,                            boolean loadClasses)
Method Detail

resolveEntity

public InputSource resolveEntity(String systemId,                                 String publicId)                          throws IOException,                                 SAXException
Specified by:
resolveEntity in interface EntityResolver
Overrides:
resolveEntity in class DefaultHandler
Throws:
IOException
SAXException

xmlClasses

public void xmlClasses(boolean start,                       Attributes attributes)
Parse


xmlListeners

public void xmlListeners(boolean start,                         Attributes attributes)
Parse


xmlListener

public void xmlListener(boolean start,                        Attributes attributes)
Parse


xmlPackages

public void xmlPackages(boolean start,                        Attributes attributes)
Parse


xmlMethodSelectors

public void xmlMethodSelectors(boolean start,                               Attributes attributes)
Parse


xmlSelectorClass

public void xmlSelectorClass(boolean start,                             Attributes attributes)
Parse


xmlMethodSelector

public void xmlMethodSelector(boolean start,                              Attributes attributes)
Parse


xmlRun

public void xmlRun(boolean start,                   Attributes attributes)            throws SAXException
Parse

Throws:
SAXException

xmlGroup

public void xmlGroup(boolean start,                     Attributes attributes)              throws SAXException
Parse

Throws:
SAXException

startElement

public void startElement(String uri,                         String localName,                         String qName,                         Attributes attributes)                  throws SAXException
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 interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,                       String localName,                       String qName)                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

error

public void error(SAXParseException e)           throws SAXException
Specified by:
error in interface ErrorHandler
Overrides:
error in class DefaultHandler
Throws:
SAXException

characters

public void characters(char[] ch,                       int start,                       int length)
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler

getSuite

public XmlSuite getSuite()


Copyright © 2012. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14