Created
September 1, 2010 15:16
-
-
Save aalmiray/560836 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package a | |
import org.codehaus.griffon.runtime.core.AbstractGriffonModel | |
class AModel extends AbstractGriffonModel { | |
var input: String = "" | |
var output: String = "" | |
// must make getters/setters explicit so that the Griffon runtime | |
// can call the appropriate method. Scala follows a non-JavaBeans | |
// convention for defining properties | |
def getInput():String = input | |
def setInput(in: String) = firePropertyChange("input", input, input = in) | |
def getOutput():String = output | |
def setOutput(out: String) = firePropertyChange("output", output, output = out) | |
} |
I did but sadly @BeanProperty is not smart enough to figure out that I have written a custom setter and fails with a compiler error stating that setInput() has been defined twice!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might want to use @BeanProperty instead of the explicit get/get function pairs.
http://www.scala-lang.org/api/current/scala/reflect/BeanProperty.html