Author: rdonkin
Date: Thu May 26 13:59:46 2011
New Revision: 1127917
URL: http://svn.apache.org/viewvc?rev=1127917&view=rev
Log:
MAILETDOCS-4 Tidied up descriptor processing.
Modified:
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
Modified:
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
URL:
http://svn.apache.org/viewvc/james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java?rev=1127917&r1=1127916&r2=1127917&view=diff
==============================================================================
---
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
(original)
+++
james/mailet/maven-mailetdocs-plugin/trunk/src/main/java/org/apache/james/mailet/MailetdocsMojo.java
Thu May 26 13:59:46 2011
@@ -114,37 +114,40 @@ public class MailetdocsMojo extends Abst
final List<MailetMatcherDescriptor> descriptors = buildDescriptors();
@SuppressWarnings("unchecked")
- List<MailetMatcherDescriptor> matchers =
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
+ final List<MailetMatcherDescriptor> matchers =
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
new TypePredicate(MailetMatcherDescriptor.Type.MATCHER));
@SuppressWarnings("unchecked")
- List<MailetMatcherDescriptor> mailets =
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
+ final List<MailetMatcherDescriptor> mailets =
(List<MailetMatcherDescriptor>) CollectionUtils.select(descriptors,
new TypePredicate(MailetMatcherDescriptor.Type.MAILET));
- if (matchers.size() > 0 && mailets.size() > 0) {
+ final boolean matchersExist = matchers.size() > 0;
+ final int mailetsExist = mailets.size();
+
+ if (matchersExist && mailetsExist > 0) {
getSink().table();
getSink().tableRow();
getSink().tableCell();
}
- if (matchers.size() > 0) {
+ if (matchersExist) {
outputDescriptorIndex(matchers, "Matchers");
}
- if (matchers.size() > 0 && mailets.size() > 0) {
+ if (matchersExist && mailetsExist > 0) {
getSink().tableCell_();
getSink().tableCell();
}
- if (mailets.size() > 0) {
+ if (mailetsExist > 0) {
outputDescriptorIndex(mailets, "Mailets");
}
- if (matchers.size() > 0 && mailets.size() > 0) {
+ if (matchersExist && mailetsExist > 0) {
getSink().tableCell_();
getSink().tableRow_();
getSink().table_();
}
- if (matchers.size() > 0) {
+ if (matchersExist) {
outputDescriptorList(matchers, "Matchers");
}
- if (mailets.size() > 0) {
+ if (mailetsExist > 0) {
outputDescriptorList(mailets, "Mailets");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]