Annotation Type ComboExtract


  • @Retention(RUNTIME)
    @Target({FIELD,TYPE})
    public @interface ComboExtract
    Combo 'ExtractBy' extractor with and/or operator.
    Since:
    0.2.1
    Author:
    code4crafter@gmail.com
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      ExtractBy[] value
      The extractors to be combined.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean multi
      Deprecated.
      since 0.4.2
      boolean notNull
      Define whether the field can be null.
      If set to 'true' and the extractor get no result, the entire class will be discarded.
      ComboExtract.Op op
      Combining operation of extractors.
      ComboExtract.Source source
      The source for extracting.
    • Element Detail

      • value

        ExtractBy[] value
        The extractors to be combined.
        Returns:
        the extractors to be combined
      • op

        ComboExtract.Op op
        Combining operation of extractors.
        Returns:
        combining operation of extractors
        Default:
        us.codecraft.webmagic.model.annotation.ComboExtract.Op.And
      • notNull

        boolean notNull
        Define whether the field can be null.
        If set to 'true' and the extractor get no result, the entire class will be discarded.
        Returns:
        whether the field can be null
        Default:
        false
      • source

        ComboExtract.Source source
        The source for extracting.
        It works only if you already added 'ExtractBy' to Class.
        Returns:
        the source for extracting
        Default:
        us.codecraft.webmagic.model.annotation.ComboExtract.Source.SelectedHtml
      • multi

        boolean multi
        Deprecated.
        since 0.4.2
        Define whether the extractor return more than one result. When set to 'true', the extractor return a list of string (so you should define the field as List).
        Deprecated since 0.4.2. This option is determined automatically by the class of field.
        Returns:
        whether the extractor return more than one result
        Default:
        false