Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • or you define aliases (shortcuts/abbreviations), for the annotations and map these to the fully qualified class names for the annotation interfaces. This is done using the annotations.properties file.
    Example:
    Code Block
    java
    java
    OneWay = org.codehaus.backport175.annotation.OneWay
    TwoWay = org.codehaus.backport175.annotation.TwoWay
    
    If we now feed this property file to the compiler we are able to write the annotations like this instead:
    Code Block
    java
    java
    /**
     * @OneWay
     */
    public void method() {
        ...
    }
    

You can have more than one annotation.properties file (see the compiler section) and those are not at all required at runtime.

Rules for annotation naming consistency

...

Code Block
java
java
package demo;
/**
 * @demo.Target.OneWayDefaulted
 */
public class TargetUsingDefaultValue {

  public static interface OneWayDefaulted {
    /**
     * @org.codehaus.backport175.DefaultValue ("default message")
     */
    String message();
  }
}

/**
 * @demo.Target.OneWayDefaulted (message="this is not the default message !")
 */
public class TargetNOTUsingDefaultValue {

  ...
}
Code Block