気にしないで、「カスタム スキンを Enunctiate のドキュメントに適用する」ことでこの問題を解決できました ( http://docs.codehaus.org/display/ENUNCIATE/Applying+a+Custom+Skin+to+Enunciate%27s+Documentation ) 。
「@Secured」アノテーションが認識されるように、ofdocs.xml.fmt
と同様に修正しました。docs.fmt
enunciate-docs
残念ながら、 にdocs.xml.fmt
は、 のようにカスタマイズするクリーンな方法はありませんdocs.fmt
。そのため、これらの変更されたファイルを自分でパッケージ化する必要がありました。
@Deprecated (java.lang.Deprecated) がどのように処理されたかを参照し、同様の方法に従いました。
ファイルで、このdocs.fmt
ブロックを同様の関数ブロックのすぐ下に追加しますisDeprecated
[#function isSecured element]
[#return (getTagValues(element, "secured")?size > 0)/]
[/#function]
今、
このブロックのすぐ下:
[#if isDeprecated(resource)]
<p class="alert">This resource has been deprecated.</p>
[/#if]
別の if ブロックを追加する
[#if isSecured(resource)]
<p class="note">This resource is available only to these roles:
[#assign securedTags = getTagValues(resource, "secured") /]
[#if securedTags?size > 0]
${securedTags[0]}
[/#if]
[#list resource.parent.annotations as tag]
${tag}
[/#list]
</p>
[/#if]
さて、docs.xml.fmt
ファイルのすぐ下:
[#if resource.parent.annotations["java.lang.Deprecated"]??]
<tag name="deprecated"/>
[/#if]
次のブロックを追加
[#if resource.parent.annotations["org.springframework.security.access.annotation.Secured"]??]
<tag name="secured">
[#list resource.parent.annotations["org.springframework.security.access.annotation.Secured"]["value"] as roles]
<![CDATA[${roles}]]>
[/#list]
</tag>
[/#if]