xdoclet.modules.ejb

Class EjbTagsHandler

public class EjbTagsHandler extends XDocletTagSupport

Version: $Revision: 1.30 $

Author: Ara Abrahamian (ara_e@email.com) Christoph G. Jung (christoph.jung@infor.de)

UNKNOWN: Oct 15, 2001 namespace = "Ejb"

Field Summary
static StringALL
protected static StringLOCAL_SUFFIX
static StringSERVICE_ENDPOINT
static StringSERVICE_ENDPOINT_SUFFIX
Method Summary
StringbeanType()
Returns Bean type : "Entity", "Session" or "Message Driven".
static StringchoosePackage(String packageName, String packagePattern, String subtask)
Returns modified package name for a package name.
StringconcreteFullClassName()
Returns the full-qualified name of the current class's concrete class.
StringejbExternalRefName()
Returns the name of EJB ref.
StringejbName(Properties attributes)
Returns the name of current EJB bean.
static StringejbRefName()
Returns the name of EJB ref.
static StringejbRefName(XTag tag, XClass clazz)
Returns the name of EJB ref.
protected StringextendsFromFor(XClass clazz, String tagName, String type, String extendsParamName, String defaultBaseClassName)
Returns the name of the class pk/etc class extends.
voidforAllBeans(String template)
Evaluates the body block for each EJBean derived from one of the three EJB types: EntityBean, SessionBean or MessageDrivenBean.
protected StringgetDependentClassFor(XClass clazz, String type)
sub-classes which deal with patternized class names return a reasonable value
protected StringgetDependentClassTagName()
Gets the DependentClassTagName attribute of the EjbTagsHandler object
static XClassgetEjb(String name)
Returns the class with the specified ejb name
static StringgetEjbIdFor(XClass clazz)
static StringgetEjbNameFor(XClass clazz)
Returns the EJB name of the clazz by seaching for ejb:bean's name parameter.
static StringgetEjbSpec()
Returns the EJB specification version used.
static StringgetShortEjbNameFor(XClass clazz)
Returns short version of the EJB name of the clazz.
protected booleanhasTransaction(XDoc doc)
Returns true if class/method denoted by doc has ejb:transaction tag, false otherwise.
Stringid()
Returns unique id for current ejb.
voidifIsAConcreteEJBean(String template, Properties attributes)
Evaluates the body block if current bean is a concrete bean meaning the generate parameter of ejb:bean is either not specified or equals to "true", otherwise the bean is just an abstract base class bean not meant to be used as a EJBean but serve as the base for other EJBeans.
voidifLocalEjb(String template)
voidifNotLocalEjb(String template)
voidifNotRemoteEjb(String template)
voidifNotServiceEndpointEjb(String template)
voidifRemoteEjb(String template)
voidifServiceEndpointEjb(String template)
static booleanisAConcreteEJBean(XClass clazz)
Gets the AConcreteEJBean attribute of the EjbTagsHandler class
static booleanisEjb(XClass clazz)
Returns true of clazz is an EJB (derived from an EJB type), false otherwise.
static booleanisLocalEjb(XClass clazz)
static booleanisOnlyLocalEjb(XClass clazz)
Returns true if clazz is only a local EJB by looking at ejb:bean's view-type parameter.
static booleanisOnlyRemoteEjb(XClass clazz)
Returns true if clazz is only a remote EJB by looking at ejb:bean's view-type parameter.
static booleanisOnlyServiceEndpointEjb(XClass clazz)
Returns true if clazz is only a service endpoint EJB by looking at ejb:bean's view-type parameter.
static booleanisRemoteEjb(XClass clazz)
static booleanisServiceEndpointEjb(XClass clazz)
protected static StringprefixWithEjbSlash(String ejbName)
Replace "." by "/" and add "ejb/" to the parameter.
StringshortEjbName()
Returns short version of ejbName().
protected booleanshouldTraverseSuperclassForDependentClass(XClass clazz, String tagName)
Describe what the method does
StringsymbolicClassName()
Returns the symbolic name of the current class.

Field Detail

ALL

public static final String ALL

LOCAL_SUFFIX

protected static final String LOCAL_SUFFIX

SERVICE_ENDPOINT

public static final String SERVICE_ENDPOINT

SERVICE_ENDPOINT_SUFFIX

public static final String SERVICE_ENDPOINT_SUFFIX

Method Detail

beanType

public String beanType()
Returns Bean type : "Entity", "Session" or "Message Driven".

