Java annotations and meta-objects

Java annotations and meta-objects

Annotations are meta-meta-objects which can be used to explain other meta-objects. Meta-objects are sessions, areas and techniques. Asking an item for its meta-object (e.g. anObj.getClass()) is known as more self examination. The more self examination can go further and we can ask a meta-object what are its annotations (e.g. aClass.getAnnotations). Introspection and annotations are part of what is known as representation and meta-programming.

An annotation needs to be considered in one way or another to be useful. Annotations can be considered at development-time by the IDE or the compiler or at run-time by a structure.

Annotation handling is a very highly effective procedure and can be used in a lot of different ways:

  • To explain restrictions or use of an element: e.g. @Deprecated, @Override, or @Not Null
  • to explain the "nature" of a feature, e.g. @Entity, @TestCase, @WebService
  • to explain the actions of an element: @Statefull, @Transaction
  • to explain how to procedure the element: @Column, @XmlElement
  • In all situations, an annotation is used to explain the factor and explain its significance.
  • Prior to JDK5, details that is now indicated with annotations required to be saved somewhere else, and XML details were regularly used. But it is more practical to use annotations because they will are part of the Coffee rule itself, and are hence much simpler to control than XML.

Usage of annotations:

  • Documentation, e.g. XDoclet
  • Compilation
  • IDE
  • Testing structure, e.g. JUnit
  • IoC package e.g. as Spring
  • Serialization, e.g. XML
  • Aspect-oriented growth (AOP), e.g. Springtime AOP
  • Application web servers, e.g. EJB package, Web Service
  • Object-relational applying (ORM), e.g. Hibernate, JPA

Our CRB Tech provides Java course in Pune.

要查看或添加评论,请登录

Pooja Sinha的更多文章

  • Java: Inversion of Control Container

    Java: Inversion of Control Container

    Central to the Springtime Structure is its inversion of control (IOC) package, which provides a regular indicates of…

    1 条评论
  • Details of Java Spring Framework

    Details of Java Spring Framework

    Springtime Framework is a Java program that provides comprehensive features support for creating Java applications…

  • JavaScript history

    JavaScript history

    JavaScript is a powerful on-line terminology. It is most widely used as part of Web internet explorer, whose…

  • Java Exception handling

    Java Exception handling

    Application exemption managing and the support provided by software programs vary somewhat from what is recognized…

  • Why Java Is Essential to the Internet

    Why Java Is Essential to the Internet

    In a system, two very wide groups of things are passed on between the server and your personal computer: inactive…

  • Java developer advantage

    Java developer advantage

    Even though Apple does not use Java, a significant if not the majority of cellular mobile phones use Java or Java-like…

  • Let us know about the detailed description of Java

    Let us know about the detailed description of Java

    Java is a development terminology and processing system first launched by Sun Microsystems in 1995. There are lots of…

    1 条评论
  • Java apache struts description

    Java apache struts description

    In a standard Java EE web program, the consumer will generally call to the server via a web type. The details is then…

  • Java: Inversion of control container (dependency injection)

    Java: Inversion of control container (dependency injection)

    Central to the Springtime Structure is its inversion of control (IoC) package, which provides a regular indicates of…

  • Multithreading in Java

    Multithreading in Java

    Multithreading in Java is a procedure of performing several discussions simultaneously. Thread is generally a light and…

社区洞察

其他会员也浏览了