package sds.assemble;

import sds.classfile.ConstantPool;
import sds.classfile.MemberInfo;
import sds.classfile.attributes.AttributeInfo;
import sds.classfile.attributes.AttributeType;
import sds.classfile.attributes.ConstantValue;

/**
 * This class is for contents of field.
 * @author inagaki
 */
public class FieldContent extends MemberContent {
	/**
	 * constructor.
	 * @param info field info
	 * @param pool constant-pool
	 */
	public FieldContent(MemberInfo info, ConstantPool pool) {
		super(info, pool, Type.Field);
		for(AttributeInfo attr : info.getAttr().getAll()) {
			investigateAttribute(attr, pool);
		}
	}

	@Override
	public void investigateAttribute(AttributeInfo info, ConstantPool pool) {
		if(info.getType() == AttributeType.ConstantValue) {
			ConstantValue cv = (ConstantValue)info;
		} else {
			super.investigateAttribute(info, pool);
		}
	}
}
@@ -226,16 +226,68 @@
 Value;%0A%0A
+import static sds.util.Utf8ValueExtractor.extract;%0A%0A
 /**%0A * T
@@ -395,16 +395,43 @@
 ntent %7B%0A
+%09private String constVal;%0A%0A
 %09/**%0A%09 *
@@ -886,63 +886,388 @@
 ;%0A%09%09
-%7D else %7B%0A%09%09%09super.investigateAttribute(info, pool);%0A%09%09%7D
+%09this.constVal = extract(pool.get(cv.getConstantValueIndex()-1), pool);%0A%09%09%7D else %7B%0A%09%09%09super.investigateAttribute(info, pool);%0A%09%09%7D%0A%09%7D%0A%0A%09/**%0A%09 * returns constant value of field.%3Cbr%3E%0A%09 * when field type is primitive or String and field access flag doesn't contain final%0A%09 * , this method returns null.%0A%09 * @return constant value%0A%09 */%0A%09public String getConstVal() %7B%0A%09%09return constVal;
 %0A%09%7D%0A

fix #26.