Pregunta

I have something like this in my code, only I have more FXML elements, so there is a lot of @FXML

@FXML
private TableColumn<Player, String> playerColumn1;
@FXML
private TableColumn<Player, String> playerColumn2;
@FXML
private TableColumn<Player, String> playerColumn3;

I would like to anotate every line of code of some block with same annotation, something like this, is there a way to do it?

@FXML
{
    private TableColumn<Player, String> playerColumn1;
    private TableColumn<Player, String> playerColumn2;
    private TableColumn<Player, String> playerColumn3;
}
¿Fue útil?

Solución

From the source code of ElementType (enum of allowed values for the @Target meta-annotation)

public enum ElementType {
    /** Class, interface (including annotation type), or enum declaration */
    TYPE,

    /** Field declaration (includes enum constants) */
    FIELD,

    /** Method declaration */
    METHOD,

    /** Parameter declaration */
    PARAMETER,

    /** Constructor declaration */
    CONSTRUCTOR,

    /** Local variable declaration */
    LOCAL_VARIABLE,

    /** Annotation type declaration */
    ANNOTATION_TYPE,

    /** Package declaration */
    PACKAGE
}

What you are trying to do is not possible

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top