1 15 package org.apache.tapestry.annotations; 16 17 import java.lang.annotation.Target ; 18 import java.util.HashMap ; 19 import java.util.Map ; 20 21 import org.apache.tapestry.IAsset; 22 import org.apache.tapestry.IComponent; 23 import org.apache.tapestry.IPage; 24 import org.apache.tapestry.IScript; 25 import org.apache.tapestry.form.Checkbox; 26 import org.apache.tapestry.form.TextField; 27 import org.apache.tapestry.html.BasePage; 28 29 36 public abstract class AnnotatedPage extends BasePage 37 { 38 @Asset("/style/global.css") 39 public abstract IAsset getGlobalStylesheet(); 40 41 @InjectObject("barney") 42 public abstract Object getInjectedObject(); 43 44 @Bean 45 public abstract HashMap getHashMapBean(); 46 47 @Bean(HashMap .class) 48 public abstract Map getMapBean(); 49 50 @Bean(initializer = "intValue=10") 51 public abstract Target getBeanWithInitializer(); 52 53 @Bean(value = HashMap .class, lifecycle = Lifecycle.RENDER) 54 public abstract Map getRenderLifecycleBean(); 55 56 @Persist 57 public abstract int getPersistentProperty(); 58 59 @Persist("client") 60 public abstract String getClientPersistentProperty(); 61 62 @InjectAsset("stylesheet") 63 public abstract IAsset getStylesheetAsset(); 64 65 @InjectComponent("fred") 66 public abstract TextField getFredField(); 67 68 @InjectState("barneyASO") 69 public abstract Map getBarney(); 70 71 @Parameter 72 public abstract String getSimpleParameter(); 73 74 @Parameter(required = true) 75 public abstract String getRequiredParameter(); 76 77 @Parameter(defaultBinding = "bean") 78 public abstract Object getBeanDefaultParameter(); 79 80 @Parameter(cache = false) 81 public abstract Object getNonCachedParameter(); 82 83 @Parameter(aliases = "fred") 84 public abstract String getAliasedParameter(); 85 86 @Parameter 87 @Deprecated 88 public abstract int getDeprecatedParameter(); 89 90 @Parameter(name = "fred") 91 public abstract double getNamedParameter(); 92 93 @InjectPage("SomePageName") 94 public abstract IPage getMyPage(); 95 96 @Component(type = "TextField") 97 public abstract TextField getTextField(); 98 99 @Component(type = "Checkbox", id = "email") 100 public abstract Checkbox getEmailField(); 101 102 @Component(type = "TextField", inheritInformalParameters = true) 103 public abstract IComponent getInherit(); 104 105 @Component(type = "Conditional", bindings = 106 { "condition=message", "element=div" }) 107 public abstract IComponent getComponentWithBindings(); 108 109 @Component(type = "TextField", bindings = 110 { "value = email", "displayName = message:email-label" }) 111 public abstract IComponent getWhitespace(); 112 113 @Message 114 public abstract String noArgsMessage(); 115 116 @Message("message-key") 117 public abstract String messageWithSpecificKey(); 118 119 @Message 120 public abstract String messageWithParameters(String foo, Map bar); 121 122 @Message 123 public abstract String messageWithPrimitives(int foo, double bar); 124 125 @Message 126 public abstract void voidMessage(); 127 128 @Message 129 public abstract String getLikeGetter(); 130 131 @InjectMeta("fred") 132 public abstract String getMetaFred(); 133 134 @InjectScript("foo.script") 135 public abstract IScript getScript(); 136 } 137 | Popular Tags |