001package io.jstach.jstache; 002 003import java.lang.annotation.Documented; 004import java.lang.annotation.ElementType; 005import java.lang.annotation.Retention; 006import java.lang.annotation.RetentionPolicy; 007import java.lang.annotation.Target; 008 009/** 010 * Allows you to define and remap/override partials on a model ({@link JStache}) <pre> 011 * {{> name }} 012 * </pre>. Name in this case is defined by {@link #name()} and would be the logical name 013 * of the partial. The physical definition of the partial is defined with a resource 014 * {@link #path()} or inlined {@link #template()}. 015 * <p> 016 * The {@link #path()} is still expanded by {@link JStachePath} if present. 017 * @apiNote While this annotation looks like {@link JStache} there is no associated model 018 * with a partial. 019 * @author agentgt 020 */ 021@Retention(RetentionPolicy.RUNTIME) 022@Target(ElementType.ANNOTATION_TYPE) 023@Documented 024public @interface JStachePartial { 025 026 /** 027 * The logical name of the template. 028 * @return required name of template 029 */ 030 String name(); 031 032 /** 033 * The physical path of the template. If empty {@link #template()} will be used. 034 * @return the physical resource path of the template. 035 * @see JStachePath 036 */ 037 String path() default ""; 038 039 /** 040 * Inline template. If not set {@link #path()} will be used. If path is not set then 041 * the template will be an empty string. 042 * @return inlined template by default returns empty string which means not set. 043 */ 044 String template() default ""; 045 046}