Returns: "Entity", "Session" or "Message Driven".

Throws: XDocletException

See Also: EntityTagsHandler SessionTagsHandler MdbTagsHandler

UNKNOWN: type = "content"

choosePackage

public static String choosePackage(String packageName, String packagePattern, String subtask)
Returns modified package name for a package name. If package name ends with one of the toReplace Strings, then it's substituted by the replaceWith String. If packagePattern not null then it's roughly used.

Parameters: packageName The name of the package name the new package name will be derived from packagePattern The package pattern to use. Can be null subtask

Returns: Description of the Returned Value

UNKNOWN: this method is really an utility method that should be deprecated here and moved to PackageTagsHandler or even somewhere else

concreteFullClassName

public String concreteFullClassName()
Returns the full-qualified name of the current class's concrete class. This is the class that is generated and is derived from current class.

Returns: The full-qualified name of the current class's concrete class

Throws: XDocletException

See Also: sessionClass entityBmpClass entityCmpClass messageDrivenClass

UNKNOWN: type = "content"

ejbExternalRefName

public String ejbExternalRefName()
Returns the name of EJB ref.

Returns: The name of current EJB bean.

Throws: XDocletException

UNKNOWN: type = "content"

ejbName

public String ejbName(Properties attributes)
Returns the name of current EJB bean.

Parameters: attributes The attributes of the template tag

Returns: The name of current EJB bean.

Throws: XDocletException

See Also: EjbTagsHandler

UNKNOWN: type = "content" name = "prefixWithEjbSlash" optional = "true" values = "true,false" description = "Specifies * whether to prefix it with ejb/ or not. False by default."

ejbRefName

public static String ejbRefName()
Returns the name of EJB ref.

Returns: The name of current EJB bean.

Throws: XDocletException

UNKNOWN: type = "content"

ejbRefName

public static String ejbRefName(XTag tag, XClass clazz)
Returns the name of EJB ref.

Parameters: tag clazz

Returns: The name of current EJB bean.

Throws: XDocletException

UNKNOWN: type = "content"

extendsFromFor

protected String extendsFromFor(XClass clazz, String tagName, String type, String extendsParamName, String defaultBaseClassName)
Returns the name of the class pk/etc class extends.

Parameters: clazz the class tagName name of the tag (ejb:bean for example, used for getting generate parameter) type type value used for view type of remote/local extendsParamName extends parameter name (is "extends" for ejb:bean but is "local-extends" for local) defaultBaseClassName default base class name, returned when not deriving from another base class

Returns: correct value for the extends statement of a generated class

Throws: XDocletException

forAllBeans

public void forAllBeans(String template)
Evaluates the body block for each EJBean derived from one of the three EJB types: EntityBean, SessionBean or MessageDrivenBean.

Parameters: template The body of the block tag

Throws: XDocletException

See Also: EntityTagsHandler SessionTagsHandler MdbTagsHandler

UNKNOWN: type = "block"

getDependentClassFor

protected String getDependentClassFor(XClass clazz, String type)
sub-classes which deal with patternized class names return a reasonable value

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

getDependentClassTagName

protected String getDependentClassTagName()
Gets the DependentClassTagName attribute of the EjbTagsHandler object

Returns: The DependentClassTagName value

getEjb

public static XClass getEjb(String name)
Returns the class with the specified ejb name

Parameters: name

Returns:

Throws: XDocletException

getEjbIdFor

public static String getEjbIdFor(XClass clazz)

Parameters: clazz Description of Parameter

Returns: a unique id for clazz

getEjbNameFor

public static String getEjbNameFor(XClass clazz)
Returns the EJB name of the clazz by seaching for ejb:bean's name parameter. If that is not found, it uses the class' name minus any suffix from the list in the 'ejbClassNameSuffix' config parameter ("Bean,EJB,Ejb" by default).

Parameters: clazz The EJB bean class for which we want the EJB name

Returns: The EjbName value

See Also: EjbTagsHandler

getEjbSpec

public static String getEjbSpec()
Returns the EJB specification version used. The generated files will be compatible with the version specified.

Returns: The Ejbspec value

getShortEjbNameFor

public static String getShortEjbNameFor(XClass clazz)
Returns short version of the EJB name of the clazz.

Parameters: clazz the class we want its short EJB name

Returns: The shortEjbName value

See Also: shortEjbName

hasTransaction

protected boolean hasTransaction(XDoc doc)
Returns true if class/method denoted by doc has ejb:transaction tag, false otherwise.

