Annotation Type Formatter


  • @Retention(RUNTIME)
    @Target(FIELD)
    public @interface Formatter
    Define how the result string is convert to an object for field.
    Since:
    0.3.2
    Author:
    code4crafter@gmail.com
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends ObjectFormatter> formatter
      If there are more than one formatter for a class, just specify the implement.
      java.lang.Class subClazz
      Specific the class of field of class of elements in collection for field.
      java.lang.String[] value
      Set formatter params.
    • Field Detail

      • DEFAULT_FORMATTER

        static final java.lang.Class<ObjectFormatter> DEFAULT_FORMATTER
    • Element Detail

      • value

        java.lang.String[] value
        Set formatter params.
        Returns:
        formatter params
        Default:
        {""}
      • subClazz

        java.lang.Class subClazz
        Specific the class of field of class of elements in collection for field.
        It is not necessary to be set because we can detect the class by class of field, unless you use a collection as a field.
        Returns:
        the class of field
        Default:
        java.lang.Void.class
      • formatter

        java.lang.Class<? extends ObjectFormatter> formatter
        If there are more than one formatter for a class, just specify the implement.
        Returns:
        implement
        Default:
        us.codecraft.webmagic.model.formatter.ObjectFormatter.class