You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by de...@apache.org on 2017/09/17 18:05:27 UTC
[myfaces-trinidad-maven] 03/04: TRINIDAD-1946 Merge revision 1026463
This is an automated email from the ASF dual-hosted git repository.
deki pushed a commit to branch 1.2.12.1-branch
in repository https://gitbox.apache.org/repos/asf/myfaces-trinidad-maven.git
commit 6f9dbe2f7d055e9cf2320750fc7690f1c89ddfe1
Author: Andrew Robinson <ar...@apache.org>
AuthorDate: Thu Nov 4 23:15:26 2010 +0000
TRINIDAD-1946 Merge revision 1026463
---
.../plugin/faces/parse/FacesConfigParser.java | 1 +
.../trinidadbuild/plugin/tagdoc/TagdocReport.java | 81 +++++++++++-----------
2 files changed, 40 insertions(+), 42 deletions(-)
diff --git a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
index 720f5f2..5f2546e 100644
--- a/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
+++ b/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
@@ -324,6 +324,7 @@ public class FacesConfigParser
"parsePropertyValues", 1);
digester.addCallParam("faces-config/component/property/property-extension/property-metadata/property-values", 0);
digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/deprecated");
+ digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/hidden");
digester.setRuleNamespaceURI(oldNamespace);
}
diff --git a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
index 421349b..39c4770 100644
--- a/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
+++ b/maven-tagdoc-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/tagdoc/TagdocReport.java
@@ -128,13 +128,13 @@ public class TagdocReport extends AbstractMavenMultiPageReport
compIter = new FilteredIterator(compIter, new SkipFilter());
compIter = new FilteredIterator(compIter, new ComponentTagFilter());
compIter = new FilteredIterator(compIter, new ComponentNamespaceFilter());
-
+
// compTypeMap holds a map of compononent types to tag names that implement that component type
- // The map is built using getComponentType method on the component bean to determine the
+ // The map is built using getComponentType method on the component bean to determine the
// component type of a given tag name
Map<String, List<QName>> compTypeMap = new HashMap<String, List<QName>> ();
// contractMap holds a map of contract name to tag names that satisify that contract.
- // The map is built using the getSatisfiedContracts method API on the component bean to determine
+ // The map is built using the getSatisfiedContracts method API on the component bean to determine
// which contracts are satisfied for a given tagname
Map<String, List<QName>> contractMap = new HashMap<String, List<QName>>();
while (compIter.hasNext())
@@ -143,21 +143,21 @@ public class TagdocReport extends AbstractMavenMultiPageReport
List<QName> tagNames;
String compType = compBean.getComponentType();
if (compType != null &&
- compTypeMap.containsKey (compType) &&
- compBean.getTagName() != null)
+ compTypeMap.containsKey (compType) &&
+ compBean.getTagName() != null)
{
// the component type map already contains an entry for this component type
tagNames = compTypeMap.get(compType);
- }
- else
+ }
+ else
{
// the component type map does not contain an entry for this component type
- // so create a new ArrayList that will be used to store the tag names of
+ // so create a new ArrayList that will be used to store the tag names of
// component that have this component type
tagNames = new ArrayList<QName>();
}
tagNames.add(compBean.getTagName());
- compTypeMap.put (compType, tagNames);
+ compTypeMap.put (compType, tagNames);
if (compBean.hasSatisfiedContracts())
{
@@ -167,12 +167,12 @@ public class TagdocReport extends AbstractMavenMultiPageReport
String satContract = satContractsIter.next();
if (contractMap.containsKey (satContract))
{
- // the contract map already contains an entry for this contract
+ // the contract map already contains an entry for this contract
tagNames = contractMap.get(satContract);
}
else
{
- // the contract map does not contain an entry for this contract, so
+ // the contract map does not contain an entry for this contract, so
// create a new ArrayList which will be used to store the tag names of
// components that satisfy this contract
tagNames = new ArrayList<QName>();
@@ -314,7 +314,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
String header)
{
String formatted = null;
-
+
// Don't know how long this will be, but 300 should be plenty.
StringBuffer sb = new StringBuffer(300);
sb.append("\n");
@@ -322,7 +322,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
sb.append(header);
sb.append(":</b> ");
- boolean gotOne = false;
+ boolean gotOne = false;
while (strIter.hasNext())
{
List<QName> tagNameList = pMap.get(strIter.next());
@@ -425,13 +425,13 @@ public class TagdocReport extends AbstractMavenMultiPageReport
sink.text("Tag Name");
sink.tableHeaderCell_();
sink.tableRow_();
-
+
Iterator iter = pages.iterator();
while (iter.hasNext())
{
sink.tableRow();
sink.tableCell();
-
+
String name = (String) iter.next();
String tagName = "<" + name.replace('_', ':') + ">";
@@ -676,7 +676,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
if (bean.hasRequiredAncestorContracts())
{
- String formattedAncestors = _formatTagList ( bean.requiredAncestorContracts(),
+ String formattedAncestors = _formatTagList ( bean.requiredAncestorContracts(),
contractMap,
"Required Ancestor Tag");
out.write (formattedAncestors);
@@ -722,7 +722,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
out.write(" <b>Tag name:</b> <" +
_getQualifiedName(bean.getTagName()) + ">\n");
out.write(" <br/>\n");
-
+
out.write(" <br/>\n");
out.write(" <b> type:</b> " + bean.getValidatorId() + "\n");
out.write(" <br/>\n");
@@ -813,8 +813,10 @@ public class TagdocReport extends AbstractMavenMultiPageReport
private void _writeComponentAttributes(Writer out, ComponentBean bean) throws IOException
{
// Sort the names
- TreeSet attributes = new TreeSet();
+ TreeSet<String> attributes = new TreeSet<String>();
Iterator attrs = bean.properties(true);
+ attrs = new FilteredIterator(attrs, new NonHiddenFilter());
+
while (attrs.hasNext())
{
PropertyBean property = (PropertyBean) attrs.next();
@@ -823,7 +825,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
// Now get a list of PropertyBeans
- List list = new ArrayList();
+ List<PropertyBean> list = new ArrayList<PropertyBean>();
Iterator iter = attributes.iterator();
while (iter.hasNext())
{
@@ -832,7 +834,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
- TreeSet groups = new TreeSet(new GroupComparator());
+ TreeSet<String> groups = new TreeSet<String>(new GroupComparator());
/* No current support for grouping
// Make sure "null" is the representative for unknown groups
Iterator iter = attributes.iterator();
@@ -857,10 +859,8 @@ public class TagdocReport extends AbstractMavenMultiPageReport
bean.getComponentClass(),
(String) groupIter.next());
}
-
}
-
private void _writeConverterAttributes(Writer out, ConverterBean bean) throws IOException
{
// Sort the names
@@ -929,11 +929,6 @@ public class TagdocReport extends AbstractMavenMultiPageReport
while (attributes.hasNext())
{
PropertyBean attr = (PropertyBean) attributes.next();
-
- if (attr.isHidden())
- {
- continue;
- }
/*
if ((group == null) || "Ungrouped".equals(group))
@@ -1040,15 +1035,15 @@ public class TagdocReport extends AbstractMavenMultiPageReport
{
out.write(valStr);
}
-
+
if (defaultValueStr != null)
{
out.write(defaultValueStr);
}
-
- // if we print out a list of possible values and/or a default value for the attribute,
+
+ // if we print out a list of possible values and/or a default value for the attribute,
// then enter a line break before printing out other information about the attribute.
- if (valStr != null || defaultValueStr != null)
+ if (valStr != null || defaultValueStr != null)
{
out.write("<br/>");
}
@@ -1319,7 +1314,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
// guidelines
private void _writeAccessibilityGuidelines(Writer out, ComponentBean bean) throws IOException
{
- // accAttributes and accFacets are sorted lists of attributes and facets, respectively,
+ // accAttributes and accFacets are sorted lists of attributes and facets, respectively,
// that have an associated accessibility guideline
TreeSet<PropertyBean> accAttributes = new TreeSet<PropertyBean>();
TreeSet<String> accFacets = new TreeSet<String>();
@@ -1336,7 +1331,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
// see if any of the component's facets has an associated accessibility guideline
- if (bean.hasFacets())
+ if (bean.hasFacets())
{
Iterator<FacetBean> facets = bean.facets(true);
while (facets.hasNext())
@@ -1427,11 +1422,11 @@ public class TagdocReport extends AbstractMavenMultiPageReport
out.write(" <div class=\'accGuideline\'>\n");
out.write("<li>");
- if (!"".equals(referenceName))
+ if (!"".equals(referenceName))
{
out.write("<b>");
out.write(referenceName);
- out.write("</b>: ");
+ out.write("</b>: ");
}
if (desc != null)
@@ -1440,7 +1435,7 @@ public class TagdocReport extends AbstractMavenMultiPageReport
{
out.write(desc + "\n");
}
- }
+ }
out.write("</li>");
out.write(" </div>\n");
@@ -1654,8 +1649,6 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
}
-
-
private class ComponentNamespaceFilter extends ComponentFilter
{
public ComponentNamespaceFilter()
@@ -1704,8 +1697,6 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
}
-
-
static final protected class TagAttributeFilter extends PropertyFilter
{
protected boolean accept(
@@ -1742,11 +1733,17 @@ public class TagdocReport extends AbstractMavenMultiPageReport
}
}
+ final protected static class NonHiddenFilter extends PropertyFilter
+ {
+ protected boolean accept(
+ PropertyBean property)
+ {
+ return (!property.isHidden());
+ }
+ }
private FacesConfigBean _facesConfig;
-
-
// todo: make this configurable?
private boolean _attrDocSpansColumns = false;
--
To stop receiving notification emails like this one, please contact
"commits@myfaces.apache.org" <co...@myfaces.apache.org>.