org.apache.felix.scrplugin
Class SCRDescriptorMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.felix.scrplugin.SCRDescriptorMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class SCRDescriptorMojo
extends org.apache.maven.plugin.AbstractMojo

The SCRDescriptorMojo generates a service descriptor file based on annotations found in the sources.


Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
SCRDescriptorMojo()
           
 
Method Summary
protected  void addInterfaces(Service service, JavaTag serviceTag, JavaClassDescription description)
          Recursively add interfaces to the service.
protected  Component createComponent(JavaClassDescription description, JavaTag componentTag, MetaData metaData)
          Create a component for the java class description.
protected  OCD doComponent(JavaTag tag, Component component, MetaData metaData)
          Fill the component object with the information from the tag.
protected  void doReference(JavaTag reference, java.lang.String name, Component component, java.lang.String type)
           
protected  void doServices(JavaTag[] services, Component component, JavaClassDescription description)
          Process the service annotations
 void execute()
           
static boolean getBoolean(JavaTag tag, java.lang.String name, boolean defaultValue)
           
protected  JavaField getReferencedField(JavaTag tag, java.lang.String ref)
           
protected  java.lang.String getReferenceName(JavaTag reference, java.lang.String defaultName)
           
protected  void testReference(java.util.Map references, JavaTag reference, java.lang.String defaultName, boolean isInspectedClass)
          Test a newly found reference
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCRDescriptorMojo

public SCRDescriptorMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
See Also:
Mojo.execute()

createComponent

protected Component createComponent(JavaClassDescription description,
                                    JavaTag componentTag,
                                    MetaData metaData)
                             throws org.apache.maven.plugin.MojoExecutionException
Create a component for the java class description.

Parameters:
description -
Returns:
The generated component descriptor or null if any error occurs.
Throws:
org.apache.maven.plugin.MojoExecutionException

doComponent

protected OCD doComponent(JavaTag tag,
                          Component component,
                          MetaData metaData)
Fill the component object with the information from the tag.

Parameters:
tag -
component -

doServices

protected void doServices(JavaTag[] services,
                          Component component,
                          JavaClassDescription description)
                   throws org.apache.maven.plugin.MojoExecutionException
Process the service annotations

Parameters:
services -
component -
description -
Throws:
org.apache.maven.plugin.MojoExecutionException

addInterfaces

protected void addInterfaces(Service service,
                             JavaTag serviceTag,
                             JavaClassDescription description)
                      throws org.apache.maven.plugin.MojoExecutionException
Recursively add interfaces to the service.

Throws:
org.apache.maven.plugin.MojoExecutionException

testReference

protected void testReference(java.util.Map references,
                             JavaTag reference,
                             java.lang.String defaultName,
                             boolean isInspectedClass)
                      throws org.apache.maven.plugin.MojoExecutionException
Test a newly found reference

Parameters:
references -
reference -
defaultName -
isInspectedClass -
Throws:
org.apache.maven.plugin.MojoExecutionException

getReferenceName

protected java.lang.String getReferenceName(JavaTag reference,
                                            java.lang.String defaultName)
                                     throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getReferencedField

protected JavaField getReferencedField(JavaTag tag,
                                       java.lang.String ref)
                                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

doReference

protected void doReference(JavaTag reference,
                           java.lang.String name,
                           Component component,
                           java.lang.String type)
                    throws org.apache.maven.plugin.MojoExecutionException
Parameters:
reference -
defaultName -
component -
Throws:
org.apache.maven.plugin.MojoExecutionException

getBoolean

public static boolean getBoolean(JavaTag tag,
                                 java.lang.String name,
                                 boolean defaultValue)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.