ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkapu...@apache.org
Subject svn commit: r328480 - in /incubator/woden/java/src/org/apache/woden: ErrorInfo.java internal/ErrorInfoImpl.java
Date Tue, 25 Oct 2005 20:59:27 GMT
Author: jkaputin
Date: Tue Oct 25 13:59:20 2005
New Revision: 328480

URL: http://svn.apache.org/viewcvs?rev=328480&view=rev
Log:
Remove the fields baseURI, locURI, lineNo, ColNo and 
added a field for ErrorLocator which now encapsulates
that location info. Also changed the Throwable arg
on two reportError methods to Exception instead

Modified:
    incubator/woden/java/src/org/apache/woden/ErrorInfo.java
    incubator/woden/java/src/org/apache/woden/internal/ErrorInfoImpl.java

Modified: incubator/woden/java/src/org/apache/woden/ErrorInfo.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/ErrorInfo.java?rev=328480&r1=328479&r2=328480&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/ErrorInfo.java (original)
+++ incubator/woden/java/src/org/apache/woden/ErrorInfo.java Tue Oct 25 13:59:20 2005
@@ -16,27 +16,22 @@
 package org.apache.woden;
 
 /**
- * This interface describes the three types of errors (warning, error
- * and fatal error) that may be reported. 
- * Implementations may choose to override the java.lang.Object 
- * <code>toString()</code> method to concatenate this information into 
- * a single string for reporting purposes.
+ * This interface describes the three types of errors 
+ * (warning, error and fatal error) that may be reported. 
+ * Implementations may choose to override the 
+ * <code>toString()</code> method inherited from java.lang.Object 
+ * to concatenate this information into format suitable for
+ * reporting purposes.
  *
  * @author kaputin
  */
 public interface ErrorInfo {
 
-    public String getBaseDocumentURI();
-
-    public String getLocationURI();
-
-    public int getLineNumber();
-
-    public int getColumnNumber();
+    public ErrorLocator getErrorLocator();
 
     public String getKey();
 
     public String getMessage();
     
-    public Throwable getThrowable();
+    public Exception getException();
 }

Modified: incubator/woden/java/src/org/apache/woden/internal/ErrorInfoImpl.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/ErrorInfoImpl.java?rev=328480&r1=328479&r2=328480&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/ErrorInfoImpl.java (original)
+++ incubator/woden/java/src/org/apache/woden/internal/ErrorInfoImpl.java Tue Oct 25 13:59:20
2005
@@ -16,6 +16,7 @@
 package org.apache.woden.internal;
 
 import org.apache.woden.ErrorInfo;
+import org.apache.woden.ErrorLocator;
 
 /**
  * This class is a data object containing the information needed
@@ -32,47 +33,26 @@
     
     //TODO decide if properties captured here are sufficient for reporting needs.
     
-    private String fBaseDocumentURI;
-    private String fLocationURI;
-    private int fLineNumber;
-    private int fColumnNumber;
+    private ErrorLocator fErrLoc;
     private String fKey;
     private String fMessage;
-    private Throwable fThrowable;
+    private Exception fException;
 
-    public ErrorInfoImpl(String baseDocumentURI,
-                            String locationURI,
-                            int lineNumber,
-                            int columnNumber,
-                            String key, 
-                            String message,
-                            Throwable throwable) 
+    public ErrorInfoImpl(ErrorLocator errorLocator,
+                         String key, 
+                         String message,
+                         Exception exception) 
     {
-        fBaseDocumentURI = baseDocumentURI;
-        fLocationURI = locationURI;
-        fLineNumber = lineNumber;
-        fColumnNumber = columnNumber;
+        fErrLoc = errorLocator;
         fKey = key;
         fMessage = message;
-        fThrowable = throwable;
+        fException = exception;
     }
     
-    public String getBaseDocumentURI() {
-        return fBaseDocumentURI;
+    public ErrorLocator getErrorLocator() {
+        return fErrLoc;
     }
 
-    public String getLocationURI() {
-        return fLocationURI;
-    }
-    
-    public int getLineNumber() {
-        return fLineNumber;
-    }
-    
-    public int getColumnNumber() {
-        return fColumnNumber;
-    }
-    
     public String getKey() {
         return fKey;
     }
@@ -81,23 +61,26 @@
         return fMessage;
     }
     
-    public Throwable getThrowable() {
-        return fThrowable;
+    public Exception getException() {
+        return fException;
     }
     
     public String toString() {
         
         StringBuffer sb = new StringBuffer();
         
-        sb.append("Key=" + (fKey != null ? fKey : "null"));
-        sb.append("\nMessage=" + (fMessage != null ? fMessage : "null"));
-        sb.append("\nBaseDocumentURI=" + (fBaseDocumentURI != null ? fBaseDocumentURI : "null"));
-        sb.append("\nLocationURI=" + (fLocationURI != null ? fLocationURI : "null"));
-        sb.append("\nLineNumber=" + fLineNumber);
-        sb.append("\nColumnNumber=" + fColumnNumber);
-        if(fThrowable != null) {
-            sb.append("\nException=" + fThrowable.getClass().getName() + 
-                      ": " + fThrowable.getMessage());
+        if(fErrLoc != null)
+        {
+            sb.append(fErrLoc.getLineNumber() + ":" + 
+                      fErrLoc.getColumnNumber() + ",");
+        }
+        
+        sb.append(fKey + ",");
+        sb.append(fMessage + ",");
+        
+        if(fException != null) {
+            sb.append(fException.getClass().getName() + ":" +
+                      fException.getMessage());
         }
         
         return sb.toString();



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Mime
View raw message