matthiasblaesing commented on issue #8535:
URL: https://github.com/apache/netbeans/issues/8535#issuecomment-2923032501

   No idea what you tested, but the quick example works:
   
   pom.xml:
   
   ```xml
   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
       <modelVersion>4.0.0</modelVersion>
       <groupId>eu.doppelhelix.test</groupId>
       <artifactId>mavenproject1</artifactId>
       <version>0.1-SNAPSHOT</version>
       <packaging>jar</packaging>
       <properties>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
           <maven.compiler.release>23</maven.compiler.release>
           
<exec.mainClass>eu.doppelhelix.test.mavenproject1.Mavenproject1</exec.mainClass>
           <io.jstach.version>1.3.7</io.jstach.version>
       </properties>
       <dependencies>
           <dependency>
               <groupId>io.jstach</groupId>
               <artifactId>jstachio</artifactId>
               <version>${io.jstach.version}</version>
           </dependency>
       </dependencies>
       <build>
           <plugins>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-compiler-plugin</artifactId>
                   <version>3.14.0</version>
                   <configuration>
                       <release>17</release>
                       <annotationProcessorPaths>
                           <path>
                               <groupId>io.jstach</groupId>
                               <artifactId>jstachio-apt</artifactId>
                               <version>${io.jstach.version}</version>
                           </path>
                           <!-- other annotation processors -->
                       </annotationProcessorPaths>
                   </configuration>
               </plugin>
           </plugins>
       </build>
   </project>
   ```
   
   Mavenproject1.java:
   
   ```java
   
   package eu.doppelhelix.test.mavenproject1;
   
   import io.jstach.jstache.JStache;
   import io.jstach.jstache.JStacheLambda;
   import io.jstach.jstachio.JStachio;
   import java.time.LocalDate;
   import java.time.format.DateTimeFormatter;
   import java.time.temporal.ChronoUnit;
   import java.util.List;
   
   public class Mavenproject1 {
   
       public static void main(String[] args) {
           Person rick = new Person("Rick", LocalDate.now().minusYears(70));
           Person morty = new Person("Morty", LocalDate.now().minusYears(14));
           Person beth = new Person("Beth", LocalDate.now().minusYears(35));
           Person jerry = new Person("Jerry", LocalDate.now().minusYears(35));
           String actual = JStachio.render(new HelloWorld("Hello alien", 
List.of(rick, morty, beth, jerry)));
           System.out.println(actual);
       }
   
       @JStache(template = """
           {{#people}}
           {{message}} {{name}}! You are {{#ageInfo}}{{age}}{{/ageInfo}} years 
old!
           {{#-last}}
           That is all for now!
           {{/-last}}
           {{/people}}
           """)
       public record HelloWorld(String message, List<Person> people) implements 
AgeLambdaSupport {
   
       }
   
       public record Person(String name, LocalDate birthday) {
   
       }
   
       public record AgeInfo(long age, String date) {
   
       }
   
       public interface AgeLambdaSupport {
   
           @JStacheLambda
           default AgeInfo ageInfo(Person person) {
               long age = ChronoUnit.YEARS.between(person.birthday(), 
LocalDate.now());
               String date = 
person.birthday().format(DateTimeFormatter.ISO_DATE);
               return new AgeInfo(age, date);
           }
   
       }
   }
   
   ```
   
   
   
![Image](https://github.com/user-attachments/assets/8e68a0b7-a8f7-4585-aa4b-6b61eaee87bd)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to