Author: cziegeler
Date: Wed Jul 14 07:15:50 2010
New Revision: 963960
URL: http://svn.apache.org/viewvc?rev=963960&view=rev
Log:
FELIX-2475 : Metatype information should not be generated for abstract
components
Modified:
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
Modified:
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
URL:
http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java?rev=963960&r1=963959&r2=963960&view=diff
==============================================================================
---
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
(original)
+++
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorGenerator.java
Wed Jul 14 07:15:50 2010
@@ -20,33 +20,12 @@ package org.apache.felix.scrplugin;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.scrplugin.helper.IssueLog;
-import org.apache.felix.scrplugin.helper.PropertyHandler;
-import org.apache.felix.scrplugin.helper.StringUtils;
-import org.apache.felix.scrplugin.om.Component;
-import org.apache.felix.scrplugin.om.Components;
-import org.apache.felix.scrplugin.om.Implementation;
-import org.apache.felix.scrplugin.om.Interface;
-import org.apache.felix.scrplugin.om.Property;
-import org.apache.felix.scrplugin.om.Reference;
-import org.apache.felix.scrplugin.om.Service;
-import org.apache.felix.scrplugin.om.metatype.Designate;
-import org.apache.felix.scrplugin.om.metatype.MTObject;
-import org.apache.felix.scrplugin.om.metatype.MetaData;
-import org.apache.felix.scrplugin.om.metatype.OCD;
-import org.apache.felix.scrplugin.tags.JavaClassDescription;
-import
org.apache.felix.scrplugin.tags.JavaClassDescriptionInheritanceComparator;
-import org.apache.felix.scrplugin.tags.JavaField;
-import org.apache.felix.scrplugin.tags.JavaTag;
-import org.apache.felix.scrplugin.tags.ModifiableJavaClassDescription;
+import java.util.*;
+
+import org.apache.felix.scrplugin.helper.*;
+import org.apache.felix.scrplugin.om.*;
+import org.apache.felix.scrplugin.om.metatype.*;
+import org.apache.felix.scrplugin.tags.*;
import org.apache.felix.scrplugin.tags.qdox.QDoxJavaClassDescription;
import org.apache.felix.scrplugin.xml.ComponentDescriptorIO;
import org.apache.felix.scrplugin.xml.MetaTypeIO;
@@ -637,7 +616,7 @@ public class SCRDescriptorGenerator
final String metaType = tag.getNamedParameter(
Constants.COMPONENT_METATYPE );
final boolean hasMetaType = metaType == null ||
"yes".equalsIgnoreCase( metaType )
|| "true".equalsIgnoreCase( metaType );
- if ( hasMetaType )
+ if ( !component.isAbstract() && hasMetaType )
{
// ocd
final OCD ocd = new OCD();
Modified:
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
URL:
http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java?rev=963960&r1=963959&r2=963960&view=diff
==============================================================================
---
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
(original)
+++
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/om/Component.java
Wed Jul 14 07:15:50 2010
@@ -24,9 +24,7 @@ import java.util.List;
import org.apache.felix.scrplugin.Constants;
import org.apache.felix.scrplugin.SCRDescriptorException;
import org.apache.felix.scrplugin.helper.IssueLog;
-import org.apache.felix.scrplugin.tags.JavaClassDescription;
-import org.apache.felix.scrplugin.tags.JavaMethod;
-import org.apache.felix.scrplugin.tags.JavaTag;
+import org.apache.felix.scrplugin.tags.*;
/**
* <code>Component</code>
@@ -487,4 +485,24 @@ public class Component extends AbstractO
public void setConfigurationPolicy(final String value) {
this.configurationPolicy = value;
}
-}
+
+ @Override
+ public String toString() {
+ return "Component " + this.name + " (" +
+ "enabled=" + (enabled==null?"<notset>":enabled) +
+ ", immediate=" + (immediate == null?"<notset>":immediate) +
+ ", abstract=" + isAbstract +
+ ", isDS=" + isDs +
+ (factory != null ? ", factory="+factory:"")+
+ (configurationPolicy != null ? ", configurationPolicy=" +
configurationPolicy : "") +
+ (activate != null ? ", activate=" + activate : "") +
+ (deactivate != null ? ", deactivate=" + deactivate : "") +
+ (modified != null ? ", modified=" + modified : "") +
+ ", specVersion=" + specVersion +
+ ", implementation=" + implementation +
+ ", service=" + service +
+ ", properties=" + properties +
+ ", references=" + references +
+ ")";
+ }
+}
\ No newline at end of file