Browse Source

Handle ejb-ref elements.

Ignore the <home> and <remote> elements in the embedded within <ejb-ref> elements.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268187 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
8f6213f9f3
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java

+ 15
- 1
src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java View File

@@ -74,6 +74,7 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
* Bunch of constants used for storing entries in a hashtable, and for
* constructing the filenames of various parts of the ejb jar.
*/
private static final String EJB_REF = "ejb-ref";
private static final String HOME_INTERFACE = "home";
private static final String REMOTE_INTERFACE = "remote";
private static final String BEAN_CLASS = "ejb-class";
@@ -102,6 +103,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
private Hashtable resourceDTDs = new Hashtable();

private boolean inEJBRef = false;

/**
* The directory containing the bean classes and interfaces. This is
* used for performing dependency file lookups.
@@ -160,6 +163,7 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
public void startDocument() throws SAXException {
this.ejbFiles = new Hashtable(10, 1);
this.currentElement = null;
inEJBRef = false;
}


@@ -173,7 +177,10 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
public void startElement(String name, AttributeList attrs)
throws SAXException {
this.currentElement = name;
currentText = "";
currentText = "";
if (name.equals(EJB_REF)) {
inEJBRef = true;
}
}


@@ -190,6 +197,9 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
processElement();
currentText = "";
this.currentElement = "";
if (name.equals(EJB_REF)) {
inEJBRef = false;
}
}

/**
@@ -215,6 +225,10 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {
protected void processElement() {
if (inEJBRef) {
return;
}
if (currentElement.equals(HOME_INTERFACE) ||
currentElement.equals(REMOTE_INTERFACE) ||
currentElement.equals(BEAN_CLASS) ||


Loading…
Cancel
Save