Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Java Annotations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Annotations" Watch "Java Annotations" New topic
Author

Java Annotations

Meet Gaurav
Ranch Hand

Joined: Oct 08, 2008
Posts: 492
Hi,

Am new to java annotations. There anyway I can add flag based annotations. In case if I want to change or remove some annotations I can do that by changing the flag and not by changing the code.
Please help
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

No, annotations and their values are always part of the source code. The values must be compile time constants as well - String literals, primitives, enums or Class objects.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Annotations
 
Similar Threads
[JSF 2] @javax.faces.bean.ManagedBean or @javax.inject.Named ?
why can't we use Annotation for when we Creating a Java Stand-Alone Client
Inifinite Loop
Hiding images bound to sliders
Xml based configration Vs Annotation