EX08 Task4

Moderatoren: pmueller, SE - Design and Construction

tz33quvu
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 29. Jan 2017 09:26

EX08 Task4

Beitrag von tz33quvu »

Hi,

I am annotating the template method and find the following error.
For example if I annotate like this:

Code: Alles auswählen

@PrimitiveOperation
protected abstract Iterator<String> getKeysInternal();

@TemplateMethod("getKeysInternal")
protected Iterator<String> getKeysInternal(String prefix)
    {
        return new PrefixedKeysIterator(getKeysInternal(), prefix);
    }
then it will show "can not find method 'value' " in line "@TemplateMethod("getKeysInternal")".
I missed this week's lecture, so I am not sure if it is mentioned during the lecture.

BR
Terry

Meretrix
Neuling
Neuling
Beiträge: 9
Registriert: 25. Apr 2012 22:43

Re: EX08 Task4

Beitrag von Meretrix »

Hi,

there is a little difference between Scala and Java. In Java you can instantiate this annotation with:

Code: Alles auswählen

@TemplateMethod(primitiveOperationNames = "getKeysInternal")
There is another example in the javaDoc of the annotation.

tz33quvu
Windoof-User
Windoof-User
Beiträge: 40
Registriert: 29. Jan 2017 09:26

Re: EX08 Task4

Beitrag von tz33quvu »

Thx!

Antworten

Zurück zu „Software Engineering - Design and Construction“