You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jean CADOT (JIRA)" <ji...@apache.org> on 2016/02/26 13:00:22 UTC

[jira] [Created] (MJAVADOC-445) JavadocOptionsXpp3Reader doesn't deserialize the placement element in Tag

Jean CADOT created MJAVADOC-445:
-----------------------------------

             Summary: JavadocOptionsXpp3Reader doesn't deserialize the placement element in Tag
                 Key: MJAVADOC-445
                 URL: https://issues.apache.org/jira/browse/MJAVADOC-445
             Project: Maven Javadoc Plugin
          Issue Type: Bug
    Affects Versions: 2.10.3
            Reporter: Jean CADOT


The generated class JavadocOptionsXpp3Reader doesn't deserialize the placement in the generated Tag class. 
The end result is that in some cases custom tags are not replaced in the produce java documentation.

In order to fix the issue you have to replace the placement declaration in the Tag class in the model description (javadocOptions.mdo) by the following:
 <class>
      <name>Tag</name>
      <description>A Tag parameter.</description>
      <version>1.0.0+</version>
      <fields>
        <field>
          <name>name</name>
          <description>Name of the tag.</description>
          <version>1.0.0+</version>
          <type>String</type>
          <identifier>true</identifier>
        </field>
        <field>
          <name>head</name>
          <description>Head of the tag.</description>
          <version>1.0.0+</version>
          <type>String</type>
          <identifier>true</identifier>
        </field>
        <field java.setter='false'>
          <name>placement</name>
          <description>Placement of the tag.</description>
          <version>TBD</version>
          <type>String</type>
          <identifier>true</identifier>
        </field>
      </fields>
      <codeSegments>
        <codeSegment>
          <version>1.0.0+</version>
            <code><![CDATA[
    
    /**
     * Set a Placement. Should be a combinaison of the letters:
     * <ul>
     * <li> X (disable tag)</li>
     * <li> a (all)</li>
     * <li> o (overview)</li>
     * <li> p (packages)</li>
     * <li> t (types, that is classes and interfaces)</li>
     * <li> c (constructors)</li>
     * <li> m (methods)</li>
     * <li> f (fields)</li>
     * </ul>
     *
     * @param placement
     * @throws IllegalArgumentException  if not a valid combinaison of the letters
     */
    public void setPlacement(String placement)
      throws IllegalArgumentException
    {
        char[] chars = placement.toCharArray();
        for ( int i = 0; i < chars.length; i++ )
        {
            switch ( chars[i] )
            {
                case 'X':
                case 'a':
                case 'o':
                case 'p':
                case 't':
                case 'c':
                case 'm':
                case 'f':
                    break;
                default:
                    throw new IllegalArgumentException( "Placement should be a combinaison of the letters 'Xaoptcmf'." );
            }
        }
        this.placement = placement;
    }

          ]]></code>
        </codeSegment>
      </codeSegments>
    </class>
I don't know which exact version of the placement tag should be used.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)