@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface NotContainable
This annotation primarily exists for clarifying the non-containability of a class that might otherwise be assumed to be containable, despite the fact that it is a bad idea to assume a class is containable without good reason.
This annotation is not verified, it is intended for documentation of programmer intent only.
A type may not be annotated with both @Containable and
@NotContainable.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
@NotContainable
public final class ControlPanel extends JPanel implements ActionListener {
public ControlPanel() {
final JButton exit = new JButton("Press to Exit");
add(exit, BorderLayout.CENTER);
exit.addActionListener(this);
}
private boolean f_exitPressed = false;
public void actionPerformed(ActionEvent e) {
f_exitPressed = true;
}
public boolean exitPressed() {
return f_exitPressed;
}
}
@annotate tag.
/**
* @annotate NotContainable
*/
public final class ControlPanel extends JPanel implements ActionListener {
...
}
ContainableCopyright © 2012 Surelogic, Inc.. All Rights Reserved.