Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-11-10 08:21:57 +0000
committerMarkus Tiede2014-11-10 08:22:03 +0000
commit8178d785f442bd831dbfe0e438d864af65c6c503 (patch)
tree7144f60dbca54f519aa72d2d1f8d9def9c285202 /org.eclipse.jubula.toolkit.api.gen
parent765b6a28c3d8d39a7c9105ee897120f1bf9dae62 (diff)
downloadorg.eclipse.jubula.core-8178d785f442bd831dbfe0e438d864af65c6c503.tar.gz
org.eclipse.jubula.core-8178d785f442bd831dbfe0e438d864af65c6c503.tar.xz
org.eclipse.jubula.core-8178d785f442bd831dbfe0e438d864af65c6c503.zip
Non-sprint task - enhance component type naming; + API factory method and type interfaces javadoc generation enhanced.
Diffstat (limited to 'org.eclipse.jubula.toolkit.api.gen')
-rw-r--r--org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/APIGenerator.java1
-rw-r--r--org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/genmodel/CompInfoForFactoryGen.java25
-rw-r--r--org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet2
-rw-r--r--org.eclipse.jubula.toolkit.api.gen/templates/FactoryGenerator.javajet12
4 files changed, 36 insertions, 4 deletions
diff --git a/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/APIGenerator.java b/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/APIGenerator.java
index 698fff986..80aab286c 100644
--- a/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/APIGenerator.java
+++ b/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/APIGenerator.java
@@ -253,6 +253,7 @@ public class APIGenerator {
factoryGenInfo.addCompInformation(new CompInfoForFactoryGen(
genInfo.getClassName(),
genInfo.getFqClassName(),
+ componentClass,
compInfo.hasDefaultMapping(),
compInfo.getMostSpecificVisibleSuperTypeName()));
}
diff --git a/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/genmodel/CompInfoForFactoryGen.java b/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/genmodel/CompInfoForFactoryGen.java
index 4cdac059d..b9cd54fca 100644
--- a/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/genmodel/CompInfoForFactoryGen.java
+++ b/org.eclipse.jubula.toolkit.api.gen/src/org/eclipse/jubula/toolkit/api/gen/internal/genmodel/CompInfoForFactoryGen.java
@@ -1,5 +1,7 @@
package org.eclipse.jubula.toolkit.api.gen.internal.genmodel;
+import org.eclipse.jubula.tools.internal.xml.businessmodell.ComponentClass;
+
/**
@@ -20,19 +22,24 @@ public class CompInfoForFactoryGen {
/** the most specific visible super type of a component */
private String m_mostSpecificVisibleSuperTypeName;
+
+ /** the componentClass */
+ private ComponentClass m_componentClass;
/**
* Contains all necessary information of a component for factory generation
* @param componentName the component name
* @param fqClassName the class name
+ * @param componentClass the real component class
* @param hasDefaultMapping true if and only if component has default mapping
* @param mostSpecificVisibleSuperTypeName most specific visible super type of a component
*/
public CompInfoForFactoryGen(String componentName, String fqClassName,
- boolean hasDefaultMapping,
+ ComponentClass componentClass, boolean hasDefaultMapping,
String mostSpecificVisibleSuperTypeName) {
m_componentName = componentName;
m_fqClassName = fqClassName;
+ setComponentClass(componentClass);
m_hasDefaultMapping = hasDefaultMapping;
m_mostSpecificVisibleSuperTypeName = mostSpecificVisibleSuperTypeName;
}
@@ -68,4 +75,18 @@ public class CompInfoForFactoryGen {
public String getMostSpecificVisibleSuperTypeName() {
return m_mostSpecificVisibleSuperTypeName;
}
-}
+
+ /**
+ * @return the componentClass
+ */
+ public ComponentClass getComponentClass() {
+ return m_componentClass;
+ }
+
+ /**
+ * @param componentClass the componentClass to set
+ */
+ public void setComponentClass(ComponentClass componentClass) {
+ m_componentClass = componentClass;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet b/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
index 00ba323aa..cd06ce758 100644
--- a/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
+++ b/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
@@ -96,7 +96,7 @@ import org.eclipse.jubula.toolkit.internal.annotations.TesterClass;
<%}%>
/**
- * <%if (genInterface) {%>Interface<%} else {%>Class<%}%> representing the <%=className%> component from the <%=toolkitName%> toolkit.
+ * <%if (genInterface) {%>Interface<%} else {%>Class<%}%> representing the <%if (!hasDefaultMapping && hasComponentClass) {%>{@link <%=componentClassName%>}<%} else {%><%=className%><%}%> component from the <%=toolkitName%> toolkit.
<%if (genInterface) {%>
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
diff --git a/org.eclipse.jubula.toolkit.api.gen/templates/FactoryGenerator.javajet b/org.eclipse.jubula.toolkit.api.gen/templates/FactoryGenerator.javajet
index 03ebcab64..a60db0ea8 100644
--- a/org.eclipse.jubula.toolkit.api.gen/templates/FactoryGenerator.javajet
+++ b/org.eclipse.jubula.toolkit.api.gen/templates/FactoryGenerator.javajet
@@ -3,7 +3,8 @@ package="org.eclipse.jubula.toolkit.api.gen"
imports="java.util.*
org.eclipse.jubula.toolkit.api.gen.internal.genmodel.FactoryGenInfo
org.eclipse.jubula.toolkit.api.gen.internal.genmodel.CompInfoForFactoryGen
- org.eclipse.jubula.toolkit.api.gen.internal.genmodel.CommonGenInfo"
+ org.eclipse.jubula.toolkit.api.gen.internal.genmodel.CommonGenInfo
+ org.eclipse.jubula.tools.internal.xml.businessmodell.ComponentClass"
class="FactoryGenerator"%>
<%
CommonGenInfo genInfo = (CommonGenInfo)argument;
@@ -56,12 +57,21 @@ public final class <%=factoryName%> {
<%for (CompInfoForFactoryGen compInfo : compInfoList) {
String componentName = compInfo.getComponentName();
String implClassName = compInfo.getClassName();
+ ComponentClass componentClass = compInfo.getComponentClass();
+ String componentClassName = "";
+ boolean hasComponentClass = false;
+ if (componentClass != null && !componentClass.getName().isEmpty()) {
+ componentClassName = componentClass.getName();
+ hasComponentClass = true;
+ }
String returnType = compInfo.getMostSpecificVisibleSuperTypeName();
Boolean hasDefaultMapping = compInfo.hasDefaultMapping();%>
<%if (hasDefaultMapping) {%>
+ /** create a new representative for a {@link <%=componentName%>} component.*/
@NonNull public static <%=returnType%> create<%=componentName%> () {
return new <%=implClassName%>();
}<%} else {%>
+ /** create a new representative for a <%if (hasComponentClass) {%>{@link <%=componentClassName%>}<%} else {%><%=componentName%><%}%> UI component.*/
@NonNull public static <%=returnType%> create<%=componentName%> (@NonNull ComponentIdentifier componentIdentifier) {
Validate.notNull(componentIdentifier);
return new <%=implClassName%>(componentIdentifier);

Back to the top