org.objectweb.jonas.ant.DescriptorHandler Class Reference

List of all members.

Public Member Functions

Hashtable getFiles ()
String getPublicId ()
String getEjbName ()
void startDocument () throws SAXException
void startElement (String uri, String localname, String qname, Attributes attrs) throws SAXException
void endElement (String uri, String localname, String qname) throws SAXException
void characters (char[] ch, int start, int length) throws SAXException

Protected Attributes

String currentElement = null
String currentText = null
Hashtable ejbFiles = null
String ejbName = null

Detailed Description

Inner class used by EjbJar to facilitate the parsing of deployment descriptors and the capture of appropriate information. Extends HandlerBase so it only implements the methods needed. During parsing creates a hashtable consisting of entries mapping the name it should be inserted into an EJB jar as to a File representing the file on disk. This list can then be accessed through the getFiles() method.

Definition at line 79 of file DescriptorHandler.java.


Member Function Documentation

void org.objectweb.jonas.ant.DescriptorHandler.characters char[]  ch,
int  start,
int  length
throws SAXException
 

SAX parser call-back method invoked whenever characters are located within an element. currentAttribute (modified by startElement and endElement) tells us whether we are in an interesting element (one of the up to four classes of an EJB). If so then converts the classname from the format org.apache.tools.ant.Parser to the convention for storing such a class, org/apache/tools/ant/Parser.class. This is then resolved into a file object under the srcdir which is stored in a Hashtable.

Parameters:
ch A character array containing all the characters in the element, and maybe others that should be ignored.
start An integer marking the position in the char array to start reading from.
length An integer representing an offset into the char array where the current data terminates.

Definition at line 390 of file DescriptorHandler.java.

References org.objectweb.jonas.ant.DescriptorHandler.currentText.

void org.objectweb.jonas.ant.DescriptorHandler.endElement String  uri,
String  localname,
String  qname
throws SAXException
 

SAX parser call-back method that is invoked when an element is exited. Used to blank out (set to the empty string, not nullify) the name of the currentAttribute. A better method would be to use a stack as an instance variable, however since we are only interested in leaf-node data this is a simpler and workable solution.

Parameters:
name The name of the attribute being exited. Ignored in this implementation.

Definition at line 348 of file DescriptorHandler.java.

References org.objectweb.jonas.ant.DescriptorHandler.currentText.

String org.objectweb.jonas.ant.DescriptorHandler.getEjbName  ) 
 

Getter method that returns the value of the <ejb-name> element.

Definition at line 280 of file DescriptorHandler.java.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.getJarBaseName().

Hashtable org.objectweb.jonas.ant.DescriptorHandler.getFiles  ) 
 

Getter method that returns the set of files to include in the EJB jar.

Definition at line 266 of file DescriptorHandler.java.

References org.objectweb.jonas.ant.DescriptorHandler.ejbFiles.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.parseEjbFiles().

String org.objectweb.jonas.ant.DescriptorHandler.getPublicId  ) 
 

Get the publicId of the DTD

Definition at line 273 of file DescriptorHandler.java.

Referenced by org.objectweb.jonas.ant.GenericDeploymentTool.getPublicId().

void org.objectweb.jonas.ant.DescriptorHandler.startDocument  )  throws SAXException
 

SAX parser call-back method that is used to initialize the values of some instance variables to ensure safe operation.

Definition at line 288 of file DescriptorHandler.java.

void org.objectweb.jonas.ant.DescriptorHandler.startElement String  uri,
String  localname,
String  qname,
Attributes  attrs
throws SAXException
 

SAX parser call-back method that is invoked when a new element is entered into. Used to store the context (attribute name) in the currentAttribute instance variable.

Parameters:
uri The namespace of the element being entered.
localname The name of the element being entered.
qname The qname of the element being entered.
attrs Attributes associated to the element.

Definition at line 304 of file DescriptorHandler.java.

References org.objectweb.jonas.ant.DescriptorHandler.currentText.


Member Data Documentation

String org.objectweb.jonas.ant.DescriptorHandler.currentElement = null [protected]
 

Instance variable used to store the name of the current element being processed by the SAX parser. Accessed by the SAX parser call-back methods startElement() and endElement().

Definition at line 143 of file DescriptorHandler.java.

String org.objectweb.jonas.ant.DescriptorHandler.currentText = null [protected]
 

The text of the current element

Definition at line 148 of file DescriptorHandler.java.

Referenced by org.objectweb.jonas.ant.DescriptorHandler.characters(), org.objectweb.jonas.ant.DescriptorHandler.endElement(), and org.objectweb.jonas.ant.DescriptorHandler.startElement().

Hashtable org.objectweb.jonas.ant.DescriptorHandler.ejbFiles = null [protected]
 

Instance variable that stores the names of the files as they will be put into the jar file, mapped to File objects Accessed by the SAX parser call-back method characters().

Definition at line 155 of file DescriptorHandler.java.

Referenced by org.objectweb.jonas.ant.DescriptorHandler.getFiles().

String org.objectweb.jonas.ant.DescriptorHandler.ejbName = null [protected]
 

Instance variable that stores the value found in the <ejb-name> element

Definition at line 160 of file DescriptorHandler.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:07 2005 for JOnAS by  doxygen 1.3.9.1