alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (FieldBuilder.scala)

This example Scala source code file (FieldBuilder.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

constructorinfo, fieldbuilder, fieldinfo, int, int, io, object, object, pecustommod, setconstant, setoffset, string, type, visitable, visitable

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

 

new blog posts

 

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.