mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
Adding headers and converting tabs to spaces
This commit is contained in:
parent
6312457425
commit
34840175f3
File diff suppressed because it is too large
Load Diff
@ -1,41 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package org.apache.cordova;
|
package org.apache.cordova;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Exception class representing defined Globalization error codes
|
* @description Exception class representing defined Globalization error codes
|
||||||
* @Globalization error codes:
|
* @Globalization error codes:
|
||||||
* GlobalizationError.UNKNOWN_ERROR = 0;
|
* GlobalizationError.UNKNOWN_ERROR = 0;
|
||||||
* GlobalizationError.FORMATTING_ERROR = 1;
|
* GlobalizationError.FORMATTING_ERROR = 1;
|
||||||
* GlobalizationError.PARSING_ERROR = 2;
|
* GlobalizationError.PARSING_ERROR = 2;
|
||||||
* GlobalizationError.PATTERN_ERROR = 3;
|
* GlobalizationError.PATTERN_ERROR = 3;
|
||||||
*/
|
*/
|
||||||
public class GlobalizationError extends Exception{
|
public class GlobalizationError extends Exception{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
public static final String UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
public static final String UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
||||||
public static final String FORMATTING_ERROR = "FORMATTING_ERROR";
|
public static final String FORMATTING_ERROR = "FORMATTING_ERROR";
|
||||||
public static final String PARSING_ERROR = "PARSING_ERROR";
|
public static final String PARSING_ERROR = "PARSING_ERROR";
|
||||||
public static final String PATTERN_ERROR = "PATTERN_ERROR";
|
public static final String PATTERN_ERROR = "PATTERN_ERROR";
|
||||||
|
|
||||||
int error = 0; //default unknown error thrown
|
int error = 0; //default unknown error thrown
|
||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*/
|
*/
|
||||||
public GlobalizationError() {}
|
public GlobalizationError() {}
|
||||||
/**
|
/**
|
||||||
* Create an exception returning an error code
|
* Create an exception returning an error code
|
||||||
*
|
*
|
||||||
* @param s
|
* @param s
|
||||||
*/
|
*/
|
||||||
public GlobalizationError(String s) {
|
public GlobalizationError(String s) {
|
||||||
if (s.equalsIgnoreCase(FORMATTING_ERROR)){
|
if (s.equalsIgnoreCase(FORMATTING_ERROR)){
|
||||||
error = 1;
|
error = 1;
|
||||||
}else if (s.equalsIgnoreCase(PARSING_ERROR)){
|
}else if (s.equalsIgnoreCase(PARSING_ERROR)){
|
||||||
error = 2;
|
error = 2;
|
||||||
}else if (s.equalsIgnoreCase(PATTERN_ERROR)){
|
}else if (s.equalsIgnoreCase(PATTERN_ERROR)){
|
||||||
error = 3;
|
error = 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* get error string based on error code
|
* get error string based on error code
|
||||||
@ -43,30 +62,30 @@ public class GlobalizationError extends Exception{
|
|||||||
* @param String msg
|
* @param String msg
|
||||||
*/
|
*/
|
||||||
public String getErrorString(){
|
public String getErrorString(){
|
||||||
String msg = "";
|
String msg = "";
|
||||||
switch (error){
|
switch (error){
|
||||||
case 0:
|
case 0:
|
||||||
msg = UNKNOWN_ERROR;
|
msg = UNKNOWN_ERROR;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
msg = FORMATTING_ERROR;
|
msg = FORMATTING_ERROR;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
msg = PARSING_ERROR;
|
msg = PARSING_ERROR;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
msg = PATTERN_ERROR;
|
msg = PATTERN_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* get error code
|
* get error code
|
||||||
*
|
*
|
||||||
* @param String msg
|
* @param String msg
|
||||||
*/
|
*/
|
||||||
public int getErrorCode(){
|
public int getErrorCode(){
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user