Annotation Type Property


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Property
    This annotation can be declared on a field in which a property should be injected from a properties file.
    Author:
    Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String key
      The key to load from the properties file.
      String source
      The properties file name.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String defaultValue
      The default value to set in case the key does not exist or cannot be loaded.
      boolean failFast
      Flag to fail the configuration process if the key is absent
      int order
      Injection order regarding other annotations.
    • Element Detail

      • source

        String source
        The properties file name.
        Returns:
        The properties file name
      • key

        String key
        The key to load from the properties file.
        Returns:
        The key to load from the properties file
      • defaultValue

        String defaultValue
        The default value to set in case the key does not exist or cannot be loaded.
        Returns:
        the default value to set
        Default:
        ""
      • failFast

        boolean failFast
        Flag to fail the configuration process if the key is absent
        Returns:
        true if the configuration process should fail fast if the key is absent
        Default:
        false
      • order

        int order
        Injection order regarding other annotations.
        Returns:
        injection order regarding other annotations
        Default:
        0