Author: dims
Date: Sun Feb 4 13:03:29 2007
New Revision: 503483
URL: http://svn.apache.org/viewvc?view=rev&rev=503483
Log:
Check for the data handler awareness flag *only* when we create the omtext,
otherwise it is totally unnecessary, update poms with newer version of woodstox
& exclude log4j
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
webservices/commons/trunk/modules/axiom/pom.xml
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?view=diff&rev=503483&r1=503482&r2=503483
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
Sun Feb 4 13:03:29 2007
@@ -73,9 +73,6 @@
protected boolean parserAccessed = false;
protected OMDocument document;
- protected boolean isDataHandlerAware = false;
-
-
/**
* Constructor StAXBuilder.
*
@@ -86,17 +83,6 @@
this.parser = parser;
omfactory = ombuilderFactory;
- // check whether data handlers are treated seperately
- try {
- if (parser != null && (Boolean.TRUE ==
parser.getProperty(OMConstants.IS_DATA_HANDLERS_AWARE))) {
- isDataHandlerAware = true;
- }
- } catch (IllegalArgumentException e) {
- // according to the parser api, get property will return
IllegalArgumentException, when that
- // property is not found.
- isDataHandlerAware = false;
- }
-
if(parser instanceof BuilderAwareReader) {
((BuilderAwareReader) parser).setBuilder(this);
}
@@ -208,7 +194,7 @@
*/
private OMNode createOMText(OMContainer omContainer, int textType) {
try {
- if (isDataHandlerAware && Boolean.TRUE ==
parser.getProperty(OMConstants.IS_BINARY)) {
+ if (isDataHandlerAware(parser) && Boolean.TRUE ==
parser.getProperty(OMConstants.IS_BINARY)) {
Object dataHandler =
parser.getProperty(OMConstants.DATA_HANDLER);
OMText text = omfactory.createOMText(dataHandler, true);
omContainer.addChild(text);
@@ -516,5 +502,24 @@
*/
public Object getReaderProperty(String name) throws
IllegalArgumentException {
return parser.getProperty(name);
- }
+ }
+
+ /**
+ * Check if the underlying parse is aware of data handlers. (example ADB
generated code)
+ *
+ * @param parser
+ * @return
+ */
+ private boolean isDataHandlerAware(XMLStreamReader parser) {
+ // check whether data handlers are treated seperately
+ try {
+ if (parser != null && (Boolean.TRUE ==
parser.getProperty(OMConstants.IS_DATA_HANDLERS_AWARE))) {
+ return true;
+ }
+ } catch (IllegalArgumentException e) {
+ // according to the parser api, get property will return
IllegalArgumentException, when that
+ // property is not found.
+ }
+ return false;
+ }
}
Modified: webservices/commons/trunk/modules/axiom/pom.xml
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/pom.xml?view=diff&rev=503483&r1=503482&r2=503483
==============================================================================
--- webservices/commons/trunk/modules/axiom/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/pom.xml Sun Feb 4 13:03:29 2007
@@ -393,12 +393,16 @@
<artifactId>logkit</artifactId>
<groupId>logkit</groupId>
</exclusion>
+ <exclusion>
+ <artifactId>log4j</artifactId>
+ <groupId>log4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>woodstox</groupId>
<artifactId>wstx-asl</artifactId>
- <version>3.0.0</version>
+ <version>3.2.0</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]