xdoclet.ejb.tags
Class PersistentTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.ejb.tags.EjbTagsHandler
                    |
                    +--xdoclet.ejb.tags.EntityTagsHandler
                          |
                          +--xdoclet.ejb.tags.CmpTagsHandler
                                |
                                +--xdoclet.ejb.tags.PersistentTagsHandler

public class PersistentTagsHandler
extends CmpTagsHandler

Version:
$Revision: 1.20 $
Author:
Ara Abrahamian (ara_e@email.com)

Fields inherited from class xdoclet.ejb.tags.EjbTagsHandler
LOCAL_SUFFIX
 
Fields inherited from class xdoclet.XDocletTagSupport
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
 
Constructor Summary
PersistentTagsHandler()
           
 
Method Summary
static java.lang.String fieldList(com.sun.javadoc.ClassDoc clazz, java.lang.String inclTag, java.lang.String exclTag, int type, java.lang.String valueObject)
          Returns comma-separated list of fields, excluding fields that have tags of exclTag list, including fields that have tags of inclTag list.
 void forAllPersistentFields(java.lang.String template, java.util.Properties attributes)
          Evaluates the body for each persistent field.
protected  void forAllPersistentMatchedFields(java.lang.String template, java.lang.String include_tags, java.lang.String exclude_tags, boolean superclasses, java.lang.String valueObject)
          Generate only for all Persisted Fields matching a specific Tag or Persisted fields that do not match a specific Tag
protected  java.lang.String[] getPkFieldsInHeader()
          Returns an array containing ejb:pk-field tags defined in class level.
 void ifHasAtLeastOnePersistentField(java.lang.String template)
          Evaluates the body if the class has at least one persistent field.
 void ifHasAtLeastOnePkField(java.lang.String template)
          Evaluates the body if the class has at least one primary key field.
static boolean isPersistentField(com.sun.javadoc.MethodDoc method)
          Returns true if method is a persistent field, false otherwise.
static boolean isPersistentFieldMethod()
           
static boolean isPkField(com.sun.javadoc.MethodDoc method)
          Returns true if method is a primary key field, false otherwise.
static boolean isPkFieldInHeader(com.sun.javadoc.ClassDoc clazz)
          Returns true if clazz has ejb:pk-field defined.
static boolean isValueObjectField(com.sun.javadoc.ClassDoc clazz, com.sun.javadoc.MethodDoc method, java.lang.String valueObject)
           
 java.lang.String persistentfieldList()
          Returns a string containing comma-separated list of persistent fields with their types.
 java.lang.String persistentfieldList(java.util.Properties attributes)
          Returns a string containing comma-separated list of persistent fields with their types.
 java.lang.String persistentfieldNameValueList()
          Returns a string containing comma-separated list of persistent fields without their types in fieldname="value" format.
 java.lang.String persistentfieldNameValueList(java.util.Properties attributes)
          Returns a string containing comma-separated list of persistent fields without their types in fieldname="value" format.
 
Methods inherited from class xdoclet.ejb.tags.CmpTagsHandler
entityCmpClass, forAllCmpEntityBeans, forAllCmpFields, getEntityCmpClassFor, getEntityCmpClassPattern, ifEntityIsCmp, ifNotUsingCmp2, ifUsingCmp2, isEntityCmp, isUsingCmp2Impl
 
Methods inherited from class xdoclet.ejb.tags.EntityTagsHandler
forAllEntityBeans, ifEntity, isEntity, persistenceType, reentrant
 
Methods inherited from class xdoclet.ejb.tags.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassFor, getDependentClassTagName, getEjbIdFor, getEjbNameFor, getEjbSpec, getShortEjbNameFor, hasPermission, hasTransaction, id, ifIsAConcreteEJBean, ifLocalEjb, ifNotLocalEjb, ifNotRemoteEjb, ifRemoteEjb, isAConcreteEJBean, isEjb, isLocalEjb, isOnlyLocalEjb, isOnlyRemoteEjb, isRemoteEjb, prefixWithEjbSlash, shortEjbName, shouldTraverseSuperclassForDependentClass, symbolicClassName
 
Methods inherited from class xdoclet.XDocletTagSupport
getClassTagValue, getClassTagValue, getConstructorTagValue, getCurrentClass, getCurrentConstructor, getCurrentField, getCurrentMethod, getCurrentPackage, getCurrentTag, getDocletContext, getFieldTagValue, getFieldTagValue, getMethodTagValue, getMethodTagValue, getParameterValue, getParameterValue, getTagValue, getTagValue, getTagValue, invalidParamValueFound, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, parsePropertyString, popCurrentClass, pushCurrentClass, replaceProperties, setCurrentClass, setCurrentConstructor, setCurrentField, setCurrentMethod, setCurrentPackage, setCurrentTag, tokenizeValue
 
Methods inherited from class xdoclet.template.TemplateTagHandler
generate, getContext, getEngine, getParser, setContext, setEngine, setParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentTagsHandler

public PersistentTagsHandler()
Method Detail

isPersistentField

public static boolean isPersistentField(com.sun.javadoc.MethodDoc method)
                                 throws XDocletException
Returns true if method is a persistent field, false otherwise. Persistent fields are getter methods marked with a ejb:persistent-field tag.
Parameters:
method - Description of Parameter
Returns:
The PersistentField value
Throws:
XDocletException - Description of Exception

