01: /*
02: * Copyright 2007 Gerd Ziegler (www.gerdziegler.de)
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: * http://www.apache.org/licenses/LICENSE-2.0
07: * Unless required by applicable law or agreed to in writing,
08: * software distributed under the License is distributed on an
09: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10: * either express or implied. See the License for the specific
11: * language governing permissions and limitations under the License.
12: * @author www.gerdziegler.de
13: */
14:
15: package org.ztemplates.render;
16:
17: import java.lang.annotation.ElementType;
18: import java.lang.annotation.Retention;
19: import java.lang.annotation.RetentionPolicy;
20: import java.lang.annotation.Target;
21:
22: /**
23: * Marker for exposed properties or operations. Can be applied to methods.
24: *
25: * Allowed methods must have one of the following signatures
26: * <ul>
27: * <li>public void myOperationName(void) throws Exception <br>
28: * This kind of operation will be wrapped internally to a ZOperation. Will
29: * expose a property with name "myOperationName" and value a ZOperation object.
30: * </li>
31: * <li> public SomeClass getSomePropertyName(void) <br>
32: * Exposes a instance of ZIProperty with name "somePropertyName" to the context.
33: * If SomeClass is a ZIProperty the instance returned by the getter call will be
34: * used, else a internal wrapper will be created and exposed to the context.
35: * </li>
36: * <li> public ZOperation getMyOperationName(void) <br>
37: * Exposes a ZOperation object with name "myOperationName" to the context. </li>
38: * </ul>
39: * <p>
40: */
41: @Retention(RetentionPolicy.RUNTIME)
42: @Target({ElementType.METHOD})
43: public @interface ZExpose {
44: boolean render() default false;
45: }
|