Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Have Programming Question? Ask it here!

Custom Annotation
1 Answer(s)      6 years and a month ago
Posted in : Development process

View Answers

August 12, 2008 at 3:09 PM

Hi friend,

Custom Annotation

1)Annotations are metadata of a data.

2)Annotations to annotate a Java element.

3)An annotation show the declared element processed by a compiler,

4)development tool, deployment tool, or during runtime.

5)Annotations types are blueprints for annotations.

The code of a normal annotation type:

public @interface Anotaion {

int sValue();

String sOValue();


6).It can be processed statically before and during compile time.

7)It can be used before compile time mainly to generate supporting classes or configuration files

Categories of annotations

a)Marker annotations

e.g : @SingleAnnotationType

b)Single-value annotations

e.g : @SingleAnnotationType("datavalue")

c)Full annotations






item="item1", assignedTo="AT1"





item="Item2", assignedTo="AT1" )



Marker: Marker type annotations have no elements


public @interface SingleAnnotation {



public void mymethod() {



Single-Element:Annotations provide a data only.

public @interface SingleElement


String doWork();



@SingleElement("Do work")

public void SingleMethodType() {



Full-value type annotations have multiple data members.

public @interface MultipleAnnotation {

String doWork();

int ecounter; String date();


@MyAnnotation (doSomething="Do work", ecount=5,


public void MultipleMethod() {




Thanks & Regards


Related Tutorials/Questions & Answers:
Custom Annotation - Development process
Custom Annotation   Hi, I am Bala , I Need to Know ,How to Create Custom Annotation and I Want the Sample Program on Custom Annotation..., Custom Annotation 1)Annotations are metadata of a data. 2)Annotations
Java Custom Annotation Example
Java Custom Annotation Example In this tutorial we will learn about the annotation in Java and how it can be created. Annotations in Java contains... a simple example which will demonstrate you about how a custom annotation can
custom annotations. For detailed information about annotation just visit on ... Annotation       Annotation is one more powerful feature of Java, an object-oriented programming
use of annotation.
use of annotation.  for concurrency which annotation can be used
Spring Annotation
Spring Annotation  Hi Sire please tell me that how to write Spring Annotation Based Controller ?   Spring Annotation Based Controller
Java Annotation
Java Annotation  What is annotation in Java ?   Hi please find the link of Java Annotation tutorial
annotation error
annotation error  class names " "are only accepted if annotation processing is explicitly requested   Is your class name is JdbcProjam or JdbcProgram? Check it properly. Java is case sensitive. So use
custom exception
custom exception  Explain the process of creating custom exception and handling it.   Please visit the following link: Making custom exception
custom exception
custom exception  What is user defined exception
JAVA Annotation Error
JAVA Annotation Error  while compiling simple java program i get annotation error i.e class will only be accepted if annotation processing is explicitly to solve
Custom skin
Custom skin  Hi..... How can I make a custom skin for focusSkin property of component? please give me an example for that so i can clearly understand..... Thanks   Ans: you need to set the focusSkin using custon
custom validation
custom validation  there are fields.if we fill in first field as 1.then next field only allow to fill a,b,c,d.other letters cannot enter.if enter send error.i used this method. frmvalidator.addValidation
Junit @Test annotation
Junit @Test annotation  What is the Application of @Test Annotation in JUnit ?   The Test annotation tells JUnit that the public void method to which it is attached can be run as a test case : public class Example
@ExceptionHandler & @ResponseStatus annotation
In this section, you will learn about @ExceptionHandler & @ResponseStatus annotation
aop using annotation
aop using annotation  i got this problem in aop example using annotation example Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut jlc
aop using annotation
aop using annotation  i got this problem in aop example using annotation example Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut jlc
@RequestParam Annotation
@RequestParam Annotation This @RequestParam annotation can be used for getting the parameters from the request as, /* * The method written below takes the request parameters individually by * using @RequestParam However you can
Many To Many annotation in ejb
Many To Many annotation in ejb   how to define primary key in the third & resulting table obtained from ManyToMany mapping.I tried the mapping but the resulting table is showing only foreign key with the two fields which
@configuration annotation in Spring 3
@configuration annotation in Spring 3  doesn't make code tight coupling..? if we keep that in IOC in XML form, its deployment free for some kind of change management right?.   Please visit the following link: http
Hibernate Many To Many Annotation Mapping
Hibernate Many To Many Annotation Mapping  How to use Many To Many Annotation Mapping in Hibernate?   Hibernate requires metadata like... to another.Hibernate annotation provides annotation-based mapping. Click here
what is custom validation in struts
what is custom validation in struts  what is custom validatons in struts
@PathVariable Annotation
@PathVariable Annotation By using the @PathVariable annotation you can create the dynamic varible at the url and can access that varible from there as. /* * Here pathVar is the new path variable when it finds the * /param
Custom Website Design,Custom Web Designing,Custom Website Designing
Custom Website Design Custom Website Design Custom website designs means... Technologies Pvt Ltd is specialized company in Custom website designing. Why Custom Website Designing? The Custom Web Designing means the designing
How to configure Spring using Annotation
How to configure Spring using Annotation  Hi, How to configure Spring using Annotation Thanks
Custom Cell View UITableview
Custom Cell View UITableview  How can i get two custom cell view in UITableView
jsf custom tooltip
jsf custom tooltip  I wants to know that is it possible to add a tooltip to the Custom JSF
HTML custom buttons
HTML custom buttons  How can I make a form with custom buttons
CRUD application in hibernate annotation
CRUD application in hibernate annotation      ... using hibernate annotation.  Table name: student CREATE TABLE... in hibernate annotation. Step 1:- Creating Utility Class :- The following
Hibernate id annotation
In this section, you will learn how to do mapping of id through annotation
spring mvc3 and hibernate with annotation example
spring mvc3 and hibernate with annotation example  please send an example which is used to store the form data into database using spring with hibernate using annotations
custom uibutton programmatically
custom uibutton programmatically  Hi, How to create custom uibutton programmatically? Thanks   Hi, Please see the thread UIButton custom programmatically. Thanks
custom tags - JSP-Servlet
custom tags  Hai this is jagadhish. Iam learning java custom tags.Before doing these programs which jar file we have to add in the classpath..., For solving the problem visit to :
Custom Form Validation - PHP
Custom Form Validation  Which is the best way or where should I implement the custom validation rules such as ? using number, capital letters and symbols to secure the password
JSP-Custom tags
JSP-Custom tags  First page (HTML) should display a form to enter marks for 3 subjects. On submit, the invoked jsp with custom tags should compute the average of 3 subjects
Custom Business Software Development
Custom Business Software Development  What is a Custom Business Software Development?   Custom Business Software Development Any software..., large and medium Business Softwares. And a Custom Business Software
Spring Web Annotation Classes
Spring Web Annotation Annotation is introduced since java 5. It is a new kind... of annotation, some of them which is commonly is used in Spring MVC is explained... class MyController { } @RequestMapping -The @RequestMapping annotation can
custom navigation bar in iphone
custom navigation bar in iphone  How can i create a custom navigation bar in iPhone application? I wanted to add UIBarButton items as well as Search bar on the UINavigation controller ... please tell me if i need to create
Custom Validations - Struts
Custom Validations  Hi, I am trying to do the custom validations in struts 1.1.That is how can we plug in our own custom validations into Validator ? Can anybody tell me how to do this with a sample example. Thanks
@Controller annotation for defining new controller
In this section, you will learn about @Controller annotation for defining new controllers
UIButton custom programmatically
UIButton custom programmatically  Hi, Please tell me how I can create custom UIButton programmatically? Tell me the best code for uibutton custom programmatically. Thanks   Hi, Here is the code example of crating
Custom tags in Jetty
Custom tags in Jetty  Any one knows about Jetty 6.1.22 Server Supported TLD File Version????If so could you please provide an sample TLD file
Spring AOP Pointcut Annotation
Spring AOP Pointcut Annotation In Spring AOP pointcuts determine join points... the @AspectJ annotation-style of AOP, a pointcut signature is provided by a regular... annotation. for example:-          
Joomla Custom Templates Package
Joomla Custom Templates Package In this Joomla package, we offer eye-catching and unique Joomla Templates designed and developed according to our customers' requirement. We use the logo, picks, custom color
Custom UITableViewCell Example
Custom UITableViewCell Example   Hi all, In my iPhone UITableView application.. we need a custom cell as per our project requirement. So can anyone give me an example of UITableViewCell that suggest how to change Height, Border
Spring Annotation Tutorial
Spring Annotation Tutorial In Spring Framework you can use annotations... annotation before any method or class declartion to handle particular URL...) { return "loginForm"; } You can also put data in model using annotation
Hibernate Named HQL in Annotation
In this section, you will learn how to execute Named HQL written in Model class Annotation
@RequestMapping annotation for mapping requests
In this section, you will learn to map request to associated class or method using @RequestMapping annotation
How to Register Custom MBeans in Tomcat5.5
How to Register Custom MBeans in Tomcat5.5  How to register custom MBeans in Tomcat5.5 , please provide me an end-to-end example
Hibernate 4 Many to Many Mapping using Annotation
In this section, you will learn how to do Many to Many Mapping using Annotation
Spring @Required Annotation
Spring @required Annotation In this tutorial you will see about spring @required annotation with an example. The @Required when written on top of setStudent... annotation will not enforce the property checking, you have to register