01: /**************************************************************************************
02: * Copyright (c) Jonas Bonér, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package org.codehaus.aspectwerkz.annotation;
08:
09: /**
10: * A custom annotation-like to host AnnotationDefault attribute that host annotation defaulted values
11: *
12: * Note: Java 5 does not handles this as an annotation but as an attribute so this information
13: * will be visible in ASMClassInfo as an annotation but it is not a real one (fe won't extend Java 5 Annotation etc)
14: *
15: * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
16: */
17: public interface AnnotationDefault {
18:
19: public final static String NAME = AnnotationDefault.class.getName()
20: .replace('/', '.');
21:
22: /**
23: * The default value of the annotation element marked with the AnnotationDefault attribute
24: * Note: for Class it will be an instance of asm.Type
25: *
26: * @return
27: */
28: public Object value();
29:
30: /**
31: * Annotation implementation, since we will not use our Java 5 dynamic proxy based architecture for it
32: *
33: * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
34: */
35: static class AnnotationDefaultImpl implements AnnotationDefault,
36: Annotation {
37: private final Object m_value;
38:
39: public AnnotationDefaultImpl(Object value) {
40: m_value = value;
41: }
42:
43: public Object value() {
44: return m_value;
45: }
46:
47: public Class annotationType() {
48: return AnnotationDefault.class;
49: }
50: }
51: }
|