xdoclet.modules.ejb.entity
public class PkTagsHandler extends EjbTagsHandler
ALL, LOCAL_SUFFIX, SERVICE_ENDPOINT, SERVICE_ENDPOINT_SUFFIX
FOR_CLASS, FOR_CONSTRUCTOR, FOR_FIELD, FOR_METHOD, PARAMETER_DELIMITER
Constructor and Description |
---|
PkTagsHandler() |
Modifier and Type | Method and Description |
---|---|
static boolean |
classHasPrimkeyField(xjavadoc.XClass clazz)
Returns true if the specified class 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(xjavadoc.XClass clazz,
java.lang.String type)
Gets the DependentClassFor attribute of the PkTagsHandler object
|
protected static java.lang.String |
getEntityPkClassPattern()
Returns the pattern which is used to calculate the Primary Key class' name from the EJB name.
|
static java.lang.String |
getPkClassFor(xjavadoc.XClass clazz)
Get the primary key class specified for a given class.
|
static java.lang.String |
getPkClassForEjbJarXmlFor(xjavadoc.XClass clazz)
Gets the PkClassForEjbJarXmlFor attribute of the PkTagsHandler class
|
static java.lang.String |
getPrimkeyFieldFor(xjavadoc.XClass clazz)
Get the primary key field specified for a given class.
|
static java.lang.String |
getPrimkeyGetterFor(xjavadoc.XClass clazz)
Returns the getter method of the primary key field specified for a given class.
|
static java.lang.String |
getPrimkeySetterFor(xjavadoc.XClass clazz)
Returns the setter method of the primary key field specified for a given class.
|
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(xjavadoc.XClass clazz,
xjavadoc.XMethod method)
Test if a given method is the getter or setter for the primary key field specified for the class.
|
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.
|
beanType, choosePackage, concreteFullClassName, ejbExternalRefName, ejbName, ejbRefName, ejbRefName, extendsFromFor, forAllBeans, getDependentClassTagName, getEjb, getEjbIdFor, getEjbNameFor, getEjbSpec, getShortEjbNameFor, hasTransaction, id, ifIsAConcreteEJBean, ifLocalEjb, ifNotLocalEjb, ifNotRemoteEjb, ifNotServiceEndpointEjb, ifRemoteEjb, ifServiceEndpointEjb, isAConcreteEJBean, isEjb, isLocalEjb, isOnlyLocalEjb, isOnlyRemoteEjb, isOnlyServiceEndpointEjb, isRemoteEjb, isServiceEndpointEjb, prefixWithEjbSlash, shortEjbName, shouldTraverseSuperclassForDependentClass, symbolicClassName
delimit, expandClassName, generate, getCurrentClass, getCurrentClassTag, getCurrentConstructor, getCurrentField, getCurrentFieldTag, getCurrentMethod, getCurrentMethodTag, getCurrentPackage, getDocletContext, getEngine, getExpandedDelimitedTagValue, getTagValue, getTagValue, getTagValue, hasHavingClassTag, hasTag, isTagValueEqual, mandatoryParamNotFound, mandatoryTemplateTagParamNotFound, modifiers, popCurrentClass, pushCurrentClass, setCurrentClass, setCurrentClassTag, setCurrentConstructor, setCurrentField, setCurrentFieldTag, setCurrentMethod, setCurrentMethodTag, setCurrentPackage
getXJavaDoc, setXJavaDoc
public static java.lang.String getPrimkeyFieldFor(xjavadoc.XClass clazz) throws XDocletException
primkey-field
parameter
on the ejb.bean
tag, although this may be inherited from a superclass.clazz
- The class to look intoXDocletException
public static boolean isMethodPrimkeyField(xjavadoc.XClass clazz, xjavadoc.XMethod method) throws XDocletException
clazz
- The class to look intomethod
- The method to check for primkey-fieldXDocletException
getPrimkeyFieldFor(XClass)
public static java.lang.String getPrimkeyGetterFor(xjavadoc.XClass clazz) throws XDocletException
clazz
- The class to look intoXDocletException
getPrimkeyFieldFor(XClass)
public static java.lang.String getPrimkeySetterFor(xjavadoc.XClass clazz) throws XDocletException
clazz
- The class to look intoXDocletException
getPrimkeyFieldFor(XClass)
public static java.lang.String getPkClassFor(xjavadoc.XClass clazz) throws XDocletException
primkey-field
parameter on the ejb.bean
tag, this will be the return type of that
field's getter method. Otherwise, it will be determined by the various parameters of the ejb.pk
tag
and the subtask's settings for default pattern, packageSubstitution, etc.clazz
- The class to look intoXDocletException
public static java.lang.String getPkClassForEjbJarXmlFor(xjavadoc.XClass clazz) throws XDocletException
clazz
- The class to look intoXDocletException
public static boolean classHasPrimkeyField(xjavadoc.XClass clazz) throws XDocletException
clazz
- The class to look into.XDocletException
getPrimkeyFieldFor(XClass)
protected static java.lang.String getEntityPkClassPattern()
public void ifHasPrimkeyField(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tagXDocletException
public void ifIsPrimkeyField(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tagXDocletException
public void ifIsNotPrimkeyField(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tagXDocletException
public void ifDoesntHavePrimkeyField(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tagXDocletException
public java.lang.String primkeyField(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tagXDocletException
getPrimkeyFieldFor(XClass)
public java.lang.String primkeyGetter(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tagXDocletException
getPrimkeyGetterFor(XClass)
public java.lang.String primkeySetter(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tagXDocletException
getPrimkeySetterFor(XClass)
public void ifHasPrimkeySetter(java.lang.String template, java.util.Properties attributes) throws XDocletException
template
- The body of the block tagattributes
- The attributes of the template tagXDocletException
getPrimkeySetterFor(XClass)
public java.lang.String pkClass() throws XDocletException
XDocletException
public java.lang.String pkClassForEjbJarXml() throws XDocletException
XDocletException
public java.lang.String pkfieldList() throws XDocletException
XDocletException
PersistentTagsHandler.fieldList(XClass, String, String,
int, String, boolean)
public java.lang.String pkfieldListFrom(java.util.Properties attributes) throws XDocletException
attributes
- The attributes of the template tagXDocletException
PersistentTagsHandler.fieldList(XClass, String, String,
int, String, boolean)
public java.lang.String extendsFrom() throws XDocletException
XDocletException
public void ifIsPkField(java.lang.String template) throws XDocletException
template
- The body of the block tagXDocletException
protected java.lang.String getDependentClassFor(xjavadoc.XClass clazz, java.lang.String type) throws XDocletException
getDependentClassFor
in class EjbTagsHandler
clazz
- Describe what the parameter doestype
- Describe what the parameter doesXDocletException