stringfield.java

来自「工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本」· Java 代码 · 共 61 行

JAVA
61
字号
package com.utstar.fcs.domain.workinstruction.field;

import com.utstar.fcs.domain.workinstruction.Field;



public class StringField extends Field{
	private String value;
	
	public static String SINGLE_LINE="single_line";
	public static String MULTIPLE_LINE="multiple_line";
	
	public static String OPTION="option";

	public static StringField getSample(String parameter1,String parameter2){
		
		
		StringField sf = new StringField();
		
		if(parameter1==null)
			parameter1 = SINGLE_LINE;
		
		if(parameter1.equals(MULTIPLE_LINE))
			sf.setValue("PowerDesigner, a model-driven approach to align business and IT, is an enterprise modeling and design solution that helps implement effective Enterprise Architecture and brings a powerful meta-data management environment to your application development life cycle."
						+ "\nPowerDesigner uniquely combines several standard modeling techniques (UML, Business Process Modeling and market-leading data modeling) together with leading development environments such as .NET, Workspace, PowerBuilder, Java, Eclipse, etc., to bring business analysis and formal design processes to the traditional software development lifecycle. And it works with all modern RDBMSs");	
		else if(parameter1.equals(OPTION))
			sf.setValue(parameter2.split(",")[0]);
		else
			sf.setValue("abc");
		
		return sf;
	}
	
	@Override
	protected Object clone() throws CloneNotSupportedException {
		
		StringField field = (StringField) super.clone();
		field.setValue(value);
		
		return field;
	}
	
	@Override
	public String toString() {
	
		return value;
	}
	
	public String getValue() {
		return value;
	}

	@Override
	public void setValue(String value) {
		this.value = value;
	}	
	
	
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?