Class AtclauseOrderCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class AtclauseOrderCheck
    extends AbstractJavadocCheck

    Checks the order of javadoc block-tags or javadoc tags.

    Note: Google used term "at-clauses" for block tags in his guide till 2017-02-28.

    The check allows to configure itself by using the following properties:

    • target - allows to specify targets to check at-clauses.
    • tagOrder - allows to specify the order by tags.

    Default configuration:

     <module name="AtclauseOrderCheck">
         <property name="tagOrder" value="@author, @version, @param,
         @return, @throws, @exception, @see, @since, @serial,
         @serialField, @serialData, @deprecated"/>
         <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
         METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
     </module>
     
    • Field Detail

      • MSG_KEY

        public static final java.lang.String MSG_KEY
        A key is pointing to the warning message text in "messages.properties" file.
        See Also:
        Constant Field Values
      • DEFAULT_ORDER

        private static final java.lang.String[] DEFAULT_ORDER
        Default order of atclauses.
      • target

        private java.util.List<java.lang.Integer> target
        Default target of checking atclauses.
      • tagOrder

        private java.util.List<java.lang.String> tagOrder
        Order of atclauses.
    • Constructor Detail

      • AtclauseOrderCheck

        public AtclauseOrderCheck()
    • Method Detail

      • setTarget

        public void setTarget​(java.lang.String... targets)
        Sets custom targets.
        Parameters:
        targets - user's targets.
      • setTagOrder

        public void setTagOrder​(java.lang.String... orders)
        Sets custom order of atclauses.
        Parameters:
        orders - user's orders.
      • checkOrderInTagSection

        private void checkOrderInTagSection​(DetailNode javadoc)
        Checks order of atclauses in tag section node.
        Parameters:
        javadoc - Javadoc root node.
      • getParentType

        private static int getParentType​(DetailAST commentBlock)
        Returns type of parent node.
        Parameters:
        commentBlock - child node.
        Returns:
        parent type.