|
Scala example source code file (FieldBuilder.scala)
The Scala FieldBuilder.scala source code/* * System.Reflection.Emit-like API for writing .NET assemblies to MSIL */ package ch.epfl.lamp.compiler.msil.emit import ch.epfl.lamp.compiler.msil.FieldInfo import ch.epfl.lamp.compiler.msil.Type import ch.epfl.lamp.compiler.msil.FieldAttributes import ch.epfl.lamp.compiler.msil.ConstructorInfo import ch.epfl.lamp.compiler.msil.util.PECustomMod import java.io.IOException /** * Discovers the attributes of a field and provides access to field metadata. * * @author Nikolay Mihaylov * @version 1.0 */ class FieldBuilder(name: String, declType: Type, attrs: Int, fieldTypeWithMods: PECustomMod) extends FieldInfo(name, declType, attrs, fieldTypeWithMods, null) with ICustomAttributeSetter with Visitable { //########################################################################## // public interface /** Sets a custom attribute. */ def SetCustomAttribute(constr: ConstructorInfo, value: Array[Byte]) { addCustomAttribute(constr, value) } //########################################################################## /** the apply method for a visitor */ @throws(classOf[IOException]) def apply(v: Visitor) { v.caseFieldBuilder(this) } //########################################################################## protected var defaultValue: Object = _ /** Sets the default value of this field. */ def SetConstant(defaultValue: Object) { this.defaultValue = defaultValue } /** Specifies the field layout. */ def SetOffset(iOffset: Int) { //this.fieldOffset = FieldAttributes.Offset.Value(iOffset) } //########################################################################## } Other Scala examples (source code examples)Here is a short list of links related to this Scala FieldBuilder.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.