org.apache.poi.ss.usermodel.FormulaError#isValidCode ( )源码实例Demo

下面列出了org.apache.poi.ss.usermodel.FormulaError#isValidCode ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: ErrorConstant.java

public static ErrorConstant valueOf(int errorCode) {
    if (FormulaError.isValidCode(errorCode)) {
   		switch (FormulaError.forInt(errorCode)) {
   			case NULL:  return NULL;
   			case DIV0:  return DIV_0;
   			case VALUE: return VALUE;
   			case REF:   return REF;
   			case NAME:  return NAME;
   			case NUM:   return NUM;
   			case NA:	return NA;
   			default:    break;
   		}
    }
	logger.log( POILogger.WARN, "Warning - unexpected error code (" + errorCode + ")");
	return new ErrorConstant(errorCode);
}
 
源代码2 项目: lams   文件: ErrorEval.java

/**
 * Converts error codes to text.  Handles non-standard error codes OK.  
 * For debug/test purposes (and for formatting error messages).
 * @return the String representation of the specified Excel error code.
 */
public static String getText(int errorCode) {
    if(FormulaError.isValidCode(errorCode)) {
        return FormulaError.forInt(errorCode).getString();
    }
    // Give a special string, based on ~, to make clear this isn't a standard Excel error
    return "~non~std~err(" + errorCode + ")~";
}
 
源代码3 项目: lams   文件: ErrPtg.java

/** Creates new ErrPtg */

    private ErrPtg(int errorCode) {
        if(!FormulaError.isValidCode(errorCode)) {
            throw new IllegalArgumentException("Invalid error code (" + errorCode + ")");
        }
        field_1_error_code = errorCode;
    }
 
源代码4 项目: lams   文件: ErrorConstant.java

public String getText() {
	if(FormulaError.isValidCode(_errorCode)) {
		return FormulaError.forInt(_errorCode).getString();
	}
	return "unknown error code (" + _errorCode + ")";
}