org.apache.felix.scrplugin
Class Options

java.lang.Object
  extended by org.apache.felix.scrplugin.Options

public class Options
extends java.lang.Object

Options for the SCRDescriptorGenerator


Constructor Summary
Options()
           
 
Method Summary
 java.io.File getComponentDescriptorDirectory()
          Convenience method to get the component descriptor directory.
 java.io.File getMetaTypeDirectory()
          Convenience method to get the meta type directory.
 java.lang.String getMetaTypeName()
           
 java.io.File getOutputDirectory()
           
 java.util.Map<java.lang.String,java.lang.String> getProperties()
           
 java.lang.String getSCRName()
           
 SpecVersion getSpecVersion()
           
 boolean isGenerateAccessors()
           
 boolean isGenerateSeparateDescriptors()
          Should separate descriptor files be generated?
 boolean isStrictMode()
           
 void setGenerateAccessors(boolean generateAccessors)
          Defines whether bind and unbind methods are automatically created by the SCR descriptor generator.
 void setGenerateSeparateDescriptors(boolean generateSeparateDescriptors)
          Set whether separate descriptor files should be generated.
 void setMetaTypeName(java.lang.String metaTypeName)
          Sets the name of the file taking the Metatype Service descriptors.
 void setOutputDirectory(java.io.File outputDirectory)
          Sets the directory where the descriptor files will be created.
 void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
          Sets global properties to be set for each descriptor.
 void setSCRName(java.lang.String finalName)
          Sets the name of the SCR declaration descriptor file.
 void setSpecVersion(SpecVersion specVersion)
          Sets the Declarative Services specification version number to be forced on the declarations.
 void setStrictMode(boolean strictMode)
          Defines whether warnings should be considered as errors and thus cause the generation process to fail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Options

public Options()
Method Detail

isGenerateAccessors

public boolean isGenerateAccessors()
Returns:
Whether accessor methods should be generated.
See Also:
setGenerateAccessors(boolean)

setGenerateAccessors

public void setGenerateAccessors(boolean generateAccessors)
Defines whether bind and unbind methods are automatically created by the SCR descriptor generator.

The generator uses the ASM library to create the method byte codes directly inside the class files. If bind and unbind methods are not to be created, the generator fails if such methods are missing.

The default value of this property is true.


isStrictMode

public boolean isStrictMode()
Returns:
Whether strict mode should be used or not.
See Also:
setStrictMode(boolean)

setStrictMode

public void setStrictMode(boolean strictMode)
Defines whether warnings should be considered as errors and thus cause the generation process to fail.

The default value of this property is false.


getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Sets global properties to be set for each descriptor. If a descriptor provides properties of the same name, the descriptor properties are preferred over the properties provided here.

The are no default global properties.


getSpecVersion

public SpecVersion getSpecVersion()
Returns:
Return the requested spec version
See Also:
setSpecVersion(SpecVersion)

setSpecVersion

public void setSpecVersion(SpecVersion specVersion)
Sets the Declarative Services specification version number to be forced on the declarations.

Supported values for this property are null to autodetect the specification version, or one of the enum values from SpecVersion.

The default is to generate the descriptor version according to the capabilities used by the descriptors. If no 1.1 capabilities, such as configuration-policy, are used, version 1.0 is used, otherwise a 1.1 descriptor is generated.


getOutputDirectory

public java.io.File getOutputDirectory()
Returns:
The output directory for the generated files.
See Also:
setOutputDirectory(File)

setOutputDirectory

public void setOutputDirectory(java.io.File outputDirectory)
Sets the directory where the descriptor files will be created.

This field has no default value and this setter must called before passing this object to SCRDescriptorGenerator.setOptions(Options).


getSCRName

public java.lang.String getSCRName()
Returns:
The file name for the SCR file.
See Also:
setSCRName(String)

setSCRName

public void setSCRName(java.lang.String finalName)
Sets the name of the SCR declaration descriptor file. This file will be created in the OSGI-INF directory below the output directory.

This file will be overwritten if already existing. If no descriptors are created the file is actually removed.

The default value of this property is serviceComponents.xml.


getMetaTypeName

public java.lang.String getMetaTypeName()
Returns:
The name for the metatype file
See Also:
setMetaTypeName(String)

setMetaTypeName

public void setMetaTypeName(java.lang.String metaTypeName)
Sets the name of the file taking the Metatype Service descriptors. This file will be created in the OSGI-INF/metatype directory below the output directory .

This file will be overwritten if already existing. If no descriptors are created the file is actually removed.

The default value of this property is metatype.xml.


isGenerateSeparateDescriptors

public boolean isGenerateSeparateDescriptors()
Should separate descriptor files be generated?


setGenerateSeparateDescriptors

public void setGenerateSeparateDescriptors(boolean generateSeparateDescriptors)
Set whether separate descriptor files should be generated.

Parameters:
generateSeparateDescriptors -

getMetaTypeDirectory

public java.io.File getMetaTypeDirectory()
Convenience method to get the meta type directory.


getComponentDescriptorDirectory

public java.io.File getComponentDescriptorDirectory()
Convenience method to get the component descriptor directory.



Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.