commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Tedone" <>
Subject [jelly] invokeTag does not understand 'escapeText' attribute + optimal Java source formatting?
Date Sun, 07 May 2006 10:34:40 GMT
Hi, in the effort of trying to optimize the formatting of interfaces 
auto-generated by my tool, I incurred in the following exception:


<j:invokeStatic> This tag does not understand the 'escapeText' attribute

The online documentation says that this attribute is supported by 

Additionally I'd like to ask your opinion about Java source formatting. I'm 
writing a tool that can be used to auto-generate code (Java, XML, etc), and 
I'm writing a set of jelly tags to use this tool. Although the tool works 
(i.e. I get a Java interface generated and compiled properly), the output is 
somewhat awful. Ok, who cares, it's auto geneated code right? Well, if there 
is no solution I'd go with it but I was wondering if there would be a way to 
optimize the layout of a Java source code. For instance, this is the script 
I'm using to auto generate interfaces:

<j:jelly trim="false"
//Auto-generated by Jemos Clanker. Do not edit
package ${packageName};
* Defines interface for class ${clazz.fullName}
public interface ${}${suffix} {
<j:forEach items="${clazz.methods}" var="method">

<!-- Formats parameters and except -->
<j:invokeStatic var="params"
    <j:arg type="" value="${method}" />

<!-- Retrieves the exceptions -->
<j:invokeStatic var="exceptions"
  <j:arg type="" value="${method}" />

<!-- Method's signature -->
<j:choose trim = "true">
  <j:when test="${null != exceptions}" trim="true">
     public ${method.returnType} ${}(${params}) throws 
<j:otherwise trim="true">
    public ${method.returnType} ${}(${params});
<j:whitespace />

The output is syntactically correct, however there is a huge amount of space 
(virtually everything enclosed between <j:foreach> and <j:choose>) between 
two methods. I tried to apply the 'trim' attribute to <j:forEach> but in 
case I get all interface methods (and exceptions) on one line, which is even 
worst. I tried <j:whitespace> without luck. I was wondering if there is 
something like: <j:newLine> which I could use in conjunction with 
<j:forEach> with 'trim' set to true.


[This E-mail has been scanned for viruses but it is your responsibility 
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message