You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2008/07/13 14:11:18 UTC

svn commit: r676307 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model: EventMethodModel.java EventModel.java EventProducerModel.java

Author: jeremias
Date: Sun Jul 13 05:11:17 2008
New Revision: 676307

URL: http://svn.apache.org/viewvc?rev=676307&view=rev
Log:
null is not correct here, an empty String needs to be used for the default namespace. Saxon 9 fails with a NullPointerException otherwise. Xalan is more tolerant.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventMethodModel.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventModel.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventProducerModel.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventMethodModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventMethodModel.java?rev=676307&r1=676306&r2=676307&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventMethodModel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventMethodModel.java Sun Jul 13 05:11:17 2008
@@ -37,12 +37,12 @@
 public class EventMethodModel implements Serializable, XMLizable {
 
     private static final long serialVersionUID = -7548882973341444354L;
-    
+
     private String methodName;
     private EventSeverity severity;
     private List params = new java.util.ArrayList();
     private String exceptionClass;
-    
+
     /**
      * Creates an new instance.
      * @param methodName the event method's name
@@ -52,7 +52,7 @@
         this.methodName = methodName;
         this.severity = severity;
     }
-    
+
     /**
      * Adds a method parameter.
      * @param param the method parameter
@@ -60,7 +60,7 @@
     public void addParameter(Parameter param) {
         this.params.add(param);
     }
-    
+
     /**
      * Adds a method parameter.
      * @param type the type of the parameter
@@ -68,11 +68,11 @@
      * @return the resulting Parameter instance
      */
     public Parameter addParameter(Class type, String name) {
-        Parameter param = new Parameter(type, name); 
+        Parameter param = new Parameter(type, name);
         addParameter(param);
         return param;
     }
-    
+
     /**
      * Sets the event method name.
      * @param name the event name
@@ -80,7 +80,7 @@
     public void setMethodName(String name) {
         this.methodName = name;
     }
-    
+
     /**
      * Returns the event method name
      * @return the event name
@@ -88,7 +88,7 @@
     public String getMethodName() {
         return this.methodName;
     }
-    
+
     /**
      * Sets the event's severity level.
      * @param severity the severity
@@ -96,7 +96,7 @@
     public void setSeverity(EventSeverity severity) {
         this.severity = severity;
     }
-    
+
     /**
      * Returns the event's severity level.
      * @return the severity
@@ -104,7 +104,7 @@
     public EventSeverity getSeverity() {
         return this.severity;
     }
-    
+
     /**
      * Returns an unmodifiable list of parameters for this event method.
      * @return the list of parameters
@@ -112,7 +112,7 @@
     public List getParameters() {
         return Collections.unmodifiableList(this.params);
     }
-    
+
     /**
      * Sets the primary exception class for this event method. Note: Not all event methods throw
      * exceptions!
@@ -121,7 +121,7 @@
     public void setExceptionClass(String exceptionClass) {
         this.exceptionClass = exceptionClass;
     }
-    
+
     /**
      * Returns the primary exception class for this event method. This method returns null if
      * the event is only informational or just a warning.
@@ -130,34 +130,34 @@
     public String getExceptionClass() {
         return this.exceptionClass;
     }
-    
+
     /** {@inheritDoc} */
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "name", "name", "CDATA", getMethodName());
-        atts.addAttribute(null, "severity", "severity", "CDATA", getSeverity().getName());
+        atts.addAttribute("", "name", "name", "CDATA", getMethodName());
+        atts.addAttribute("", "severity", "severity", "CDATA", getSeverity().getName());
         if (getExceptionClass() != null) {
-            atts.addAttribute(null, "exception", "exception", "CDATA", getExceptionClass());
+            atts.addAttribute("", "exception", "exception", "CDATA", getExceptionClass());
         }
         String elName = "method";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = this.params.iterator();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
