notes-jj
notes-jj

Reputation: 1557

Eclipse Java Template: Nested variable in :import

I want to develop an Eclipse Java Template that is importing a Class, which name is derived from the current Class. ${enclosing_type} gives me the Class where my cursor is positioned in, lets assume the Qualified Name com.example.CurrentClass. ${imp:import(com.example.impl.CurrentClassImpl)} creates an import of the desired second class.

But if I combine these two part, I will get the Error Message:

Template has incomplete variables. Type '$$' to enter the dollar character.

Template Code

${imp:import(com.example.impl.${enclosing_type}Impl)}

If I enclose the inner part in single quotes, no error message, but the ${enclosing_type} will not be resolved. Double Dollar $${enclosing_type} will still bring up the the error message.

Upvotes: 1

Views: 127

Answers (0)

Related Questions