org.ow2.jonas.generators.wsgen.finder
Class WebServicesXmlFinder

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.ow2.jonas.generators.wsgen.finder.WebServicesXmlFinder
All Implemented Interfaces:
J2EEWebServicesFinder, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class WebServicesXmlFinder
extends DefaultHandler
implements J2EEWebServicesFinder

WebServicesXmlFinder finds out if there is any webservices.xml within the given J2EEArchive.

Author:
Guillaume Sauthier

Constructor Summary
WebServicesXmlFinder(J2EEArchive archive)
          Constructs a WebServicesXmlFinder that will explore the given J2EEArchive.
 
Method Summary
 boolean find()
           
 void init(SAXParser parser)
          Explore the archive and find a webservices.xml.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Receive notification of the start of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, 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

WebServicesXmlFinder

public WebServicesXmlFinder(J2EEArchive archive)
Constructs a WebServicesXmlFinder that will explore the given J2EEArchive.

Parameters:
archive - archive to explore.
Method Detail

find

public boolean find()
Specified by:
find in interface J2EEWebServicesFinder
Returns:
Returns true if webservices have been found.
See Also:
J2EEWebServicesFinder.find()

init

public void init(SAXParser parser)
Explore the archive and find a webservices.xml. If found, parse the file and observe the 'version' attribute.

Parameters:
parser - SAX Parser

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri - The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
localName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
attributes - The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)


Copyright © 2010 OW2 Consortium. All Rights Reserved.