Permalink
Browse files

[Issue 4] Revert useless fieldname

  • Loading branch information...
1 parent 22bd1a2 commit 9f5e2e97ea96727997c341d3d18d9e89a295c513 attonnnn committed Sep 28, 2010
@@ -178,7 +178,6 @@ private Attribute buildAttributeFromField(Field field)
log.debug("Processing Attribute : " + field.getName());
Attribute attribute = new Attribute();
- attribute.setFieldName(field.getName());
attribute.setName(StringUtils.isNotEmpty(field.getAnnotation(Parameter.class).name())?field.getAnnotation(Parameter.class).name():field.getName());
attribute.setDeferredValue(field.getType().getName());
@@ -31,15 +31,7 @@
*/
@XStreamAlias("attribute")
public class Attribute
-{
- /**
- * Name of the field. Can be different of the name of the paramter.
- * Used to bind with Javadoc information
- * @see Parameter#name()
- */
- @XStreamOmitField
- private String fieldName;
-
+{
/**
* Name of the parameter as defined by the user
* @see Parameter#name()
@@ -79,16 +71,6 @@ public void setName(String name)
{
this.name = name;
}
-
- public String getFieldName()
- {
- return fieldName;
- }
-
- public void setFieldName(String fieldName)
- {
- this.fieldName = fieldName;
- }
/**
* @return the description
@@ -51,7 +51,7 @@ public static void mergeToTaglib(Taglib taglib, ComponentsInfoBean infos)
for (Attribute a : t.getAttributes())
{
- ParameterBean param = comp.getParameterByName(a.getFieldName());
+ ParameterBean param = comp.getParameterByName(a.getName());
String description = null;
@@ -92,7 +92,7 @@ private static String getParentAttributeDescription(ComponentBean comp, Attribut
if (comp != null)
{
- ParameterBean superParam = comp.getParameterByName(a.getFieldName());
+ ParameterBean superParam = comp.getParameterByName(a.getName());
if (superParam != null)
{
@@ -84,7 +84,7 @@ public void testParameterName() throws MalformedURLException, MojoExecutionExcep
Iterator<Attribute> ite = subsubT.getAttributes().iterator();
while(ite.hasNext()){
Attribute a = ite.next();
- found |= (a.getName().equals("subnewname") && a.getFieldName().equals("subsubParam"));
+ found |= (a.getName().equals("subnewname"));
}
assertTrue(found);
@@ -106,7 +106,6 @@ public void testWriteAttribute() throws IOException
Attribute att = new Attribute();
att.setDeferredValue("java.lang.String");
att.setDescription("My Attribute");
- att.setFieldName("fieldName");
att.setName("attName");
att.setRequired(true);
att.setParameterDescription("parameter description");

0 comments on commit 9f5e2e9

Please sign in to comment.