You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ke...@apache.org on 2004/10/22 00:24:55 UTC
svn commit: rev 55279 - in incubator/beehive/trunk: controls/src/runtime/org/apache/beehive/controls/runtime/generator controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt controls/test/src/controls/org/apache/beehive/controls/test/controls/assembly netui/test/webapps/drt/coreWeb/databinding/controls/methodTest
Author: kentam
Date: Thu Oct 21 15:24:55 2004
New Revision: 55279
Modified:
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ImplInitializer.java
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/assembly/AssemblyTestControlImpl.jcs
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs
Log:
BEEHIVE-21: Control Impl's Compile even if they do not implement their interface
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ImplInitializer.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ImplInitializer.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ImplInitializer.java Thu Oct 21 15:24:55 2004
@@ -17,7 +17,6 @@
* $Header:$
*/
-import java.lang.reflect.Field;
import java.util.ArrayList;
/**
@@ -28,7 +27,7 @@
{
/**
* Constructs a new ImplInitializer class supporting a particular control bean implementation
- * @param beanInterface the public interface associated with the bean
+ * @param controlImpl the control implementation to be initialized
*/
protected ImplInitializer(ControlImpl controlImpl)
{
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlClient.java Thu Oct 21 15:24:55 2004
@@ -32,7 +32,7 @@
public class AptControlClient extends ControlClient
{
/**
- * Constructs a new ControlImpl instance where information is derived
+ * Constructs a new ControlClient instance where information is derived
* from APT metadata
* @param decl the annotated declaration
*/
@@ -109,7 +109,7 @@
public GenClass getSuperClass() { return null; }
/**
- * Returns the fully qualified package name of the ControlImpl
+ * Returns the fully qualified package name of the control client
*/
public String getPackage()
{
@@ -120,7 +120,8 @@
}
/**
- * Returns the unqualified classname of this ControlImpl
+ * Returns the unqualified classname of the control client
+ * Note that if the client is nested, this will not return the containing class/intf names.
*/
public String getShortName()
{
@@ -137,9 +138,6 @@
{
if ( _clientDecl == null )
return "";
-
- assert ( getPackage().equals("") ? _clientDecl.getQualifiedName().equals( getShortName() ) :
- _clientDecl.getQualifiedName().equals( getPackage() + "." + getShortName() ) );
return _clientDecl.getQualifiedName();
}
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlImplementation.java Thu Oct 21 15:24:55 2004
@@ -64,6 +64,13 @@
_implDecl = (ClassDeclaration)decl;
init();
+
+ if ( getControlInterface() == null )
+ {
+ env.getMessager().printError(decl.getPosition(),
+ "Control implementations must implement a control interface");
+ return;
+ }
}
/**
@@ -118,6 +125,7 @@
/**
* Returns the unqualified classname of this ControlImpl
+ * Note that if the class is nested, this will not return the containing class/intf names.
*/
public String getShortName()
{
@@ -134,9 +142,6 @@
{
if ( _implDecl == null )
return "";
-
- assert ( getPackage().equals("") ? _implDecl.getQualifiedName().equals( getShortName() ) :
- _implDecl.getQualifiedName().equals( getPackage() + "." + getShortName() ) );
return _implDecl.getQualifiedName();
}
Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java
==============================================================================
--- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java (original)
+++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/apt/AptControlInterface.java Thu Oct 21 15:24:55 2004
@@ -264,7 +264,8 @@
}
/**
- * Returns the unqualified classname of this ControlInterface
+ * Returns the unqualified classname of this ControlInterface.
+ * Note that if the interface is nested, this will not return the containing class/intf names.
*/
public String getShortName()
{
@@ -282,9 +283,6 @@
if ( _intfDecl == null || _intfDecl.getQualifiedName() == null )
return "";
- assert ( getPackage().equals("") ? _intfDecl.getQualifiedName().equals( getShortName() ) :
- _intfDecl.getQualifiedName().equals( getPackage() + "." + getShortName() ) );
-
return _intfDecl.getQualifiedName();
}
Modified: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/assembly/AssemblyTestControlImpl.jcs
==============================================================================
--- incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/assembly/AssemblyTestControlImpl.jcs (original)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/assembly/AssemblyTestControlImpl.jcs Thu Oct 21 15:24:55 2004
@@ -5,5 +5,5 @@
@ControlImplementation(
assembler = AssemblyTestAssembler.class
)
-public class AssemblyTestControlImpl implements java.io.Serializable
+public class AssemblyTestControlImpl implements AssemblyTestControl, java.io.Serializable
{ }
Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/databinding/controls/methodTest/MethodTestImpl.jcs Thu Oct 21 15:24:55 2004
@@ -6,10 +6,10 @@
import org.apache.beehive.controls.api.bean.ControlImplementation;
@ControlImplementation
-public class MethodTestImpl
+public class MethodTestImpl implements MethodTest
{
public String publicMethod() {return "public method";}
public String publicMethodZeroArg() {return "public method: zero arg";}
public String publicMethodOneArg(int value1) {return "public method: value1: " + value1;}
public String publicMethodTwoArg(int value1, int value2) {return "public method: value1: " + value1 + " value2: " + value2;}
-}
\ No newline at end of file
+}