Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 27013 invoked from network); 3 Aug 2007 12:08:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Aug 2007 12:08:25 -0000 Received: (qmail 47415 invoked by uid 500); 3 Aug 2007 12:08:25 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 47357 invoked by uid 500); 3 Aug 2007 12:08:25 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 47348 invoked by uid 99); 3 Aug 2007 12:08:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2007 05:08:25 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Aug 2007 12:07:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 564511A981D; Fri, 3 Aug 2007 05:07:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r562420 [2/3] - in /felix/sandbox/cziegeler/maven-scr-plugin: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/sandbox/ src/main/java/org/apache/fel... Date: Fri, 03 Aug 2007 12:07:48 -0000 To: commits@felix.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070803120753.564511A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaClassDescriptorManager.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaClassDescriptorManager.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaClassDescriptorManager.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaClassDescriptorManager.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,419 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; + +import org.apache.felix.sandbox.scrplugin.Property; +import org.apache.felix.sandbox.scrplugin.Reference; +import org.apache.felix.sandbox.scrplugin.SCRDescriptor; +import org.apache.felix.sandbox.scrplugin.Service; +import org.apache.felix.sandbox.scrplugin.tags.cl.ClassLoaderJavaClassDescription; +import org.apache.felix.sandbox.scrplugin.tags.qdox.QDoxJavaClassDescription; +import org.apache.felix.sandbox.scrplugin.xml.Component; +import org.apache.felix.sandbox.scrplugin.xml.Components; +import org.apache.felix.sandbox.scrplugin.xml.Implementation; +import org.apache.felix.sandbox.scrplugin.xml.Interface; +import org.apache.felix.sandbox.scrplugin.xml.XMLHandler; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.ArtifactUtils; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.util.IOUtil; + +import com.thoughtworks.qdox.JavaDocBuilder; +import com.thoughtworks.qdox.model.JavaSource; + +/** + * JavaClassDescriptorManager.java... + * + */ +public class JavaClassDescriptorManager { + + public static final String ABSTRACT_DESCRIPTOR_FILENAME = "scrinfo.xml"; + + public static final String ABSTRACT_DESCRIPTOR_RELATIVE_PATH = "OSGI-INF" + File.separator + "scr-plugin" + File.separator + ABSTRACT_DESCRIPTOR_FILENAME; + + public static final String ABSTRACT_DESCRIPTOR_ARCHIV_PATH = "OSGI-INF/scr-plugin/" + ABSTRACT_DESCRIPTOR_FILENAME; + + protected static final String SERVICE_COMPONENT = "Service-Component"; + + /** The sources read by qdox. */ + protected final JavaSource[] sources; + + /** The maven log. */ + protected final Log log; + + /** The classloader used to compile the classes. */ + protected final ClassLoader classloader; + + /** The xml handler to read and write the service descriptors. */ + protected final XMLHandler xmlHandler = new XMLHandler(); + + /** A cache containing the java class descriptions hashed by classname. */ + protected final Map javaClassDescriptions = new HashMap(); + + /** The component definitions from other bundles hashed by classname. */ + protected final Map componentDescriptions = new HashMap(); + + /** + * Construct a new manager. + * @param log + * @param project + * @throws MojoFailureException + * @throws MojoExecutionException + */ + public JavaClassDescriptorManager(final Log log, + final MavenProject project) + throws MojoFailureException, MojoExecutionException { + this.log = log; + this.classloader = this.getCompileClassLoader(project); + + // get all the class sources through qdox + this.log.debug("Setting up QDox"); + JavaDocBuilder builder = new JavaDocBuilder(); + builder.getClassLibrary().addClassLoader(this.classloader); + final Iterator i = project.getCompileSourceRoots().iterator(); + while ( i.hasNext() ) { + final String tree = (String)i.next(); + this.log.debug("Adding source tree " + tree); + builder.addSourceTree(new File(tree)); + } + this.sources = builder.getSources(); + + // and now scan artifacts + final List components = new ArrayList(); + final Map resolved = project.getArtifactMap(); + final Set artifacts = project.getDependencyArtifacts(); + final Iterator it = artifacts.iterator(); + while ( it.hasNext() ) { + final Artifact declared = (Artifact) it.next(); + this.log.debug("Checking artifact " + declared); + if (Artifact.SCOPE_COMPILE.equals(declared.getScope()) + || Artifact.SCOPE_RUNTIME.equals(declared.getScope())) { + this.log.debug("Resolving artifact " + declared); + final Artifact artifact = (Artifact) resolved.get(ArtifactUtils.versionlessKey(declared)); + if (artifact != null) { + this.log.debug("Trying to get manifest from artifact " + artifact); + try { + final Manifest manifest = this.getManifest(artifact); + if ( manifest != null ) { + // read Service-Component entry + if ( manifest.getMainAttributes().getValue(JavaClassDescriptorManager.SERVICE_COMPONENT) != null ) { + final String serviceComponent = manifest.getMainAttributes().getValue(JavaClassDescriptorManager.SERVICE_COMPONENT); + this.log.debug("Found Service-Component: " + serviceComponent + " in artifact " + artifact); + final StringTokenizer st = new StringTokenizer(serviceComponent, ","); + while ( st.hasMoreTokens() ) { + final String entry = st.nextToken().trim(); + if ( entry.length() > 0 ) { + components.addAll(this.readServiceComponentDescriptor(artifact, entry).getComponents()); + } + } + } else { + this.log.debug("Artifact has no service component entry in manifest " + artifact); + } + } else { + this.log.debug("Unable to get manifest from artifact " + artifact); + } + } catch (IOException ioe) { + throw new MojoExecutionException("Unable to get manifest from artifact " + artifact, ioe); + } + this.log.debug("Trying to get scrinfo from artifact " + artifact); + try { + final File scrInfoFile = this.getFile(artifact, ABSTRACT_DESCRIPTOR_ARCHIV_PATH); + if ( scrInfoFile != null ) { + components.addAll(this.parseServiceComponentDescriptor(artifact, scrInfoFile).getComponents()); + } else { + this.log.debug("Artifact has no scrinfo file (it's optional): " + artifact); + } + } catch (IOException ioe) { + throw new MojoExecutionException("Unable to get scrinfo from artifact " + artifact, ioe); + } + } else { + this.log.debug("Unable to resolve artifact " + declared); + } + } else { + this.log.debug("Artifact " + declared + " has not scope compile or runtime, but " + declared.getScope()); + } + } + // now create map with component descriptions + final Iterator cI = components.iterator(); + while ( cI.hasNext() ) { + final Component component = (Component) cI.next(); + this.componentDescriptions.put(component.getImplementation().getClassame(), component); + } + } + + /** + * Return the log. + */ + public Log getLog() { + return this.log; + } + + /** + * Return the class laoder. + */ + public ClassLoader getClassLoader() { + return this.classloader; + } + + /** + * Create the abstract descriptors file or delete it of no abstract descriptors are available. + * @param abstractDescriptors + */ + public void writeAbstractDescriptorsFile(List abstractDescriptors, File outputDirectory) + throws MojoExecutionException { + try { + // if we have abstract descriptors, write them first + final File adFile = new File(outputDirectory, ABSTRACT_DESCRIPTOR_RELATIVE_PATH); + if ( !abstractDescriptors.isEmpty() ) { + this.getLog().info("Writing abstract service descriptor " + adFile + " with " + abstractDescriptors.size() + " entries."); + final Components container = new Components(); + final Iterator i = abstractDescriptors.iterator(); + while ( i.hasNext() ) { + final SCRDescriptor current = (SCRDescriptor) i.next(); + // component + final Component component = new Component(); + // enabled and immediate do not make sense for abstract components + //component.setEnabled(Boolean.valueOf(current.isEnabled())); + //component.setImmediate(Boolean.valueOf(current.isImmediate())); + component.setName(current.getName()); + // do we support abstract factories or should we throw an exception? (TODO) + component.setFactory(current.getFactory()); + + // implementation + final Implementation impl = new Implementation(); + impl.setClassname(current.getImplClass()); + component.setImplementation(impl); + + // properties + final Iterator pI = current.getProperties(); + while ( pI.hasNext() ) { + final Property p = (Property)pI.next(); + final org.apache.felix.sandbox.scrplugin.xml.Property prop = new org.apache.felix.sandbox.scrplugin.xml.Property(); + prop.setName(p.getName()); + if ( !"String".equals(p.getType())) { + prop.setType(p.getType()); + } + if (p.getValue() instanceof List) { + final StringBuffer buffer = new StringBuffer(); + List values = (List) p.getValue(); + for (Iterator vi = values.iterator(); vi.hasNext();) { + buffer.append(vi.next()).append('\n'); + } + } else if (p.getValue() != null) { + prop.setValue(p.getValue().toString()); + } + component.getProperties().add(prop); + } + + // services + final Iterator sI = current.getServices(); + if (sI.hasNext()) { + final org.apache.felix.sandbox.scrplugin.xml.Service srvc = new org.apache.felix.sandbox.scrplugin.xml.Service(); + component.setService(srvc); + if ( current.isServiceFactory() ) { + srvc.setServicefactory("true"); + } + while (sI.hasNext()) { + final Service s = (Service)sI.next(); + final Interface interf = new Interface(); + interf.setInterfacename(s.getInterfaceName()); + srvc.getInterfaces().add(interf); + } + } + + // references + final Iterator rI = current.getReferences(); + while ( rI.hasNext() ) { + final Reference r = (Reference)rI.next(); + final org.apache.felix.sandbox.scrplugin.xml.Reference ref = new org.apache.felix.sandbox.scrplugin.xml.Reference(); + ref.setName(r.getName()); + ref.setInterfacename(r.getInterfaceName()); + ref.setTarget(r.getTarget()); + ref.setCardinality(r.getCardinality()); + ref.setPolicy(r.getPolicy()); + ref.setBind(r.getBind()); + ref.setUnbind(r.getUnbind()); + + component.getReferences().add(ref); + } + + container.getComponents().add(component); + } + adFile.getParentFile().mkdirs(); + this.xmlHandler.write(adFile, container); + } else { + // remove file + if ( adFile.exists() ) { + this.getLog().debug("Removing obsolete abstract service descriptor " + adFile); + adFile.delete(); + } + } + } catch (IOException ioe) { + throw new MojoExecutionException("Failed to write scr-plugin scrinfo.xml", ioe); + } + } + + /** + * Read the service component description. + * @param artifact + * @param entry + * @throws IOException + * @throws MojoExecutionException + */ + protected Components readServiceComponentDescriptor(Artifact artifact, String entry) + throws IOException, MojoExecutionException { + this.log.debug("Reading " + entry + " from " + artifact); + final File xml = this.getFile(artifact, entry); + if ( xml == null ) { + throw new MojoExecutionException("Artifact " + artifact + " does not contain declared service component descriptor " + entry); + } + return this.parseServiceComponentDescriptor(artifact, xml); + } + + protected Components parseServiceComponentDescriptor(Artifact artifact, File file) + throws IOException, MojoExecutionException { + this.log.debug("Parsing " + file); + final Components list = this.xmlHandler.read(file); + return list; + } + + protected ClassLoader getCompileClassLoader(MavenProject project) + throws MojoFailureException { + List artifacts = project.getCompileArtifacts(); + URL[] path = new URL[artifacts.size()]; + int i = 0; + for (Iterator ai=artifacts.iterator(); ai.hasNext(); ) { + Artifact a = (Artifact) ai.next(); + try { + path[i++] = a.getFile().toURI().toURL(); + } catch (IOException ioe) { + throw new MojoFailureException("Unable to get compile class loader."); + } + } + return new URLClassLoader(path); + } + + protected Manifest getManifest(Artifact artifact) throws IOException { + JarFile file = null; + try { + file = new JarFile(artifact.getFile()); + return file.getManifest(); + } finally { + if (file != null) { + try { + file.close(); + } catch (IOException ignore) { + } + } + } + } + + protected File getFile(Artifact artifact, String path) throws IOException { + final int pos = path.lastIndexOf('.'); + final String suffix = path.substring(pos + 1); + JarFile file = null; + File tmpFile = null; + try { + file = new JarFile(artifact.getFile()); + final JarEntry entry = file.getJarEntry(path); + if ( entry != null ) { + tmpFile = File.createTempFile("scrjcdm" + artifact.getArtifactId(), suffix); + tmpFile.deleteOnExit(); + final FileOutputStream fos = new FileOutputStream(tmpFile); + IOUtil.copy(file.getInputStream(entry), fos); + IOUtil.close(fos); + return tmpFile; + } + return null; + } finally { + if (file != null) { + try { + file.close(); + } catch (IOException ignore) { + } + } + } + } + + /** + * Return all source descriptions of this project. + * @return + */ + public JavaClassDescription[] getSourceDescriptions() { + final JavaClassDescription[] descs = new JavaClassDescription[this.sources.length]; + for(int i=0; iJavaField.java... + * + */ +public interface JavaField { + + String getName(); + + String getType(); + + JavaTag getTagByName(String name); + + String getInitializationExpression(); +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaField.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaField.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags; + +/** + * JavaMethod.java... + * + */ +public interface JavaMethod { + + boolean isPublic(); + + boolean isProtected(); + + String getName(); + + JavaParameter[] getParameters(); + + boolean isConstructor(); +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaMethod.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags; + +/** + * JavaParameter.java... + * + */ +public interface JavaParameter { + + String getType(); +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaParameter.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags; + +import java.util.Map; + +/** + * JavaTag.java... + * + */ +public interface JavaTag { + + String getName(); + + String[] getParameters(); + + String getNamedParameter(String arg0); + + String getSourceLocation(); + + JavaClassDescription getJavaClassDescription(); + + JavaField getField(); + + Map getNamedParameterMap(); +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/JavaTag.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,198 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags.cl; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.felix.sandbox.scrplugin.SCRDescriptor; +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription; +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescriptorManager; +import org.apache.felix.sandbox.scrplugin.tags.JavaField; +import org.apache.felix.sandbox.scrplugin.tags.JavaMethod; +import org.apache.felix.sandbox.scrplugin.tags.JavaTag; +import org.apache.felix.sandbox.scrplugin.xml.Component; +import org.apache.felix.sandbox.scrplugin.xml.Reference; +import org.apache.maven.plugin.MojoExecutionException; + +/** + * ClassLoaderJavaClassDescription.java... + * + */ +public class ClassLoaderJavaClassDescription implements JavaClassDescription { + + protected static final JavaTag[] EMPTY_TAGS = new JavaTag[0]; + + protected final Class clazz; + + protected final JavaClassDescriptorManager manager; + + protected final Component component; + + public ClassLoaderJavaClassDescription(Class c, Component comp, JavaClassDescriptorManager m) { + this.clazz = c; + this.manager = m; + this.component = comp; + } + + public JavaField[] getFields() { + // TODO Auto-generated method stub + return null; + } + + public JavaClassDescription[] getImplementedInterfaces() { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getMethodBySignature(java.lang.String, java.lang.String[]) + */ + public JavaMethod getMethodBySignature(String name, String[] parameters) { + Class[] classParameters = null; + if ( parameters != null ) { + classParameters = new Class[parameters.length]; + for(int i=0; i 0 ) { + javaTags = new JavaTag[this.component.getReferences().size()]; + for(int i=0; i 0 ) { + final List list = new ArrayList(Arrays.asList(javaTags)); + list.addAll(Arrays.asList(superTags)); + javaTags = (JavaTag[]) list.toArray(new JavaTag[list.size()]); + } + } + return javaTags; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#isA(java.lang.String) + */ + public boolean isA(String type) { + if ( this.clazz.getName().equals(type) ) { + return true; + } + return this.testClass(this.clazz, type); + } + + protected boolean testClass(Class c, String type) { + final Class[] interfaces = c.getInterfaces(); + for(int i=0; iClassLoaderJavaMethod.java... + * + */ +public class ClassLoaderJavaMethod implements JavaMethod { + + protected final Method method; + + protected boolean isConstructor = false; + + public ClassLoaderJavaMethod(Method m) { + this.method = m; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaMethod#getName() + */ + public String getName() { + return this.method.getName(); + } + + public JavaParameter[] getParameters() { + final JavaParameter[] params = new JavaParameter[this.method.getParameterTypes().length]; + for(int i=0; iClassLoaderJavaParameter.java... + * + */ +public class ClassLoaderJavaParameter implements JavaParameter { + + protected final String type; + + public ClassLoaderJavaParameter(String t) { + this.type = t; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaParameter#getType() + */ + public String getType() { + return this.type; + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaParameter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaParameter.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags.cl; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.felix.sandbox.scrplugin.SCRDescriptor; +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription; +import org.apache.felix.sandbox.scrplugin.tags.JavaField; +import org.apache.felix.sandbox.scrplugin.tags.JavaTag; +import org.apache.felix.sandbox.scrplugin.xml.Reference; + +/** + * ClassLoaderJavaTag.java... + * + */ +public class ClassLoaderJavaTag implements JavaTag { + + protected final JavaClassDescription description; + protected final Reference reference; + + public ClassLoaderJavaTag(JavaClassDescription desc, Reference reference) { + this.reference = reference; + this.description = desc; + } + + public JavaField getField() { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getJavaClassDescription() + */ + public JavaClassDescription getJavaClassDescription() { + return this.description; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getName() + */ + public String getName() { + if ( this.reference != null ) { + return SCRDescriptor.REFERENCE; + } + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getNamedParameter(java.lang.String) + */ + public String getNamedParameter(String name) { + final Map map = this.getNamedParameterMap(); + if ( map != null ) { + return (String)map.get(name); + } + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getNamedParameterMap() + */ + public Map getNamedParameterMap() { + if ( this.reference != null ) { + final Map map = new HashMap(); + map.put(SCRDescriptor.REFERENCE_BIND, this.reference.getBind()); + map.put(SCRDescriptor.REFERENCE_CARDINALITY, this.reference.getCardinality()); + map.put(SCRDescriptor.REFERENCE_INTERFACE, this.reference.getInterfacename()); + map.put(SCRDescriptor.REFERENCE_NAME, this.reference.getName()); + map.put(SCRDescriptor.REFERENCE_POLICY, this.reference.getPolicy()); + map.put(SCRDescriptor.REFERENCE_TARGET, this.reference.getTarget()); + map.put(SCRDescriptor.REFERENCE_UNDBIND, this.reference.getUnbind()); + return map; + } + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getParameters() + */ + public String[] getParameters() { + final Map map = this.getNamedParameterMap(); + if ( map != null ) { + return (String[])map.keySet().toArray(new String[5]); + } + return new String[0]; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getSourceLocation() + */ + public String getSourceLocation() { + return "Compiled class: " + this.description.getName(); + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/cl/ClassLoaderJavaTag.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaClassDescription.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaClassDescription.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaClassDescription.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaClassDescription.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,219 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags.qdox; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription; +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescriptorManager; +import org.apache.felix.sandbox.scrplugin.tags.JavaField; +import org.apache.felix.sandbox.scrplugin.tags.JavaMethod; +import org.apache.felix.sandbox.scrplugin.tags.JavaTag; +import org.apache.maven.plugin.MojoExecutionException; + +import com.thoughtworks.qdox.model.DocletTag; +import com.thoughtworks.qdox.model.JavaClass; +import com.thoughtworks.qdox.model.JavaSource; +import com.thoughtworks.qdox.model.Type; + +/** + * QDoxJavaClassDescription.java... + * + */ +public class QDoxJavaClassDescription implements JavaClassDescription { + + protected final JavaClass javaClass; + + protected final JavaClassDescriptorManager manager; + + public QDoxJavaClassDescription(JavaSource source, JavaClassDescriptorManager m) { + this.javaClass = source.getClasses()[0]; + this.manager = m; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getSuperClass() + */ + public JavaClassDescription getSuperClass() throws MojoExecutionException { + final JavaClass parent = this.javaClass.getSuperJavaClass(); + if ( parent != null ) { + return this.manager.getJavaClassDescription(parent.getFullyQualifiedName()); + } + return null; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getTagForName(java.lang.String) + */ + public JavaTag getTagByName(String name) { + final DocletTag tag = this.javaClass.getTagByName(name); + if ( tag == null ) { + return null; + } + return new QDoxJavaTag(tag, this); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getName() + */ + public String getName() { + return this.javaClass.getFullyQualifiedName(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getTagsByName(java.lang.String, boolean) + */ + public JavaTag[] getTagsByName(String name, boolean inherited) + throws MojoExecutionException { + final DocletTag[] tags = this.javaClass.getTagsByName(name, false); + JavaTag[] javaTags; + if ( tags == null || tags.length == 0 ) { + javaTags = new JavaTag[0]; + } else { + javaTags = new JavaTag[tags.length]; + for(int i=0; i 0 ) { + final List list = new ArrayList(Arrays.asList(javaTags)); + list.addAll(Arrays.asList(superTags)); + javaTags = (JavaTag[]) list.toArray(new JavaTag[list.size()]); + } + } + return javaTags; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription#getFields() + */ + public JavaField[] getFields() { + final com.thoughtworks.qdox.model.JavaField fields[] = this.javaClass.getFields(); + if ( fields == null || fields.length == 0 ) { + return new JavaField[0]; + } + final JavaField[] f = new JavaField[fields.length]; + for(int i=0; iQDoxJavaField.java... + * + */ +public class QDoxJavaField implements JavaField { + + protected final com.thoughtworks.qdox.model.JavaField field; + + protected final JavaClassDescription description; + + public QDoxJavaField(com.thoughtworks.qdox.model.JavaField f, JavaClassDescription d) { + this.field = f; + this.description = d; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaField#getInitializationExpression() + */ + public String getInitializationExpression() { + return this.field.getInitializationExpression(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaField#getName() + */ + public String getName() { + return this.field.getName(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaField#getTagByName(java.lang.String) + */ + public JavaTag getTagByName(String name) { + final DocletTag tag = this.field.getTagByName(name); + if ( tag == null ) { + return null; + } + return new QDoxJavaTag(tag, this.description, this); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaField#getType() + */ + public String getType() { + return this.field.getType().getValue(); + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaField.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaField.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaMethod.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaMethod.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaMethod.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaMethod.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags.qdox; + +import org.apache.felix.sandbox.scrplugin.tags.JavaMethod; +import org.apache.felix.sandbox.scrplugin.tags.JavaParameter; + +/** + * QDoxJavaMethod.java... + * + */ +public class QDoxJavaMethod implements JavaMethod { + + protected final com.thoughtworks.qdox.model.JavaMethod method; + + public QDoxJavaMethod(com.thoughtworks.qdox.model.JavaMethod m) { + this.method = m; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaMethod#getName() + */ + public String getName() { + return this.method.getName(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaMethod#getParameters() + */ + public JavaParameter[] getParameters() { + final com.thoughtworks.qdox.model.JavaParameter[] params = this.method.getParameters(); + if ( params == null || params.length == 0) { + return new JavaParameter[0]; + } + final JavaParameter[] p = new JavaParameter[params.length]; + for(int i=0; iQDoxJavaParameter.java... + * + */ +public class QDoxJavaParameter implements JavaParameter { + + protected final com.thoughtworks.qdox.model.JavaParameter parameter; + + public QDoxJavaParameter(com.thoughtworks.qdox.model.JavaParameter p) { + this.parameter = p; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaParameter#getType() + */ + public String getType() { + return this.parameter.getType().getValue(); + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaParameter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaParameter.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.tags.qdox; + +import java.util.Map; + +import org.apache.felix.sandbox.scrplugin.tags.JavaClassDescription; +import org.apache.felix.sandbox.scrplugin.tags.JavaField; +import org.apache.felix.sandbox.scrplugin.tags.JavaTag; + +import com.thoughtworks.qdox.model.DocletTag; + +/** + * QDoxJavaTag.java... + * + */ +public class QDoxJavaTag implements JavaTag { + + protected final DocletTag docletTag; + + protected final JavaClassDescription description; + + protected final JavaField field; + + public QDoxJavaTag(DocletTag t, JavaClassDescription desc) { + this(t, desc, null); + } + + public QDoxJavaTag(DocletTag t, JavaClassDescription desc, JavaField field) { + this.docletTag = t; + this.description = desc; + this.field = field; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getName() + */ + public String getName() { + return this.docletTag.getName(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getNamedParameter(java.lang.String) + */ + public String getNamedParameter(String arg0) { + return this.docletTag.getNamedParameter(arg0); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getParameters() + */ + public String[] getParameters() { + return this.docletTag.getParameters(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getSourceLocation() + */ + public String getSourceLocation() { + return this.docletTag.getContext().getSource().getURL() + ", line " + this.docletTag.getLineNumber(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getJavaClassDescription() + */ + public JavaClassDescription getJavaClassDescription() { + return this.description; + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getNamedParameterMap() + */ + public Map getNamedParameterMap() { + return this.docletTag.getNamedParameterMap(); + } + + /** + * @see org.apache.felix.sandbox.scrplugin.tags.JavaTag#getField() + */ + public JavaField getField() { + return this.field; + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/tags/qdox/QDoxJavaTag.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +import java.util.ArrayList; +import java.util.List; + +/** + * Component.java... + * + */ +public class Component { + + protected String name; + + protected Boolean enabled; + + protected Boolean immediate; + + protected String factory; + protected Implementation implementation; + + protected List properties = new ArrayList(); + + protected Service service; + + protected List references = new ArrayList(); + + public List getProperties() { + return this.properties; + } + + public void setProperties(List properties) { + this.properties = properties; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFactory() { + return this.factory; + } + + public void setFactory(String factory) { + this.factory = factory; + } + + public Boolean isEnabled() { + return this.enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Boolean isImmediate() { + return this.immediate; + } + + public void setImmediate(Boolean immediate) { + this.immediate = immediate; + } + + public Implementation getImplementation() { + return this.implementation; + } + + public void setImplementation(Implementation implementation) { + this.implementation = implementation; + } + + public Service getService() { + return this.service; + } + + public void setService(Service service) { + this.service = service; + } + + public List getReferences() { + return this.references; + } + + public void setReferences(List references) { + this.references = references; + } + +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Component.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +import java.util.ArrayList; +import java.util.List; + +/** + * Components.java... + * + */ +public class Components { + + protected List components = new ArrayList(); + + public List getComponents() { + return this.components; + } + + public void setComponents(List components) { + this.components = components; + } + +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Components.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +/** + * Implementation.java... + * + */ +public class Implementation { + + protected String classname; + + public String getClassame() { + return this.classname; + } + + public void setClassname(String name) { + this.classname = name; + } + + +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Implementation.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +/** + * Interface.java... + * + */ +public class Interface { + + protected String interfacename; + + public String getInterfaceame() { + return this.interfacename; + } + + public void setInterfacename(String name) { + this.interfacename = name; + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Interface.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +/** + * Property.java... + * + */ +public class Property { + + protected String name; + protected String value; + protected String type; + protected String text; + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + public String getText() { + return this.text; + } + + public void setText(String text) { + this.text = text; + } +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Property.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java URL: http://svn.apache.org/viewvc/felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java?view=auto&rev=562420 ============================================================================== --- felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java (added) +++ felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java Fri Aug 3 05:07:45 2007 @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.sandbox.scrplugin.xml; + +/** + * Reference.java... + * + */ +public class Reference { + + protected String name; + protected String interfacename; + protected String target; + protected String cardinality; + protected String policy; + protected String bind; + protected String unbind; + + public String getName() { + return this.name; + } + public void setName(String name) { + this.name = name; + } + public String getInterfacename() { + return this.interfacename; + } + public void setInterfacename(String interfacename) { + this.interfacename = interfacename; + } + public String getTarget() { + return this.target; + } + public void setTarget(String target) { + this.target = target; + } + public String getCardinality() { + return this.cardinality; + } + public void setCardinality(String cardinality) { + this.cardinality = cardinality; + } + public String getPolicy() { + return this.policy; + } + public void setPolicy(String policy) { + this.policy = policy; + } + public String getBind() { + return this.bind; + } + public void setBind(String bind) { + this.bind = bind; + } + public String getUnbind() { + return this.unbind; + } + public void setUnbind(String unbind) { + this.unbind = unbind; + } + + +} Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: felix/sandbox/cziegeler/maven-scr-plugin/src/main/java/org/apache/felix/sandbox/scrplugin/xml/Reference.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url