xdoclet.ejb.tags
Class PkTagsHandler

java.lang.Object
  |
  +--xdoclet.template.TemplateTagHandler
        |
        +--xdoclet.XDocletTagSupport
              |
              +--xdoclet.ejb.tags.EjbTagsHandler
                    |
                    +--xdoclet.ejb.tags.PkTagsHandler

public class PkTagsHandler
extends EjbTagsHandler

Version:
$Revision: 1.18 $
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
PkTagsHandler()
           
 
Method Summary
static boolean classHasPrimkeyField(com.sun.javadoc.ClassDoc clazz)
          Returns true if the clazz has a primkey-field defined on the ejb:bean tag (opposed to having a separate PK class)
 java.lang.String extendsFrom()
          Returns the name of the class pk class extends.
protected  java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz, java.lang.String type)
          sub-classes which deal with patternized class names return a reasonable value
protected static java.lang.String getEntityPkClassPattern()
           
static java.lang.String getPkClassFor(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getPkClassForEjbJarXmlFor(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getPrimkeyFieldFor(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getPrimkeyGetterFor(com.sun.javadoc.ClassDoc clazz)
           
static java.lang.String getPrimkeySetterFor(com.sun.javadoc.ClassDoc clazz)
           
 void ifDoesntHavePrimkeyField(java.lang.String template, java.util.Properties attributes)
          Process the tag body if the current class doesn't have a defined primkey-field
 void ifHasPrimkeyField(java.lang.String template, java.util.Properties attributes)
          Process the tag body if the current class has a defined primkey-field
 void ifHasPrimkeySetter(java.lang.String template, java.util.Properties attributes)
          Process the tag body if the current class has defined a setter for the primkey-field.
 void ifIsNotPrimkeyField(java.lang.String template, java.util.Properties attributes)
          Process the tag body if the current method is not a getter or setter for the primkey-field
 void ifIsPkField(java.lang.String template)
          Evaluates the body if the current method is a primary key field.
 void ifIsPrimkeyField(java.lang.String template, java.util.Properties attributes)
          Process the tag body if the current method is a getter or setter for the primkey-field
static boolean isMethodPrimkeyField(com.sun.javadoc.ClassDoc clazz, com.sun.javadoc.MethodDoc method)
           
 java.lang.String pkClass()
          Returns the name of generated PK class for the current class.
 java.lang.String pkClassForEjbJarXml()
          Returns the name of PK class for the current class.
 java.lang.String pkfieldList()
          Returns a string containing comma-separated list of primary key fields with their types.
 java.lang.String pkfieldListFrom(java.util.Properties attributes)
          Returns a string containing comma-separated list of primary key fields getting from an object specified as parameter.
 java.lang.String primkeyField(java.util.Properties attributes)
          Returns the primkey-field defined for the current class
 java.lang.String primkeyGetter(java.util.Properties attributes)
          Returns the getter name for the primkey-field
 java.lang.String primkeySetter(java.util.Properties attributes)
          Returns the setter name for the primkey-field
 java.lang.String serialVersionUID()
           
 
Methods inherited from class xdoclet.ejb.tags.EjbTagsHandler
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, extendsFromFor, forAllBeans, 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

PkTagsHandler

public PkTagsHandler()
Method Detail

getPrimkeyFieldFor

public static java.lang.String getPrimkeyFieldFor(com.sun.javadoc.ClassDoc clazz)
                                           throws XDocletException
Parameters:
clazz - The class to look into
Returns:
The value of the ejb:bean primkey-field parameter
Throws:
XDocletException - if the class doesn't have a primkey-field

isMethodPrimkeyField

public static boolean isMethodPrimkeyField(com.sun.javadoc.ClassDoc clazz,
                                           com.sun.javadoc.MethodDoc method)
                                    throws XDocletException
Parameters:
clazz - The class to look into
method - The method to check for primkey-field
Returns:
true if the method is a getter or setter for the primkey-field
Throws:
XDocletException -  

getPrimkeyGetterFor

public static java.lang.String getPrimkeyGetterFor(com.sun.javadoc.ClassDoc clazz)
                                            throws XDocletException

getPrimkeySetterFor

public static java.lang.String getPrimkeySetterFor(com.sun.javadoc.ClassDoc clazz)
                                            throws XDocletException

getPkClassFor

public static java.lang.String getPkClassFor(com.sun.javadoc.ClassDoc clazz)
                                      throws XDocletException

getPkClassForEjbJarXmlFor

public static java.lang.String getPkClassForEjbJarXmlFor(com.sun.javadoc.ClassDoc clazz)
                                                  throws XDocletException

classHasPrimkeyField

public static boolean classHasPrimkeyField(com.sun.javadoc.ClassDoc clazz)
                                    throws XDocletException
Returns true if the clazz has a primkey-field defined on the ejb:bean tag (opposed to having a separate PK class)
Parameters:
clazz - The class to look into.
Returns:
true if the class has a defined primkey-field
Throws:
XDocletException -  

getEntityPkClassPattern

protected static java.lang.String getEntityPkClassPattern()

ifHasPrimkeyField

public void ifHasPrimkeyField(java.lang.String template,
                              java.util.Properties attributes)
                       throws XDocletException
Process the tag body if the current class has a defined primkey-field
Parameters:
template -  
attributes -  
Throws:
XDocletException -  

ifIsPrimkeyField

public void ifIsPrimkeyField(java.lang.String template,
                             java.util.Properties attributes)
                      throws XDocletException
Process the tag body if the current method is a getter or setter for the primkey-field
Parameters:
template -  
attributes -  
Throws:
XDocletException -  

ifIsNotPrimkeyField

public void ifIsNotPrimkeyField(java.lang.String template,
                                java.util.Properties attributes)
                         throws XDocletException
Process the tag body if the current method is not a getter or setter for the primkey-field
Parameters:
template -  
attributes -  
Throws:
XDocletException -  

ifDoesntHavePrimkeyField

public void ifDoesntHavePrimkeyField(java.lang.String template,
                                     java.util.Properties attributes)
                              throws XDocletException
Process the tag body if the current class doesn't have a defined primkey-field
Parameters:
template -  
attributes -  
Throws:
XDocletException -  

primkeyField

public java.lang.String primkeyField(java.util.Properties attributes)
                              throws XDocletException
Returns the primkey-field defined for the current class
Parameters:
attributes -  
Returns:
The value of the ejb:bean primkey-field parameter
Throws:
XDocletException -  

primkeyGetter

public java.lang.String primkeyGetter(java.util.Properties attributes)
                               throws XDocletException
Returns the getter name for the primkey-field
Parameters:
attributes -  
Returns:
The primkey-field getter
Throws:
XDocletException -  

primkeySetter

public java.lang.String primkeySetter(java.util.Properties attributes)
                               throws XDocletException
Returns the setter name for the primkey-field
Parameters:
attributes -  
Returns:
The primkey-field setter
Throws:
XDocletException -  

ifHasPrimkeySetter

public void ifHasPrimkeySetter(java.lang.String template,
                               java.util.Properties attributes)
                        throws XDocletException
Process the tag body if the current class has defined a setter for the primkey-field.
Parameters:
template -  
attributes -  
Throws:
XDocletException -  

pkClass

public java.lang.String pkClass()
                         throws XDocletException
Returns the name of generated PK class for the current class.
Returns:
The name of generated PK class.
Throws:
XDocletException - Description of Exception

pkClassForEjbJarXml

public java.lang.String pkClassForEjbJarXml()
                                     throws XDocletException
Returns the name of PK class for the current class.
Returns:
The name of generated PK class.
Throws:
XDocletException - Description of Exception

serialVersionUID

public java.lang.String serialVersionUID()
                                  throws XDocletException
Returns:
Description of the Returned Value
Throws:
XDocletException - Description of Exception

pkfieldList

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

pkfieldListFrom

public java.lang.String pkfieldListFrom(java.util.Properties attributes)
                                 throws XDocletException
Returns a string containing comma-separated list of primary key fields getting from an object specified as parameter.
Parameters:
attributes -  
Returns:
A string containing comma-separated list of primary key fields without their types.
Throws:
XDocletException - Description of Exception
See Also:
PersistentTagsHandler.fieldList(com.sun.javadoc.ClassDoc,java.lang.String,java.lang.String,int,java.lang.String)

extendsFrom

public java.lang.String extendsFrom()
                             throws XDocletException
Returns the name of the class pk class extends.
Returns:
The name of generated PK class.
Throws:
XDocletException - Description of Exception

ifIsPkField

public void ifIsPkField(java.lang.String template)
                 throws XDocletException
Evaluates the body if the current method is a primary key field.
Parameters:
template - The body of the block tag
Throws:
XDocletException - Description of Exception

getDependentClassFor

protected java.lang.String getDependentClassFor(com.sun.javadoc.ClassDoc clazz,
                                                java.lang.String type)
                                         throws XDocletException
Description copied from class: EjbTagsHandler
sub-classes which deal with patternized class names return a reasonable value
Overrides:
getDependentClassFor in class EjbTagsHandler
Following copied from class: xdoclet.ejb.tags.EjbTagsHandler
Parameters:
clazz - the class
type - type value used for view-type of remote/local
Returns:
dependent class name for the class and type
Throws:
XDocletException -