[stringtemplate-interest] IDE support and an issue with a nestedlist of Java objects
John Snyders
jjsnyders at rcn.com
Sun Jan 14 21:22:37 PST 2007
-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org]On Behalf Of Shane Witbeck
Sent: Sunday, January 14, 2007 12:04 PM
To: stringtemplate-interest at antlr.org
Subject: [stringtemplate-interest] IDE support and an issue with a
nestedlist of Java objects
Two questions:
1. Is there a "File Type" definition or plugin available for
StringTemplate somewhere which gives highlighting support for the IntelliJ
IDEA IDE? If not, which IDE has the best support for working with templates?
[John Snyders] I don't know of one and I'm not sure how useful they could
be. The tough thing about editing template languages is that you are working
in two dimensions at once. You have the template language syntax and the
generated document language syntax. I think that this would be confusing for
smart editors.
2. I'm getting the string representation of a nested object list instead
of the value of the method I'm calling.
Here's the code in question:
$tables:{
public $it.capitalizedName$ get$it.capitalizedName$(int id) throws
DataAccessException {
String sql = "select $it.columns; separator=", ":{
$it.capitalizedName$ }$ from $it.allLowerName$ where ID = ?";
[John Snyders] I think you want the separator option at the end of the
expression but I'm not sure this explains the output you are getting. You
should also look at your toString methods. Seeing the class at address
usually means you are missing a toString.
String sql = "select $it.columns:{
$it.capitalizedName$ };separator=","$ from $it.allLowerName$ where ID = ?";
which generates this:
public Attribute getAttribute(int id) throws DataAccessException {
String sql = "select
com.digitalsanctum.tools.DomainGenerator$Column at 125d06e,
com.digitalsanctum.tools.DomainGenerator$Column at 196f4b5 from attribute where
ID = ?";
tables is a List<Table> and columns (List<Column>) is a member variable of
a Table object.
TIA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070115/bf946ae3/attachment.html
More information about the stringtemplate-interest
mailing list