isValueObjectField

public static boolean isValueObjectField(com.sun.javadoc.ClassDoc clazz,
                                         com.sun.javadoc.MethodDoc method,
                                         java.lang.String valueObject)
                                  throws XDocletException

isPkField

public static boolean isPkField(com.sun.javadoc.MethodDoc method)
                         throws XDocletException
Returns true if method is a primary key field, false otherwise. PK fields are getter methods marked with a ejb:pk-field tag.
Parameters:
method - Description of Parameter
Returns:
The PkField value
Throws:
XDocletException - Description of Exception

isPkFieldInHeader

public static boolean isPkFieldInHeader(com.sun.javadoc.ClassDoc clazz)
                                 throws XDocletException
Returns true if clazz has ejb:pk-field defined.
Parameters:
clazz - Description of Parameter
Returns:
The PkFieldInHeader value
Throws:
XDocletException - Description of Exception

isPersistentFieldMethod

public static boolean isPersistentFieldMethod()

fieldList

public static java.lang.String fieldList(com.sun.javadoc.ClassDoc clazz,
                                         java.lang.String inclTag,
                                         java.lang.String exclTag,
                                         int type,
                                         java.lang.String valueObject)
                                  throws XDocletException
Returns comma-separated list of fields, excluding fields that have tags of exclTag list, including fields that have tags of inclTag list. If name_value_out is true, then the list is in fieldname="value" format.
Parameters:
inclTag - Fields that have at least of the tags of this comma-separated list are used.
exclTag - Fields that don't have all of the tags of this comma-separated list are used.
type - Type of return (0: comma separated list - 1: field=value comma separated list - 2: getter comma sperated list)
clazz - Description of Parameter
valueObject -  
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

ifHasAtLeastOnePkField

public void ifHasAtLeastOnePkField(java.lang.String template)
                            throws XDocletException
Evaluates the body if the class has at least one primary key field.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception

ifHasAtLeastOnePersistentField

public void ifHasAtLeastOnePersistentField(java.lang.String template)
                                    throws XDocletException
Evaluates the body if the class has at least one persistent field.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception

forAllPersistentFields

public void forAllPersistentFields(java.lang.String template,
                                   java.util.Properties attributes)
                            throws XDocletException
Evaluates the body for each persistent field. If only-pk="true" then use only primary keys, if not-pk="true" then use only persistent fields that are not primary keys. By default use all regardless of being primary key field or not.
Parameters:
template - The body of the block tag
attributes - Description of Parameter
Throws:
XDocletException - Description of Exception
See Also:
forAllPersistentMatchedFields(java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String)

persistentfieldList

public java.lang.String persistentfieldList(java.util.Properties attributes)
                                     throws XDocletException
Returns a string containing comma-separated list of persistent fields with their types.
Parameters:
attributes -  
Returns:
A string containing comma-separated list of persistent fields without their types.
Throws:
XDocletException - Description of Exception
See Also:
fieldList(com.sun.javadoc.ClassDoc,java.lang.String,java.lang.String,int,java.lang.String)

persistentfieldNameValueList

public java.lang.String persistentfieldNameValueList(java.util.Properties attributes)
                                              throws XDocletException
Returns a string containing comma-separated list of persistent fields without their types in fieldname="value" format.
Parameters:
attributes -  
Returns:
A string containing comma-separated list of persistent fields with their types like an ordinary method parameter definition.
Throws:
XDocletException - Description of Exception
See Also:
fieldList(com.sun.javadoc.ClassDoc,java.lang.String,java.lang.String,int,java.lang.String)

persistentfieldList

public java.lang.String persistentfieldList()
                                     throws XDocletException
Returns a string containing comma-separated list of persistent fields with their types.
Returns:
A string containing comma-separated list of persistent fields without their types.
Throws:
XDocletException - Description of Exception
See Also:
fieldList(com.sun.javadoc.ClassDoc,java.lang.String,java.lang.String,int,java.lang.String)

persistentfieldNameValueList

public java.lang.String persistentfieldNameValueList()
                                              throws XDocletException
Returns a string containing comma-separated list of persistent fields without their types in fieldname="value" format.
Returns:
A string containing comma-separated list of persistent fields with their types like an ordinary method parameter definition.
Throws:
XDocletException - Description of Exception
See Also:
fieldList(com.sun.javadoc.ClassDoc,java.lang.String,java.lang.String,int,java.lang.String)

getPkFieldsInHeader

protected java.lang.String[] getPkFieldsInHeader()
                                          throws XDocletException
Returns an array containing ejb:pk-field tags defined in class level.
Returns:
The PkFieldsInHeader value
Throws:
XDocletException - Description of Exception

forAllPersistentMatchedFields

protected void forAllPersistentMatchedFields(java.lang.String template,
                                             java.lang.String include_tags,
                                             java.lang.String exclude_tags,
                                             boolean superclasses,
                                             java.lang.String valueObject)
                                      throws XDocletException
Generate only for all Persisted Fields matching a specific Tag or Persisted fields that do not match a specific Tag
Parameters:
template - The body of the block tag
include_tags - only fields having these tags
exclude_tags - only fields not having these tags
superclasses - traverse superclasses too
valueObject -  
Throws:
XDocletException - Description of Exception
See Also:
forAllPersistentFields(java.lang.String,java.util.Properties)