standardoutview.java
来自「《基于Eclipse的开源框架技术与实战》[第9章]随书源码」· Java 代码 · 共 40 行
JAVA
40 行
package com.free.spring.ioc;
/**
* <p>Title: Eclipse Plugin Development</p>
* <p>Description: Free download</p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: Free</p>
* @author gan.shu.man
* @version 1.0
*/
public class StandardOutView implements View {
//待注入的模型
private Model model = null;
/**
* 处理模型注入的信息
* */
public void render() {
//判断模型是否注入
if (model == null) {
throw new RuntimeException(
"You must set the property model of class:"
+ StandardOutView.class.getName());
}
//打印模型的注入信息
System.out.println(model.getMessage());
}
public void setModel(Model m) {
this.model = m;
}
public Model getModel() {
return this.model;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?