-    
+
     /**
      * Represents an event parameter.
      */
     public static class Parameter implements Serializable, XMLizable {
-        
+
         private static final long serialVersionUID = 6062500277953887099L;
-        
+
         private Class type;
         private String name;
-        
+
         /**
          * Creates a new event parameter.
          * @param type the parameter type
@@ -167,7 +167,7 @@
             this.type = type;
             this.name = name;
         }
-        
+
         /**
          * Returns the parameter type.
          * @return the parameter type
@@ -175,7 +175,7 @@
         public Class getType() {
             return this.type;
         }
-        
+
         /**
          * Returns the parameter name.
          * @return the parameter name
@@ -187,12 +187,12 @@
         /** {@inheritDoc} */
         public void toSAX(ContentHandler handler) throws SAXException {
             AttributesImpl atts = new AttributesImpl();
-            atts.addAttribute(null, "type", "type", "CDATA", getType().getName());
-            atts.addAttribute(null, "name", "name", "CDATA", getName());
+            atts.addAttribute("", "type", "type", "CDATA", getType().getName());
+            atts.addAttribute("", "name", "name", "CDATA", getName());
             String elName = "parameter";
-            handler.startElement(null, elName, elName, atts);
-            handler.endElement(null, elName, elName);
+            handler.startElement("", elName, elName, atts);
+            handler.endElement("", elName, elName);
         }
-        
+
     }
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventModel.java?rev=676307&r1=676306&r2=676307&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventModel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventModel.java Sun Jul 13 05:11:17 2008
@@ -93,12 +93,12 @@
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
         String elName = "event-model";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = getProducers();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
 
     private void writeXMLizable(XMLizable object, File outputFile) throws IOException {

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventProducerModel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventProducerModel.java?rev=676307&r1=676306&r2=676307&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventProducerModel.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/events/model/EventProducerModel.java Sun Jul 13 05:11:17 2008
@@ -35,18 +35,18 @@
 public class EventProducerModel implements Serializable, XMLizable {
 
     private static final long serialVersionUID = 122267104123721902L;
-    
+
     private String interfaceName;
     private Map methods = new java.util.LinkedHashMap();
-    
+
     /**
      * Creates a new instance.
-     * @param interfaceName the fully qualified interface name of the event producer 
+     * @param interfaceName the fully qualified interface name of the event producer
      */
     public EventProducerModel(String interfaceName) {
         this.interfaceName = interfaceName;
     }
-    
+
     /**
      * Returns the fully qualified interface name of the event producer.
      * @return the fully qualified interface name
@@ -54,7 +54,7 @@
     public String getInterfaceName() {
         return this.interfaceName;
     }
-    
+
     /**
      * Sets the fully qualified interface name of the event producer.
      * @param name the fully qualified interface name
@@ -62,7 +62,7 @@
     public void setInterfaceName(String name) {
         this.interfaceName = name;
     }
-    
+
     /**
      * Adds a model instance of an event method.
      * @param method the event method model
@@ -70,7 +70,7 @@
     public void addMethod(EventMethodModel method) {
         this.methods.put(method.getMethodName(), method);
     }
-    
+
     /**
      * Returns the model instance of an event method for the given method name.
      * @param methodName the method name
@@ -79,7 +79,7 @@
     public EventMethodModel getMethod(String methodName) {
         return (EventMethodModel)this.methods.get(methodName);
     }
-    
+
     /**
      * Returns an iterator over the contained event producer methods.
      * @return an iterator (Iterator<EventMethodModel>)
@@ -91,15 +91,15 @@
     /** {@inheritDoc} */
     public void toSAX(ContentHandler handler) throws SAXException {
         AttributesImpl atts = new AttributesImpl();
-        atts.addAttribute(null, "name", "name", "CDATA", getInterfaceName());
+        atts.addAttribute("", "name", "name", "CDATA", getInterfaceName());
         String elName = "producer";
-        handler.startElement(null, elName, elName, atts);
+        handler.startElement("", elName, elName, atts);
         Iterator iter = getMethods();
         while (iter.hasNext()) {
             ((XMLizable)iter.next()).toSAX(handler);
         }
-        handler.endElement(null, elName, elName);
+        handler.endElement("", elName, elName);
     }
 
-    
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org