Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template Render issue #26

Open
Earlwen opened this issue Oct 25, 2014 · 2 comments
Open

Template Render issue #26

Earlwen opened this issue Oct 25, 2014 · 2 comments

Comments

@Earlwen
Copy link

Earlwen commented Oct 25, 2014

I just add a template like this :
public void set @Fieldname(String field)
{
this.@Fieldname = field;
}
public String get@fieldName()
{
return this.@Fieldname;
}
when I run it, it will throws some errors like:
Exception in thread "main" org.rythmengine.exception.CompileException: Syntax error on token "field", delete this token

Template:
public void set @Fieldname(String field)
{
this.@Fieldname = field;
}
public String get@fieldName()
{
return this.@Fieldname;
}

Relevant template source lines:

1:

2: public void set @Fieldname(String field)
3: {
4: this.@Fieldname = field;
5: }
6: public String get@fieldName()
7: {
8: return this.@Fieldname;

Relevant Java source lines:

42:
43: @OverRide public org.rythmengine.utils.TextBuilder build(){
44: buffer().ensureCapacity(180);
45: p("\npublic void set "); //line: 2
46:

47: try{pe(fieldName(String field));} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 2
48: p("\n{\nthis."); //line: 4
49:
50: try{pe(fieldName);} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 4
51: p(" = field;\n}\npublic String get"); //line: 6
52:
53: try{pe(fieldName());} catch (RuntimeException e) {__handleTemplateExecutionException(e);} //line: 6

Any one can help me ?

@greenlaw110
Copy link
Collaborator

try @(fieldName) instead of @fieldName

@Earlwen
Copy link
Author

Earlwen commented Oct 25, 2014

It works now.
Thanks, greenlaw110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants