Tags used in generating PK classes for entity EJBs.
classHasPrimkeyField
public static boolean classHasPrimkeyField(XClass clazz)
throws xdoclet.XDocletException
Returns true if the specified class has a primkey-field defined on the ejb.bean tag (opposed to having a separate
PK class).
clazz
- The class to look into.
- true if the class has a defined primkey-field
xdoclet.XDocletException
-
extendsFrom
public String extendsFrom()
throws xdoclet.XDocletException
Returns the name of the class pk class extends.
xdoclet.XDocletException
-
getDependentClassFor
protected String getDependentClassFor(XClass clazz,
String type)
throws xdoclet.XDocletException
Gets the DependentClassFor attribute of the PkTagsHandler object
clazz
- Describe what the parameter doestype
- Describe what the parameter does
- The DependentClassFor value
xdoclet.XDocletException
-
getEntityPkClassPattern
protected static String getEntityPkClassPattern()
Returns the pattern which is used to calculate the Primary Key class' name from the EJB name. The default is to
append "PK", unless overridden on the subtask.
getPkClassFor
public static String getPkClassFor(XClass clazz)
throws xdoclet.XDocletException
Get the primary key class specified for a given class. If a primary key field has been specified, using the
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 into
- Fully qualified name of the primary key's type
xdoclet.XDocletException
-
getPkClassForEjbJarXmlFor
public static String getPkClassForEjbJarXmlFor(XClass clazz)
throws xdoclet.XDocletException
Gets the PkClassForEjbJarXmlFor attribute of the PkTagsHandler class
clazz
- The class to look into
- The PkClassForEjbJarXmlFor value
xdoclet.XDocletException
-
getPrimkeyFieldFor
public static String getPrimkeyFieldFor(XClass clazz)
throws xdoclet.XDocletException
Get the primary key field specified for a given class. This is given by the primkey-field
parameter
on the ejb.bean
tag, although this may be inherited from a superclass.
clazz
- The class to look into
- The value of the ejb.bean primkey-field parameter
xdoclet.XDocletException
-
getPrimkeyGetterFor
public static String getPrimkeyGetterFor(XClass clazz)
throws xdoclet.XDocletException
Returns the getter method of the primary key field specified for a given class.
clazz
- The class to look into
- The name of the ejb.bean primkey-field parameter's getter method, or null if there
isn't one
xdoclet.XDocletException
-
getPrimkeySetterFor
public static String getPrimkeySetterFor(XClass clazz)
throws xdoclet.XDocletException
Returns the setter method of the primary key field specified for a given class.
clazz
- The class to look into
- The name of the ejb.bean primkey-field parameter's setter method, or null if there
isn't one
xdoclet.XDocletException
-
ifDoesntHavePrimkeyField
public void ifDoesntHavePrimkeyField(String template,
Properties attributes)
throws xdoclet.XDocletException
Process the tag body if the current class doesn't have a defined primkey-field.
template
- The body of the block tagattributes
- The attributes of the template tag
xdoclet.XDocletException
-
ifHasPrimkeyField
public void ifHasPrimkeyField(String template,
Properties attributes)
throws xdoclet.XDocletException
Process the tag body if the current class has a defined primkey-field.
template
- The body of the block tagattributes
- The attributes of the template tag
xdoclet.XDocletException
-
ifHasPrimkeySetter
public void ifHasPrimkeySetter(String template,
Properties attributes)
throws xdoclet.XDocletException
Process the tag body if the current class has defined a setter for the primkey-field.
template
- The body of the block tagattributes
- The attributes of the template tag
xdoclet.XDocletException
-
ifIsNotPrimkeyField
public void ifIsNotPrimkeyField(String template,
Properties attributes)
throws xdoclet.XDocletException
Process the tag body if the current method is not a getter or setter for the primkey-field.
template
- The body of the block tagattributes
- The attributes of the template tag
xdoclet.XDocletException
-
ifIsPkField
public void ifIsPkField(String template)
throws xdoclet.XDocletException
Evaluates the body if the current method is a primary key field.
template
- The body of the block tag
xdoclet.XDocletException
-
ifIsPrimkeyField
public void ifIsPrimkeyField(String template,
Properties attributes)
throws xdoclet.XDocletException
Process the tag body if the current method is a getter or setter for the primkey-field.
template
- The body of the block tagattributes
- The attributes of the template tag
xdoclet.XDocletException
-
isMethodPrimkeyField
public static boolean isMethodPrimkeyField(XClass clazz,
XMethod method)
throws xdoclet.XDocletException
Test if a given method is the getter or setter for the primary key field specified for the class.
clazz
- The class to look intomethod
- The method to check for primkey-field
- true if the method is a getter or setter for the primkey-field
xdoclet.XDocletException
-
pkClass
public String pkClass()
throws xdoclet.XDocletException
Returns the name of generated PK class for the current class.
- The name of generated PK class.
xdoclet.XDocletException
-
pkClassForEjbJarXml
public String pkClassForEjbJarXml()
throws xdoclet.XDocletException
Returns the name of PK class for the current class.
- The name of generated PK class.
xdoclet.XDocletException
-
pkfieldList
public String pkfieldList()
throws xdoclet.XDocletException
Returns a string containing comma-separated list of primary key fields with their types.
- A string containing comma-separated list of primary key fields with their types.
xdoclet.XDocletException
-
pkfieldListFrom
public String pkfieldListFrom(Properties attributes)
throws xdoclet.XDocletException
Returns a string containing comma-separated list of primary key fields getting from an object specified as
parameter.
attributes
- The attributes of the template tag
- A string containing comma-separated list of primary key fields without their types.
xdoclet.XDocletException
-
- name = "name"
optional = "false"
description = "The name of the variable to get the fields
from."
primkeyField
public String primkeyField(Properties attributes)
throws xdoclet.XDocletException
Returns the primkey-field defined for the current class.
attributes
- The attributes of the template tag
- The value of the ejb.bean primkey-field parameter
xdoclet.XDocletException
-
primkeyGetter
public String primkeyGetter(Properties attributes)
throws xdoclet.XDocletException
Returns the getter name for the primkey-field.
attributes
- The attributes of the template tag
xdoclet.XDocletException
-
primkeySetter
public String primkeySetter(Properties attributes)
throws xdoclet.XDocletException
Returns the setter name for the primkey-field.
attributes
- The attributes of the template tag
xdoclet.XDocletException
-