Browse Source

jfinal 3.5

James 7 years ago
parent
commit
2227583cd5

+ 6 - 6
src/main/java/com/jfinal/render/JsonRender.java

@@ -81,17 +81,17 @@ public class JsonRender extends Render {
 	 * 1: 官方的 MIME type为application/json, 见 http://en.wikipedia.org/wiki/MIME_type
 	 * 2: IE 不支持 application/json, 在 ajax 上传文件完成后返回 json时 IE 提示下载文件
 	 */
-	private static final String contentType = "application/json; charset=" + getEncoding();
-	private static final String contentTypeForIE = "text/html; charset=" + getEncoding();
-	private boolean forIE = false;
+	protected static final String contentType = "application/json; charset=" + getEncoding();
+	protected static final String contentTypeForIE = "text/html; charset=" + getEncoding();
+	protected boolean forIE = false;
 	
 	public JsonRender forIE() {
 		forIE = true;
 		return this;
 	}
 	
-	private String jsonText;
-	private String[] attrs;
+	protected String jsonText;
+	protected String[] attrs;
 	
 	public JsonRender() {
 		
@@ -146,7 +146,7 @@ public class JsonRender extends Render {
 	}
 	
 	@SuppressWarnings({"rawtypes", "unchecked"})
-	private void buildJsonText() {
+	protected void buildJsonText() {
 		Map map = new HashMap();
 		if (attrs != null) {
 			for (String key : attrs) {

+ 6 - 6
src/main/java/com/jfinal/render/QrCodeRender.java

@@ -18,10 +18,10 @@ import java.util.Map;
  */
 public class QrCodeRender extends Render {
 
-	private String content;
-	private int width;
-	private int height;
-	private ErrorCorrectionLevel errorCorrectionLevel;
+	protected String content;
+	protected int width;
+	protected int height;
+	protected ErrorCorrectionLevel errorCorrectionLevel;
 
 	/**
 	 * 构造方法,经测试不指定纠错参数时,默认使用的是 'L' 最低级别纠错参数
@@ -56,7 +56,7 @@ public class QrCodeRender extends Render {
 		init(content, width, height, errorCorrectionLevel);
 	}
 
-	private void init(String content, int width, int height, char errorCorrectionLevel) {
+	protected void init(String content, int width, int height, char errorCorrectionLevel) {
 		if (errorCorrectionLevel == 'H') {
 			init(content, width, height, ErrorCorrectionLevel.H);
 		} else if (errorCorrectionLevel == 'Q') {
@@ -70,7 +70,7 @@ public class QrCodeRender extends Render {
 		}
 	}
 
-	private void init(String content, int width, int height, ErrorCorrectionLevel errorCorrectionLevel) {
+	protected void init(String content, int width, int height, ErrorCorrectionLevel errorCorrectionLevel) {
 		if (StrKit.isBlank(content)) {
 			throw new IllegalArgumentException("content 不能为空");
 		}

+ 3 - 3
src/main/java/com/jfinal/render/RedirectRender.java

@@ -24,9 +24,9 @@ import com.jfinal.core.JFinal;
  */
 public class RedirectRender extends Render {
 	
-	private String url;
-	private boolean withQueryString;
-	private static final String contextPath = getContxtPath();
+	protected String url;
+	protected boolean withQueryString;
+	protected static final String contextPath = getContxtPath();
 	
 	static String getContxtPath() {
 		String cp = JFinal.me().getContextPath();

+ 3 - 3
src/main/java/com/jfinal/render/TextRender.java

@@ -25,10 +25,10 @@ import java.io.PrintWriter;
 public class TextRender extends Render {
 	
 	// 与 encoding 与 contentType 在 render() 方法中分开设置,效果相同
-	private static final String DEFAULT_CONTENT_TYPE = "text/plain";
+	protected static final String DEFAULT_CONTENT_TYPE = "text/plain";
 	
-	private String text;
-	private String contentType;
+	protected String text;
+	protected String contentType;
 	
 	public TextRender(String text) {
 		this.text = text;