Update of /cvsroot/ejtools/libraries/xdoclet/src/main/xdoclet/beans/tags
In directory usw-pr-cvs1:/tmp/cvs-serv9033/xdoclet/src/main/xdoclet/beans/tags
Added Files:
JavaBeanTagsHandler.java
Log Message:
Final implementation of JavaBean BeanInfo generation.
--- NEW FILE: JavaBeanTagsHandler.java ---
package xdoclet.beans.tags;
import java.util.Properties;
import com.sun.javadoc.*;
import org.apache.log4j.Category;
import xdoclet.XDocletException;
import xdoclet.tags.AbstractProgramElementTagsHandler;
/**
* Description of the Class
*
* @author letiembl
* @created 28 mai 2002
*/
public class JavaBeanTagsHandler extends AbstractProgramElementTagsHandler
{
/**
* Description of the Method
*
* @param attributes Description of the Parameter
* @return Description of the Return Value
* @exception XDocletException Description of the Exception
* @doc:tag type="content"
* @doc:param name="tagName" optional="false"
* description="The tag name."
* @doc:param name="paramName" description="The parameter
* name. If not specified, then the raw content of the tag is returned."
* @doc:param name="paramNum" description="The zero-based
* parameter number. It's used if the user used the space-separated
* format for specifying parameters."
* @doc:param name="superclasses" values="true,false"
* description="If true then traverse superclasses also, otherwise look
* up the tag in current concrete class only."
*/
public String capitalizeClassTag(Properties attributes) throws XDocletException
{
String name = getTagValue(attributes, FOR_CLASS);
if (name == null || name.length() == 0)
{
return name;
}
if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) &&
Character.isUpperCase(name.charAt(0)))
{
return name;
}
char chars[] = name.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
return new String(chars);
}
/**
* Description of the Method
*
* @param attributes Description of the Parameter
* @return Description of the Return Value
* @exception XDocletException Description of the Exception
* @doc:tag type="content"
* @doc:param name="tagName" optional="false"
* description="The tag name."
* @doc:param name="paramName" description="The parameter
* name. If not specified, then the raw content of the tag is returned."
* @doc:param name="paramNum" description="The zero-based
* parameter number. It's used if the user used the space-separated
* format for specifying parameters."
* @doc:param name="superclasses" values="true,false"
* description="If true then traverse superclasses also, otherwise look
* up the tag in current concrete class only."
*/
public String getterPrefix(Properties attributes) throws XDocletException
{
String name = getTagValue(attributes, FOR_CLASS);
if ("boolean".equals(name))
{
return "is";
}
if ("java.lang.Boolean".equals(name))
{
return "is";
}
return "get";
}
}
|