incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [10/50] [abbrv] Merge commit. TABS ARE NOT SPACES
Date Thu, 07 Jun 2012 20:20:53 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/0ad9ff0d/framework/src/org/apache/cordova/api/PluginResult.java
----------------------------------------------------------------------
diff --cc framework/src/org/apache/cordova/api/PluginResult.java
index 8f5f7fd,73efab9..4d05ddd
--- a/framework/src/org/apache/cordova/api/PluginResult.java
+++ b/framework/src/org/apache/cordova/api/PluginResult.java
@@@ -21,99 -21,99 +21,99 @@@ package org.apache.cordova.api
  import org.json.JSONArray;
  import org.json.JSONObject;
  
 -import android.util.Log;
 +//import android.util.Log;
  
  public class PluginResult {
 -	private final int status;
 -	private final String message;
 -	private boolean keepCallback = false;
 -	
 -	public PluginResult(Status status) {
 -		this.status = status.ordinal();
 -		this.message = "'" + PluginResult.StatusMessages[this.status] + "'";
 -	}
 -	
 -	public PluginResult(Status status, String message) {
 -		this.status = status.ordinal();
 -		this.message = JSONObject.quote(message);
 -	}
 +    private final int status;
 +    private final String message;
 +    private boolean keepCallback = false;
- 
++    
 +    public PluginResult(Status status) {
 +        this.status = status.ordinal();
 +        this.message = "'" + PluginResult.StatusMessages[this.status] + "'";
 +    }
- 
++    
 +    public PluginResult(Status status, String message) {
 +        this.status = status.ordinal();
 +        this.message = JSONObject.quote(message);
 +    }
  
 -	public PluginResult(Status status, JSONArray message) {
 -		this.status = status.ordinal();
 -		this.message = message.toString();
 -	}
 +    public PluginResult(Status status, JSONArray message) {
 +        this.status = status.ordinal();
 +        this.message = message.toString();
 +    }
  
 -	public PluginResult(Status status, JSONObject message) {
 -		this.status = status.ordinal();
 -		this.message = message.toString();
 -	}
 +    public PluginResult(Status status, JSONObject message) {
 +        this.status = status.ordinal();
 +        this.message = message.toString();
 +    }
  
 -	public PluginResult(Status status, int i) {
 -		this.status = status.ordinal();
 -		this.message = ""+i;
 -	}
 +    public PluginResult(Status status, int i) {
 +        this.status = status.ordinal();
-         this.message = "" + i;
++        this.message = ""+i;
 +    }
  
 -	public PluginResult(Status status, float f) {
 -		this.status = status.ordinal();
 -		this.message = ""+f;
 -	}
 +    public PluginResult(Status status, float f) {
 +        this.status = status.ordinal();
-         this.message = "" + f;
++        this.message = ""+f;
 +    }
  
 -	public PluginResult(Status status, boolean b) {
 -		this.status = status.ordinal();
 -		this.message = ""+b;
 -	}
 -	
 -	public void setKeepCallback(boolean b) {
 -		this.keepCallback = b;
 -	}
 -	
 -	public int getStatus() {
 -		return status;
 -	}
 +    public PluginResult(Status status, boolean b) {
 +        this.status = status.ordinal();
-         this.message = "" + b;
++        this.message = ""+b;
 +    }
- 
++    
 +    public void setKeepCallback(boolean b) {
 +        this.keepCallback = b;
 +    }
- 
++    
 +    public int getStatus() {
 +        return status;
 +    }
  
 -	public String getMessage() {
 -		return message;
 -	}
 -	
 -	public boolean getKeepCallback() {
 -		return this.keepCallback;
 -	}
 -	
 -	public String getJSONString() {
 -		return "{\"status\":" + this.status + ",\"message\":" + this.message + ",\"keepCallback\":"
+ this.keepCallback + "}";
 -	}
 -	
 -	public String toSuccessCallbackString(String callbackId) {
 -		return "cordova.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");";
 -	}
 -	
 -	public String toErrorCallbackString(String callbackId) {
 -		return "cordova.callbackError('"+callbackId+"', " + this.getJSONString()+ ");";
 -	}
 -	
 -	public static String[] StatusMessages = new String[] {
 -		"No result",
 -		"OK",
 -		"Class not found",
 -		"Illegal access",
 -		"Instantiation error",
 -		"Malformed url",
 -		"IO error",
 -		"Invalid action",
 -		"JSON error",
 -		"Error"
 -	};
 -	
 -	public enum Status {
 -		NO_RESULT,
 -		OK,
 -		CLASS_NOT_FOUND_EXCEPTION,
 -		ILLEGAL_ACCESS_EXCEPTION,
 -		INSTANTIATION_EXCEPTION,
 -		MALFORMED_URL_EXCEPTION,
 -		IO_EXCEPTION,
 -		INVALID_ACTION,
 -		JSON_EXCEPTION,
 -		ERROR
 -	}
 +    public String getMessage() {
 +        return message;
 +    }
- 
++    
 +    public boolean getKeepCallback() {
 +        return this.keepCallback;
 +    }
- 
++    
 +    public String getJSONString() {
-         return "{status:" + this.status + ",message:" + this.message + ",keepCallback:"
+ this.keepCallback + "}";
++        return "{\"status\":" + this.status + ",\"message\":" + this.message + ",\"keepCallback\":"
+ this.keepCallback + "}";
 +    }
- 
++    
 +    public String toSuccessCallbackString(String callbackId) {
-         return "cordova.callbackSuccess('" + callbackId + "'," + this.getJSONString() +
");";
++        return "cordova.callbackSuccess('"+callbackId+"',"+this.getJSONString()+");";
 +    }
- 
++    
 +    public String toErrorCallbackString(String callbackId) {
-         return "cordova.callbackError('" + callbackId + "', " + this.getJSONString() + ");";
++        return "cordova.callbackError('"+callbackId+"', " + this.getJSONString()+ ");";
 +    }
- 
++    
 +    public static String[] StatusMessages = new String[] {
-             "No result",
-             "OK",
-             "Class not found",
-             "Illegal access",
-             "Instantiation error",
-             "Malformed url",
-             "IO error",
-             "Invalid action",
-             "JSON error",
-             "Error"
++        "No result",
++        "OK",
++        "Class not found",
++        "Illegal access",
++        "Instantiation error",
++        "Malformed url",
++        "IO error",
++        "Invalid action",
++        "JSON error",
++        "Error"
 +    };
- 
++    
 +    public enum Status {
 +        NO_RESULT,
 +        OK,
 +        CLASS_NOT_FOUND_EXCEPTION,
 +        ILLEGAL_ACCESS_EXCEPTION,
 +        INSTANTIATION_EXCEPTION,
 +        MALFORMED_URL_EXCEPTION,
 +        IO_EXCEPTION,
 +        INVALID_ACTION,
 +        JSON_EXCEPTION,
 +        ERROR
 +    }
  }


Mime
View raw message