FELIX-430 Default inherit attribute to true
Default abstract attribute to true for abstract classes
and false for concrete classes
FELIX-429 Generate bind/unbind methods on the class which defines
reference, even if the component is abstract
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@601539 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
index c453108..3479605 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
@@ -239,7 +239,7 @@
final OCD ocd = this.doComponent(componentTag, component, metaData);
- boolean inherited = this.getBoolean(componentTag, Constants.COMPONENT_INHERIT, false);
+ boolean inherited = this.getBoolean(componentTag, Constants.COMPONENT_INHERIT, true);
this.doServices(description.getTagsByName(Constants.SERVICE, inherited), component, description);
// collect properties and references from class tags and fields
@@ -349,7 +349,12 @@
// check if this is an abstract definition
final String abstractType = tag.getNamedParameter(Constants.COMPONENT_ABSTRACT);
- component.setAbstract((abstractType == null ? false : "yes".equalsIgnoreCase(abstractType) || "true".equalsIgnoreCase(abstractType)));
+ if (abstractType != null) {
+ component.setAbstract("yes".equalsIgnoreCase(abstractType) || "true".equalsIgnoreCase(abstractType));
+ } else {
+ // default true for abstract classes, false otherwise
+ component.setAbstract(tag.getJavaClassDescription().isAbstract());
+ }
// check if this is a definition to ignore
final String ds = tag.getNamedParameter(Constants.COMPONENT_DS);
@@ -633,8 +638,8 @@
}
// if this is a field with a single cardinality,
// we look for the bind/unbind methods
- // and create them if they are not availabe and the component is not abstract
- if ( !component.isAbstract() && this.generateAccessors ) {
+ // and create them if they are not availabe
+ if ( this.generateAccessors ) {
if ( reference.getField() != null && component.getJavaClassDescription() instanceof ModifiableJavaClassDescription ) {
if ( ref.getCardinality().equals("0..1") || ref.getCardinality().equals("1..1") ) {
boolean createBind = false;