User: ara_e_w
Date: 02/05/26 13:29:54
Modified: modules/ejb/src/xdoclet/modules/ejb/home Tag:
MODULE_REFACTORING_BRANCH HomeInterfaceSubTask.java
HomeTagsHandler.java LocalHomeInterfaceSubTask.java
Log:
xjavadoc javabeaninifiction refactoring
Revision Changes Path
No revision
No revision
1.1.2.10 +6 -6
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeInterfaceSubTask.java
Index: HomeInterfaceSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeInterfaceSubTask.java,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -w -r1.1.2.9 -r1.1.2.10
--- HomeInterfaceSubTask.java 15 May 2002 19:19:28 -0000 1.1.2.9
+++ HomeInterfaceSubTask.java 26 May 2002 20:29:54 -0000 1.1.2.10
@@ -27,7 +27,7 @@
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created Oct 15, 2001
* @xdoclet:subtask name="homeinterface"
parent="xdoclet.modules.ejb.EjbDocletTask"
- * @version $Revision: 1.1.2.9 $
+ * @version $Revision: 1.1.2.10 $
*/
public class HomeInterfaceSubTask extends AbstractEjbCodeGeneratorSubTask
{
@@ -151,20 +151,20 @@
Log log = LogUtil.getLog(HomeInterfaceSubTask.class,
"matchesGenerationRules");
if (InterfaceTagsHandler.isOnlyLocalEjb(getCurrentClass())) {
- log.debug("Reject file " + clazz.qualifiedName() + " because of
view-type local");
+ log.debug("Reject file " + clazz.getQualifiedName() + " because of
view-type local");
return false;
}
- XTag interfaceTag = getCurrentClass().doc().tag("ejb:interface", false);
+ XTag interfaceTag = getCurrentClass().getDoc().getTag("ejb:interface",
false);
if (interfaceTag == null) {
return true;
}
- String generate = interfaceTag.attributeValue("generate");
+ String generate = interfaceTag.getAttributeValue("generate");
if ((generate != null) && (generate.indexOf("remote") == -1)) {
- log.debug("Skip home interface for " + clazz.qualifiedName() + "
because of generate=" + generate + " flag.");
+ log.debug("Skip home interface for " + clazz.getQualifiedName() + "
because of generate=" + generate + " flag.");
return false;
}
@@ -180,7 +180,7 @@
protected void engineStarted() throws XDocletException
{
System.out.println(Translator.getString("xdoclet.modules.ejb.Messages",
"generating_home_for",
- new String[]{getCurrentClass().qualifiedName()}));
+ new String[]{getCurrentClass().getQualifiedName()}));
}
}
1.1.2.7 +41 -41
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeTagsHandler.java
Index: HomeTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/HomeTagsHandler.java,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -w -r1.1.2.6 -r1.1.2.7
--- HomeTagsHandler.java 15 May 2002 19:19:28 -0000 1.1.2.6
+++ HomeTagsHandler.java 26 May 2002 20:29:54 -0000 1.1.2.7
@@ -33,7 +33,7 @@
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created Oct 15, 2001
* @xdoclet:taghandler namespace="EjbHome"
- * @version $Revision: 1.1.2.6 $
+ * @version $Revision: 1.1.2.7 $
*/
public class HomeTagsHandler extends EjbTagsHandler
{
@@ -73,31 +73,31 @@
"method_only_takes_remote_or_local", new
String[]{"getHomeInterface", type}));
}
- String fileName = clazz.containingPackage().name();
+ String fileName = clazz.getContainingPackage().getName();
String name_pattern = null;
String package_pattern = null;
String home_interface = null;
- home_interface = clazz.doc().tagAttributeValue("ejb:home", type + "-class");
+ home_interface = clazz.getDoc().getTagAttributeValue("ejb:home", type +
"-class");
if (log.isDebugEnabled()) {
- log.debug(type + " home Interface for " + clazz.qualifiedName() + " = "
+ home_interface);
+ log.debug(type + " home Interface for " + clazz.getQualifiedName() + "
= " + home_interface);
}
if (home_interface != null) {
return home_interface;
}
- name_pattern = clazz.doc().tagAttributeValue("ejb:home", type + "-pattern");
+ name_pattern = clazz.getDoc().getTagAttributeValue("ejb:home", type +
"-pattern");
if (name_pattern == null) {
- name_pattern = clazz.doc().tagAttributeValue("ejb:home", "pattern");
+ name_pattern = clazz.getDoc().getTagAttributeValue("ejb:home",
"pattern");
if (name_pattern == null) {
name_pattern = "remote".equals(type) ? getHomeClassPattern() :
getLocalHomeClassPattern();
}
}
- package_pattern = clazz.doc().tagAttributeValue("ejb:home", type +
"-package");
+ package_pattern = clazz.getDoc().getTagAttributeValue("ejb:home", type +
"-package");
if (package_pattern == null) {
- package_pattern = clazz.doc().tagAttributeValue("ejb:home", "package");
+ package_pattern = clazz.getDoc().getTagAttributeValue("ejb:home",
"package");
}
String ejb_name = null;
@@ -134,7 +134,7 @@
*/
public static boolean isRemoveMethod(XMethod method) throws XDocletException
{
- return method.name().equals("ejbRemove");
+ return method.getName().equals("ejbRemove");
}
/**
@@ -146,7 +146,7 @@
*/
public static boolean isCreateMethod(XMethod method) throws XDocletException
{
- return method.doc().hasTag("ejb:create-method");
+ return method.getDoc().hasTag("ejb:create-method");
}
/**
@@ -158,7 +158,7 @@
*/
public static boolean isHomeMethod(XMethod method) throws XDocletException
{
- return method.doc().hasTag("ejb:home-method");
+ return method.getDoc().hasTag("ejb:home-method");
}
/**
@@ -189,7 +189,7 @@
*/
public static boolean isFinderMethod(XMethod method) throws XDocletException
{
- return method.name().startsWith("ejbFind");
+ return method.getName().startsWith("ejbFind");
}
/**
@@ -205,11 +205,11 @@
public static String getHomeDefinition(XClass clazz, XMethod method, String
tagType, String type)
throws XDocletException
{
- String methodName = method.name().substring(3);
+ String methodName = method.getName().substring(3);
StringBuffer homeMethodName = new StringBuffer();
if (tagType.equals("ejb:finder")) {
- String ejbReturn = method.returnType().toString();
+ String ejbReturn = method.getReturnType().toString();
if (ejbReturn.equals("java.util.Collection")) {
homeMethodName.append(ejbReturn);
@@ -231,7 +231,7 @@
homeMethodName.append(methodName.substring(1));
homeMethodName.append("(");
- StringTokenizer st = new StringTokenizer(method.signature().substring(1,
method.signature().length() - 1), ",");
+ StringTokenizer st = new StringTokenizer(method.getSignature().substring(1,
method.getSignature().length() - 1), ",");
int k = 1;
while (st.hasMoreTokens()) {
@@ -284,7 +284,7 @@
*/
public static XMethod findFirstCreateMethodFor(XClass clazz) throws
XDocletException
{
- XMethod[] methods = clazz.methods();
+ XMethod[] methods = clazz.getMethods();
do {
for (int i = 0; i < methods.length; i++) {
@@ -295,7 +295,7 @@
}
}
- clazz = clazz.superclass();
+ clazz = clazz.getSuperclass();
} while (clazz != null);
return null;
@@ -414,8 +414,8 @@
boolean superclasses = TypeConversionUtil.stringToBoolean(superclasses_str,
true);
if (isCreateMethod(getCurrentMethod())) {
- boolean currentMethodDoesntBelongToCurrentClass =
!getCurrentMethod().containingClass().equals(getCurrentClass());
- boolean shouldTraverse =
shouldTraverseSuperclassForDependentClass(getCurrentMethod().containingClass(),
"ejb:home");
+ boolean currentMethodDoesntBelongToCurrentClass =
!getCurrentMethod().getContainingClass().equals(getCurrentClass());
+ boolean shouldTraverse =
shouldTraverseSuperclassForDependentClass(getCurrentMethod().getContainingClass(),
"ejb:home");
if (superclasses == false && currentMethodDoesntBelongToCurrentClass ==
true && shouldTraverse == false) {
return;
@@ -443,7 +443,7 @@
+ currentMethod);
}
- StringBuffer currentMethodName = new
StringBuffer(currentMethod.nameWithSignature());
+ StringBuffer currentMethodName = new
StringBuffer(currentMethod.getNameWithSignature());
currentMethodName.insert(3, "Post");
@@ -463,7 +463,7 @@
*/
public String ejbPostCreateSignature(Properties attributes)
{
- StringBuffer currentMethodName = new
StringBuffer(getCurrentMethod().name());
+ StringBuffer currentMethodName = new
StringBuffer(getCurrentMethod().getName());
currentMethodName.insert(3, "Post");
return currentMethodName.toString();
@@ -486,7 +486,7 @@
boolean superclasses = TypeConversionUtil.stringToBoolean(superclasses_str,
true);
if (isHomeMethod(getCurrentMethod())) {
- if (superclasses == false && getCurrentMethod().containingClass() !=
getCurrentClass() &&
shouldTraverseSuperclassForDependentClass(getCurrentMethod().containingClass(),
"ejb:home") == false) {
+ if (superclasses == false && getCurrentMethod().getContainingClass() !=
getCurrentClass() &&
shouldTraverseSuperclassForDependentClass(getCurrentMethod().getContainingClass(),
"ejb:home") == false) {
return;
}
@@ -576,12 +576,12 @@
public String jndiName(Properties attributes) throws XDocletException
{
String type = attributes.getProperty("type");
- XTag bean_tag = getCurrentClass().doc().tag("ejb:bean");
+ XTag bean_tag = getCurrentClass().getDoc().getTag("ejb:bean");
String compName = getCompNameFor(getCurrentClass(), type);
if (bean_tag != null) {
- String jndiName =
dereferenceProperties(bean_tag.attributeValue("jndi-name"));
- String localJndiName =
dereferenceProperties(bean_tag.attributeValue("local-jndi-name"));
+ String jndiName =
dereferenceProperties(bean_tag.getAttributeValue("jndi-name"));
+ String localJndiName =
dereferenceProperties(bean_tag.getAttributeValue("local-jndi-name"));
//Return "local" jndi name
if ("local".equals(type)) {
@@ -644,15 +644,15 @@
Set already = new HashSet();
// Exclude definition coming from super classes
- XClass currentClass = getCurrentClass().superclass();
+ XClass currentClass = getCurrentClass().getSuperclass();
while (currentClass != null) {
if (log.isDebugEnabled()) {
- log.debug("Looking for super definition in " + currentClass.name());
+ log.debug("Looking for super definition in " +
currentClass.getName());
}
// 1. METHOD tags
- XMethod[] methods = currentClass.methods();
+ XMethod[] methods = currentClass.getMethods();
for (int i = 0; i < methods.length; i++) {
XMethod method = methods[i];
@@ -677,11 +677,11 @@
}
// 2. CLASS tags
- XTag[] superTags = currentClass.doc().tags(tagType, true);
+ XTag[] superTags = currentClass.getDoc().getTags(tagType, true);
for (int i = 0; i < superTags.length; i++) {
- String signature =
fullPackageChange(superTags[i].attributeValue("signature"));
- String typeMapping =
superTags[i].attributeValue("result-type-mapping");
+ String signature =
fullPackageChange(superTags[i].getAttributeValue("signature"));
+ String typeMapping =
superTags[i].getAttributeValue("result-type-mapping");
if (typeMapping == null || typeMapping.equalsIgnoreCase(type)) {
if (log.isDebugEnabled()) {
@@ -690,11 +690,11 @@
already.add(signature);
}
}
- currentClass = currentClass.superclass();
+ currentClass = currentClass.getSuperclass();
}
// 1. Handle METHOD Tag level ejb:finder
- XMethod[] methods = getCurrentClass().methods();
+ XMethod[] methods = getCurrentClass().getMethods();
boolean fbpkFound = false;
for (int i = 0; i < methods.length; i++) {
@@ -721,10 +721,10 @@
}
String viewType = null;
- XTag[] tags = method.doc().tags(tagType, superclasses);
+ XTag[] tags = method.getDoc().getTags(tagType, superclasses);
for (int k = 0; k < tags.length; k++) {
- String attr = tags[k].attributeValue("view-type");
+ String attr = tags[k].getAttributeValue("view-type");
if (attr != null) {
viewType = attr;
@@ -748,13 +748,13 @@
if (signature != null) {
setCurrentSignature(signature);
- XClass[] exceptions = method.thrownExceptions();
+ XClass[] exceptions = method.getThrownExceptions();
StringBuffer exc = new StringBuffer();
for (int j = 0; j < exceptions.length; j++) {
XClass exception = exceptions[j];
- exc.append(exception.qualifiedName());
+ exc.append(exception.getQualifiedName());
if (j != exceptions.length - 1) {
exc.append(',');
}
@@ -776,7 +776,7 @@
// If custom findByPrimaryKey exists then we should not add the
// mandatory later
- if (method.name().equals("findByPrimaryKey")) {
+ if (method.getName().equals("findByPrimaryKey")) {
fbpkFound = true;
}
@@ -785,11 +785,11 @@
}
// 2. Handle CLASS Tag level ejb:finder
- XTag[] tags = getCurrentClass().doc().tags(tagType, superclasses);
+ XTag[] tags = getCurrentClass().getDoc().getTags(tagType, superclasses);
for (int i = 0; i < tags.length; i++) {
- String signature =
fullPackageChange(tags[i].attributeValue("signature"));
- String typeMapping = tags[i].attributeValue("result-type-mapping");
+ String signature =
fullPackageChange(tags[i].getAttributeValue("signature"));
+ String typeMapping = tags[i].getAttributeValue("result-type-mapping");
if (typeMapping == null || typeMapping.equalsIgnoreCase(type)) {
if (!already.add(signature)) {
1.1.2.10 +6 -6
xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/LocalHomeInterfaceSubTask.java
Index: LocalHomeInterfaceSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/Attic/LocalHomeInterfaceSubTask.java,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -w -r1.1.2.9 -r1.1.2.10
--- LocalHomeInterfaceSubTask.java 15 May 2002 19:19:28 -0000 1.1.2.9
+++ LocalHomeInterfaceSubTask.java 26 May 2002 20:29:54 -0000 1.1.2.10
@@ -26,7 +26,7 @@
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created Oct 15, 2001
* @xdoclet:subtask name="localhomeinterface"
parent="xdoclet.modules.ejb.EjbDocletTask"
- * @version $Revision: 1.1.2.9 $
+ * @version $Revision: 1.1.2.10 $
*/
public class LocalHomeInterfaceSubTask extends AbstractEjbCodeGeneratorSubTask
{
@@ -140,20 +140,20 @@
Log log = LogUtil.getLog(LocalHomeInterfaceSubTask.class,
"matchesGenerationRules");
if (InterfaceTagsHandler.isOnlyRemoteEjb(getCurrentClass())) {
- log.debug("Reject file " + clazz.qualifiedName() + " because of
view-type remote");
+ log.debug("Reject file " + clazz.getQualifiedName() + " because of
view-type remote");
return false;
}
- XTag interfaceTag = getCurrentClass().doc().tag("ejb:interface");
+ XTag interfaceTag = getCurrentClass().getDoc().getTag("ejb:interface");
if (interfaceTag == null) {
return true;
}
- String generate = interfaceTag.attributeValue("generate");
+ String generate = interfaceTag.getAttributeValue("generate");
if (generate != null && generate.indexOf("local") == -1) {
- log.debug("Skip local home interface for " + clazz.qualifiedName() + "
because of generate=" + generate + " flag.");
+ log.debug("Skip local home interface for " + clazz.getQualifiedName() +
" because of generate=" + generate + " flag.");
return false;
}
@@ -168,6 +168,6 @@
protected void engineStarted() throws XDocletException
{
System.out.println(Translator.getString("xdoclet.modules.ejb.Messages",
"generating_localhome_for",
- new String[]{getCurrentClass().qualifiedName()}));
+ new String[]{getCurrentClass().getQualifiedName()}));
}
}
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel