JavaCompilerCore/src/de/dhbwstuttgart/bytecode/FieldInfo.java
2014-10-09 12:01:16 +02:00

204 lines
5.1 KiB
Java
Executable File

// ino.module.FieldInfo.8546.package
package de.dhbwstuttgart.bytecode;
// ino.end
// ino.module.FieldInfo.8546.import
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import de.dhbwstuttgart.logger.Logger;
// ino.end
import de.dhbwstuttgart.myexception.JVMCodeException;
// ino.class.FieldInfo.22068.declaration
public class FieldInfo implements ClassFileMember
// ino.end
// ino.class.FieldInfo.22068.body
{
// ino.attribute.codegenlog.22071.decldescription type=line
// Logger fuer Code-Gen
// ino.end
// ino.attribute.codegenlog.22071.declaration
protected static Logger codegenlog = Logger.getLogger("codegen");
// ino.end
// ino.attribute.name.22074.declaration
private String name;
// ino.end
// ino.attribute.type.22077.declaration
private String type;
// ino.end
// ino.attribute.class_name.22080.declaration
private String class_name;
// ino.end
// ino.attribute.access_flags.22083.declaration
private short access_flags;
// ino.end
// ino.attribute.name_index.22086.declaration
private short name_index;
// ino.end
// ino.attribute.descriptor_index.22089.declaration
private short descriptor_index;
// ino.end
// ino.attribute.attributes.22092.declaration
private Vector<Attribute> attributes = new Vector<Attribute>(); // attribute
// ino.end
// ino.method.get_Name.22095.definition
public String get_Name()
// ino.end
// ino.method.get_Name.22095.body
{
return this.name;
}
// ino.end
// ino.method.get_Type.22098.definition
public String get_Type()
// ino.end
// ino.method.get_Type.22098.body
{
return this.type;
}
// ino.end
// ino.method.get_Class_Name.22101.definition
public String get_Class_Name()
// ino.end
// ino.method.get_Class_Name.22101.body
{
return this.class_name;
}
// ino.end
// ino.method.get_access_flags.22104.definition
public short get_access_flags()
// ino.end
// ino.method.get_access_flags.22104.body
{
return this.access_flags;
}
// ino.end
// ino.method.get_name_index.22107.definition
public short get_name_index()
// ino.end
// ino.method.get_name_index.22107.body
{
return this.name_index;
}
// ino.end
// ino.method.get_descriptor_index.22110.definition
public short get_descriptor_index()
// ino.end
// ino.method.get_descriptor_index.22110.body
{
return this.descriptor_index;
}
// ino.end
// ino.method.get_attributes.22113.definition
public Vector<Attribute> get_attributes()
// ino.end
// ino.method.get_attributes.22113.body
{
return this.attributes;
}
// ino.end
// ino.method.set_Name.22116.definition
public void set_Name(String t)
// ino.end
// ino.method.set_Name.22116.body
{
this.name = t;
}
// ino.end
// ino.method.set_Type.22119.definition
public void set_Type(String t)
// ino.end
// ino.method.set_Type.22119.body
{
this.type = t;
}
// ino.end
// ino.method.set_Class_Name.22122.definition
public void set_Class_Name(String t)
// ino.end
// ino.method.set_Class_Name.22122.body
{
this.class_name = t;
}
// ino.end
// ino.method.set_access_flags.22125.definition
public void set_access_flags(short t)
// ino.end
// ino.method.set_access_flags.22125.body
{
this.access_flags = t;
}
// ino.end
// ino.method.set_name_index.22128.definition
public void set_name_index(short t)
// ino.end
// ino.method.set_name_index.22128.body
{
this.name_index = t;
}
// ino.end
// ino.method.set_descriptor_index.22131.definition
public void set_descriptor_index(short t)
// ino.end
// ino.method.set_descriptor_index.22131.body
{
this.descriptor_index = t;
}
// ino.end
// ino.method.set_attributes.22134.definition
public void set_attributes(Vector<Attribute> t)
// ino.end
// ino.method.set_attributes.22134.body
{
this.attributes = t;
}
// ino.end
// ino.method.codegen.22137.definition
@Override
public void codegen(ClassFile classfile, OutputStream f)
throws IOException, JVMCodeException
// ino.end
// ino.method.codegen.22137.body
{
classfile.writeShort(f, access_flags);
classfile.writeShort(f, name_index);
classfile.writeShort(f, descriptor_index);
codegenlog.debug("FieldInfo: acc_flag=" + access_flags
+ ", name_index=" + name_index + ", descriptor_index="
+ descriptor_index + ", attributes_count=" + attributes.size());
classfile.writeShort(f, (short) attributes.size()); // attributes_count=0
for (int i = 0; i < attributes.size(); i++) { // attributes
attributes.elementAt(i).codegen(classfile, f);
}
}
// ino.end
}
// ino.end