Parameters: doc Description of Parameter

Returns: Description of the Returned Value

Throws: XDocletException

id

public String id()
Returns unique id for current ejb.

Returns: Description of the Returned Value

Throws: XDocletException

UNKNOWN: type = "content"

ifIsAConcreteEJBean

public void ifIsAConcreteEJBean(String template, Properties attributes)
Evaluates the body block if current bean is a concrete bean meaning the generate parameter of ejb:bean is either not specified or equals to "true", otherwise the bean is just an abstract base class bean not meant to be used as a EJBean but serve as the base for other EJBeans.

Parameters: template The body of the block tag attributes The attributes of the template tag

Throws: XDocletException

UNKNOWN: type = "block"

ifLocalEjb

public void ifLocalEjb(String template)

Parameters: template Description of Parameter

Throws: XDocletException

UNKNOWN: type = "block"

ifNotLocalEjb

public void ifNotLocalEjb(String template)

Parameters: template

Throws: XDocletException

UNKNOWN: type = "block"

ifNotRemoteEjb

public void ifNotRemoteEjb(String template)

Parameters: template

Throws: XDocletException

UNKNOWN: type = "block"

ifNotServiceEndpointEjb

public void ifNotServiceEndpointEjb(String template)

Parameters: template

Throws: XDocletException

UNKNOWN: type = "block"

ifRemoteEjb

public void ifRemoteEjb(String template)

Parameters: template Description of Parameter

Throws: XDocletException

UNKNOWN: type = "block"

ifServiceEndpointEjb

public void ifServiceEndpointEjb(String template)

Parameters: template Description of Parameter

Throws: XDocletException

UNKNOWN: type = "block"

isAConcreteEJBean

public static boolean isAConcreteEJBean(XClass clazz)
Gets the AConcreteEJBean attribute of the EjbTagsHandler class

Parameters: clazz Describe what the parameter does

Returns: The AConcreteEJBean value

Throws: XDocletException

isEjb

public static boolean isEjb(XClass clazz)
Returns true of clazz is an EJB (derived from an EJB type), false otherwise.

Parameters: clazz Description of Parameter

Returns: The Ejb value

Throws: XDocletException

isLocalEjb

public static boolean isLocalEjb(XClass clazz)

isOnlyLocalEjb

public static boolean isOnlyLocalEjb(XClass clazz)
Returns true if clazz is only a local EJB by looking at ejb:bean's view-type parameter.

Parameters: clazz Description of Parameter

Returns: The OnlyLocalEjb value

Throws: XDocletException

isOnlyRemoteEjb

public static boolean isOnlyRemoteEjb(XClass clazz)
Returns true if clazz is only a remote EJB by looking at ejb:bean's view-type parameter.

Parameters: clazz Description of Parameter

Returns: The OnlyRemoteEjb value

Throws: XDocletException

isOnlyServiceEndpointEjb

public static boolean isOnlyServiceEndpointEjb(XClass clazz)
Returns true if clazz is only a service endpoint EJB by looking at ejb:bean's view-type parameter.

Parameters: clazz Description of Parameter

Returns: The OnlyRemoteEjb value

Throws: XDocletException

isRemoteEjb

public static boolean isRemoteEjb(XClass clazz)

isServiceEndpointEjb

public static boolean isServiceEndpointEjb(XClass clazz)

prefixWithEjbSlash

protected static String prefixWithEjbSlash(String ejbName)
Replace "." by "/" and add "ejb/" to the parameter.

Parameters: ejbName The string to parse

Returns: The parsed String

shortEjbName

public String shortEjbName()
Returns short version of ejbName(). Example: "foo.bar.MyBean" ->"MyBean", "foo/bar/MyBean" ->"MyBean"

Returns: Description of the Returned Value

Throws: XDocletException

See Also: EjbTagsHandler

UNKNOWN: type = "content"

shouldTraverseSuperclassForDependentClass

protected boolean shouldTraverseSuperclassForDependentClass(XClass clazz, String tagName)
Describe what the method does

Parameters: clazz Describe what the parameter does tagName Describe what the parameter does

Returns: Describe the return value

Throws: XDocletException

symbolicClassName

public String symbolicClassName()
Returns the symbolic name of the current class. For an EJBean it's the value of ejb:bean's name parameter.

Returns: The symbolic name of the current class

Throws: XDocletException

See Also: shortEjbName

UNKNOWN: type = "content"