jvanzyl 02/03/22 12:42:43
Modified: src/java/org/apache/stratum/xo Mapper.java
Log:
Gracefully continue to process the XML when an element doesn't match
a bean's properties exactly. The XML file can contain mistakes and we
shouldn't bomb out.
Revision Changes Path
1.18 +7 -4
jakarta-turbine-stratum/src/java/org/apache/stratum/xo/Mapper.java
Index: Mapper.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/xo/Mapper.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Mapper.java 28 Feb 2002 23:22:10 -0000 1.17
+++ Mapper.java 22 Mar 2002 20:42:43 -0000 1.18
@@ -141,7 +141,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: Mapper.java,v 1.17 2002/02/28 23:22:10 jvanzyl Exp $
+ * @version $Id: Mapper.java,v 1.18 2002/03/22 20:42:43 jvanzyl Exp $
*/
// How to use the resources package to pull in the
@@ -471,6 +471,11 @@
if (o == null)
{
o = createInstance((Element) node, null);
+
+ if (o == null)
+ {
+ continue;
+ }
}
// Now we have to attach the newly created object
@@ -634,9 +639,7 @@
}
catch (Exception unknownClass)
{
- throw new Exception("No class name for node '" +
- element.getName() + "': This may be resolved by adding a " +
- CLASS_NAME + " attribute");
+ return null;
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>