blob: d7c9fd06d52ea32a786d9cdbb085fdd6a6fd458f [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>SCR JavaDoc Tags Excerpt: Using JavaDoc Tags to describe the component or service. :: Apache Felix</title>
<link rel="canonical" href="https://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-javadoc-tags.html">
<meta name="generator" content="Antora 2.3.4">
<link rel="stylesheet" href="../../../_/css/site.css">
<link rel="icon" href="../../../_/img/favicon.png" type="image/x-icon">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://felix.apache.org/index.html">
<span>
<img src="../../../_/img/logo.png">
</span>
</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="https://felix.apache.org/index.html">Home</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Subprojects</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="../apache-felix-dependency-manager.html">Dependency Manager</a>
<a class="navbar-item" href="../apache-felix-event-admin.html">Event Admin</a>
<a class="navbar-item" href="../apache-felix-file-install.html">File Install</a>
<a class="navbar-item" href="../apache-felix-framework.html">Framework</a>
<a class="navbar-item" href="../apache-felix-gogo.html">Gogo Shell</a>
<a class="navbar-item" href="../apache-felix-healthchecks.html">Health Checks</a>
<a class="navbar-item" href="../apache-felix-inventory.html">Inventory</a>
<a class="navbar-item" href="../apache-felix-log.html">Log</a>
<a class="navbar-item" href="../apache-felix-logback.html">Logback</a>
<a class="navbar-item" href="../apache-felix-maven-bundle-plugin.html">Maven bundle plugin</a>
<a class="navbar-item" href="../apache-felix-maven-scr-plugin.html">Maven SCR plugin</a>
<a class="navbar-item" href="../apache-felix-metatype-service.html">Metatype Service</a>
<a class="navbar-item" href="../apache-felix-preferences-service.html">Preferences Service</a>
<a class="navbar-item" href="../apache-felix-remote-shell.html">Remote Shell</a>
<a class="navbar-item" href="../apache-felix-script-console-plugin.html">Script console plugin</a>
<a class="navbar-item" href="../apache-felix-shell.html">Lightweight shell</a>
<a class="navbar-item" href="../apache-felix-shell-tui.html">Shell TUI</a>
<a class="navbar-item" href="../apache-felix-web-console.html">Web Console</a>
</div>
</div>
<div class="navbar-item">
<span class="control">
<a class="button is-primary" href="../../downloads.html">Downloads</a>
</span>
</div>
</div>
</div>
</nav>
</header>
<div class="body">
<div class="nav-container" data-component="documentation" data-version="master">
<aside class="nav">
<div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="../../index.html">Documentation</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../documentation.html">Documentation</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../downloads.html">Downloads</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../getting-started.html">Getting Started</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../news.html">News</a>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Community</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/project-info.html">Apache Felix Project Info</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/contributing.html">Contributing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/projects-using-felix.html">Projects Using Felix</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<span class="nav-text">Development</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/coding-standards.html">Coding Standards</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/dependencies-file-template.html">DEPENDENCIES file template</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/provisional-osgi-api-policy.html">Provisional OSGi API Policy</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/release-management-nexus.html">Release Management</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/site-how-to.html">Site How To</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/using-the-osgi-compliance-tests.html">Using the OSGi Compliance Tests</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../faqs.html">FAQS</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../faqs/apache-felix-bundle-plugin-faq.html">Apache Felix Bundle Plugin Frequently Asked Questions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../faqs/apache-felix-scr-plugin-faq.html">Apache Felix SCR Plugin Frequently Asked Questions</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../subprojects.html">Subprojects</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../apache-felix-dependency-manager.html">Apache Felix Dependency Manager</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Guides</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/migrating-from-earlier-versions.html">Apache Felix Dependency Manager - Migrating from earlier versions</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/annotations.html">Dependency Manager - Annotations</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/background.html">Dependency Manager - Background</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/bundles-and-dependencies.html">Dependency Manager - Bundles and Dependencies</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/design-patterns.html">Dependency Manager - Design Patterns</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/development.html">Dependency Manager - Development</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/history.html">Dependency Manager - History</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/javadocs.html">Dependency Manager - JavaDocs</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/migrating-from-other-solutions.html">Dependency Manager - Migrating from other solutions.</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/performance-tuning.html">Dependency Manager - Performance Tuning</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/resources.html">Dependency Manager - Resource adapters</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/whatsnew.html">Dependency Manager - What&#8217;s new in version 4?</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/dm-lambda.html">Dependency Manager Lambda</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/guides/whatsnew-r15.html">What&#8217;s New in R15</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Reference</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-adapter.html">Dependency Manager - Adapter</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-aspect.html">Dependency Manager - Aspect</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-bundle-adapter.html">Dependency Manager - Bundle Adapter</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dependency-bundle.html">Dependency Manager - Bundle Dependency</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/components.html">Dependency Manager - Components</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dependency-configuration.html">Dependency Manager - Configuration Dependency</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dependencies.html">Dependency Manager - Dependencies</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/external-links.html">Dependency Manager - External Links</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-factory-configuration-adapter.html">Dependency Manager - Factory Configuration Adapter Service</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-resource-adapter.html">Dependency Manager - Resource Adapter</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dependency-resource.html">Dependency Manager - Resource Dependency</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dependency-service.html">Dependency Manager - Service Dependency</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/service-scopes.html">Dependency Manager - Service Scopes</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/component-singleton.html">Dependency Manager - Singleton Component</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/thread-model.html">Dependency Manager - Thread Model</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/reference/dm-annotations.html">Dependency Manager Annotations</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Tutorials</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/tutorials/working-with-annotations.html">Dependency Manager - Annotations</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/tutorials/getting-started.html">Dependency Manager - Getting Started</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/tutorials/leveraging-the-shell.html">Dependency Manager - Leveraging the shell</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-dependency-manager/tutorials/sample-code.html">Dependency Manager sample projects</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-event-admin.html">Apache Felix Event Admin</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-file-install.html">Apache Felix File Install</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../apache-felix-framework.html">Apache Felix Framework</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-framework/apache-felix-framework-bundle-cache.html">Apache Felix Framework Bundle Cache</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-framework/apache-felix-framework-configuration-properties.html">Apache Felix Framework Configuration Properties</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-framework/apache-felix-framework-faq.html">Apache Felix Framework Frequently Asked Questions</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-framework/apache-felix-framework-launching-and-embedding.html">Apache Felix Framework Launching and Embedding</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-framework/apache-felix-framework-usage-documentation.html">Apache Felix Framework Usage Documentation</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-framework-security.html">Apache Felix Framework Security</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../apache-felix-gogo.html">Apache Felix Gogo</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-gogo/rfc-147-overview.html">RFC 147 Overview</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-healthchecks.html">Apache Felix Health Checks</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-inventory.html">Apache Felix Inventory Printer</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-log.html">Apache Felix Log</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-logback.html">Apache Felix Logback</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-maven-bundle-plugin-bnd.html">Apache Felix Maven Bundle Plugin (BND)</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-metatype-service.html">Apache Felix Metatype Service</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-osgi-bundle-repository.html">Apache Felix OSGi Bundle Repository (OBR)</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-preferences-service.html">Apache Felix Preferences Service</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-remote-shell.html">Apache Felix Remote Shell</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-shell.html">Apache Felix Shell</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../apache-felix-shell-tui.html">Apache Felix Shell TUI</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../apache-felix-web-console.html">Apache Felix Web Console</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console.html">Extending the Apache Felix Web Console</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-web-console/web-console-restful-api.html">Web Console RESTful API</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../apache-felix-web-console/web-console-security-provider.html">Web Console Security Provider</a>
</li>
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<span class="nav-text">Extensions</span>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console/branding-the-web-console.html">Branding the Web Console</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console/providing-resources.html">Providing Resources</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console/providing-web-console-plugins.html">Providing Web Console Plugins</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console/web-console-logging.html">Web Console Logging</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../apache-felix-web-console/extending-the-apache-felix-web-console/web-console-output-templating.html">Web Console Output Templating</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Maven SCR plugin</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="apache-felix-maven-scr-plugin-use.html">Apache Felix Maven SCR Plugin Use</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="apache-felix-scr-bndtools-use.html">Apache Felix SCR Annotations BndTools Use</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="apache-felix-scr-ant-task-use.html">Apache Felix SCR Ant Task Use</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="extending-scr-annotations.html">Extending SCR Annotations Excerpt: How add new Annotations extending the base Annotations</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="scr-annotations.html">SCR Annotations Excerpt: Using Java 5 Annotations to describe the component or service.</a>
</li>
<li class="nav-item is-current-page" data-depth="3">
<a class="nav-link" href="scr-javadoc-tags.html">SCR JavaDoc Tags Excerpt: Using JavaDoc Tags to describe the component or service.</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../tutorials-examples-and-presentations.html">Tutorials</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-application-demonstration.html">Apache Felix Application Demonstration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial.html">Apache Felix OSGi Tutorial</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-faq.html">OSGi Frequently Asked Questions</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">OSGI Tutorial</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-1.html">Apache Felix Tutorial Example 1 - Service Event Listener Bundle</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-2.html">Apache Felix Tutorial Example 2</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-2b.html">Apache Felix Tutorial Example 2b</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-3.html">Apache Felix Tutorial Example 3</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-4.html">Apache Felix Tutorial Example 4</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-5.html">Apache Felix Tutorial Example 5</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-6.html">Example 6 - Spell Checker Service Bundle</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-7.html">Example 7 - Spell Checker Client Bundle</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-8.html">Example 8 - Spell Checker Service using Service Binder</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../tutorials-examples-and-presentations/apache-felix-osgi-tutorial/apache-felix-tutorial-example-9.html">Example 9 - Spell Checker Service using Declarative Services</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../license.html">Apache License 2.0</a>
</li>
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../site-map.html">Site map</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Documentation</span>
<span class="version">master</span>
</div>
<ul class="components">
<li class="component is-current">
<span class="title">Documentation</span>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../../index.html">master</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../index.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../../index.html">Documentation</a></li>
<li><a href="../../subprojects.html">Subprojects</a></li>
<li>Maven SCR plugin</li>
<li><a href="scr-javadoc-tags.html">SCR JavaDoc Tags Excerpt: Using JavaDoc Tags to describe the component or service.</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/apache/felix-antora-site/edit/main/modules/ROOT/pages/subprojects/apache-felix-maven-scr-plugin/scr-javadoc-tags.adoc">Edit this Page</a></div>
</div>
<div class="content">
<article class="doc">
<h1 class="page">SCR JavaDoc Tags Excerpt: Using JavaDoc Tags to describe the component or service.</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>JavaDoc tags are not supported since the Maven SCR Plugin 1.8.0 because annotations are a much more powerful instrument allowing for type safety or supporting JVM based languages such as Groovy and Scala.
This page exists to define the support for JavaDoc tags upto Maven SCR Plugin version 1.7.4.</p>
</div>
<div class="paragraph">
<p>The <code>scr</code> goal of the <code>maven-scr-plugin</code> looks for the following JavaDoc tags when building component descriptors:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="#scrcomponent">scr.component</a></p>
</li>
<li>
<p><a href="#scrproperty">scr.property</a></p>
</li>
<li>
<p><a href="#scrservice">scr.service</a></p>
</li>
<li>
<p><a href="#scrreference">scr.reference</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_scr_component"><a class="anchor" href="#_scr_component"></a>scr.component</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>scr.component</code> tag is the only required tag.
If this tag is not declared in the Java class comment, the class is not declared as a component.</p>
</div>
<div class="paragraph">
<p>This tag is used to declare the <code>&lt;component&gt;</code> element of the component declaration.
See section 112.4.3, Component Element, in the OSGi Service Platform Service Compendium Specification for more information.
The required <code>&lt;implementation&gt;</code> element is automatically generated with the fully qualified name of the class containing the <code>scr.component</code> tag.</p>
</div>
<div class="paragraph">
<p>Supported parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.667%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><em>Name</em></th>
<th class="tableblock halign-left valign-top"><em>Default Value</em></th>
<th class="tableblock halign-left valign-top"><em>Required</em></th>
<th class="tableblock halign-left valign-top"><em>SCR</em></th>
<th class="tableblock halign-left valign-top"><em>Metatype</em></th>
<th class="tableblock halign-left valign-top"><em>Description</em></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Fully qualified name of the Java class</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>component.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>OCD.id</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Defines the Component name also used as the PID for the Configuration Admin Service</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ds</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether Declarative Services descriptor is generated or not.
If this parameter is not set or set to <code>true</code> the Declarative Services descriptor is generated in the service descriptor file for this component.
Otherwise no Declarative Services descriptor is generated for this component.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">abstract</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">see description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">This marks an abstract service description which is not added to the descriptor but intended for reuse through inheritance.
This attribute defaults to <code>true</code> for abstract classes and <code>false</code> for concrete classes.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">enabled</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>component.enabled</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether the component is enabled when the bundle starts</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">factory</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>component.factory</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether the component is a factory component</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">immediate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>component.immediate</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether the component is immediately activated</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">inherit</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether any service, property and reference declarations from base classes should be inherited by this class.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">metatype</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether Metatype Service data is generated or not.
If this parameter is not set or set to <code>true</code> Metatype Service data is generated in the <code>metatype.xml</code> file for this component.
Otherwise no Metatype Service data is generated for this component.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">label</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%&lt;name&gt;.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>OCD.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">This is generally used as a title for the object described by the meta type.
This name may be localized by prepending a <code>%</code> sign to the name.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%&lt;name&gt;.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>OCD.description</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">This is generally used as a description for the object described by the meta type.
This name may be localized by prepending a <code>%</code> sign to the name.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">create-pid</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>service.pid</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Generate the <code>service.pid</code> property if non is declared.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">configurationFactory</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>false</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Designate.factoryPid</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Is this a configuration factory?
(since 1.4.0)</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>The following attributes are supported since version 1.4.0 of the plugin and required a Declarative Service implementation 1.1:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.667%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><em>Name</em></th>
<th class="tableblock halign-left valign-top"><em>Default Value</em></th>
<th class="tableblock halign-left valign-top"><em>Required</em></th>
<th class="tableblock halign-left valign-top"><em>SCR</em></th>
<th class="tableblock halign-left valign-top"><em>Metatype</em></th>
<th class="tableblock halign-left valign-top"><em>Description</em></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>OPTIONAL</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">component.policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The configuration policy for this component: <code>optional</code>, <code>ignore</code>, or <code>require</code> (use lower case words)</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">activate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>activate</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">component.activate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the component activation method.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">deactivate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>deactivate</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">component.deactivate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the component deactivation method.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">modified</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">component.modified</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the component modified method.</p></td>
</tr>
</tbody>
</table>
<div class="sect2">
<h3 id="_abstract_service_descriptions"><a class="anchor" href="#_abstract_service_descriptions"></a>Abstract Service Descriptions</h3>
<div class="paragraph">
<p>If the <code>scr.component</code> tag contains the parameter <code>abstract</code> with a value of true, the containing class is regarded as an abstract class.
It is not added to the service descriptor and the tags are not validated.
The information about this class is added to the bundle.
Classes from other bundles (or the same) can extends this abstract class and do not need to specify the references of the abstract class if they set the <code>inherit</code> parameter on the <code>scr.component</code> tag to true.</p>
</div>
<div class="paragraph">
<p>This allows to create abstract classes which already provide some valuable functionality without having to deal with the details like reference definitions in each and every subclass.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_scr_property"><a class="anchor" href="#_scr_property"></a>scr.property</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>scr.property</code> tag defines properties which are made available to the component through the <code>ComponentContext.getProperties()</code> method.
These tags are not strictly required but may be used by components to defined initial configuration.
Additionally properties may be set here to identify the component if it is registered as a service, for example the <code>service.description</code> and <code>service.vendor</code> properties.</p>
</div>
<div class="paragraph">
<p>This tag may be defined in the Java Class comment of the component or in a coment to a field defining a constant with the name of the property.</p>
</div>
<div class="paragraph">
<p>This tag is used to declare <code>&lt;property&gt;</code> elements of the component declaration.
See section 112.4.5, Properties and Property Elements, in the OSGi Service Platform Service Compendium Specification for more information.</p>
</div>
<div class="paragraph">
<p>Supported parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.667%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><em>Name</em></th>
<th class="tableblock halign-left valign-top"><em>Default Value</em></th>
<th class="tableblock halign-left valign-top"><em>Required</em></th>
<th class="tableblock halign-left valign-top"><em>SCR</em></th>
<th class="tableblock halign-left valign-top"><em>Metatype</em></th>
<th class="tableblock halign-left valign-top"><em>Description</em></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of constant</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>property.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.id</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the property.
If this tag is defined on a field with an initialization expression, the value of that expression is used as the name if the field is of type <code>String</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">value</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>property.value</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.default</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The value of the property.
If the property type is not <code>String</code>, parsing of the value is done using the <code>valueOf(String)</code> method of the class defined by the property type</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>property.type</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.type</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The type of the property value.
This must be one of <code>String</code>, <code>Long</code>, <code>Double</code>, <code>Float</code>, <code>Integer</code>, <code>Byte</code>, <code>Char</code>, <code>Boolean</code> and <code>Short</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">label</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%&lt;name&gt;.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The label to display in a form to configure this property.
This name may be localized by prepending a <code>%</code> sign to the name.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>%&lt;name&gt;.description</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.description</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A descriptive text to provide the client in a form to configure this property.
This name may be localized by prepending a <code>%</code> sign to the name.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">private</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Depending on the name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Boolean flag defining whether a metatype descriptor entry should be generated for this property or not.
By default a metatype descriptor entry, i.e.
an <code>AD</code> element, is generated except for the properties <code>service.pid</code>, <code>service.description</code>, <code>service.id</code>, <code>service.ranking</code>, <code>service.vendor</code>, <code>service.bundlelocation</code> and <code>service.factoryPid</code>.
If a property should not be available for display in a configuration user interface, this parameter should be set to <code>true</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">cardinality</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Depends on property value(s)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.cardinality</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Defines the cardinality of the property and its collection type.
If the cardinality is negative, the property is expected to be stored in a <code>java.util.Vector</code> (primitive types such as <code>boolean</code> are boxed in the Wrapper class), if the cardinality is positive, the property is stored in an array (primitve types are unboxed, that is <code>Boolean</code> type values are stored in <code>boolean\[\]({{ refs..path }})</code>).
The actual value defines the maximum number of elements in the vector or array, where <code>Integer.MIN*INT</code> describes an unbounded Vector and <code>Integer.MAX*INT</code> describes an unbounded array.
If the cardinality is zero, the property is a scalar value.
If the defined value of the property is set in the <code>value</code> attribute, the cardinality defaults to <code>0</code> (zero for scalar value).
If the property is defined in one or more properties starting with <code>values</code>, the cardinality defaults to <code>Integer.MAX_INT</code>, that is an unbounded array.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">options</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See below</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See below for a description of the <code>options</code> parameter.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">values*</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See below</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See below for a description of parameters starting with <code>values</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">valueRef</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AD.default</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A constant containing the value for this property.
The constant can either be declared in the same class as this property or in any class that is imported.
The type of the property is derived from the constant.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">valueRefs</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See below</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Same as the <code>values</code> attribute with the difference that it acts like the <code>valueRef</code> attribute and the value points to a constants defining the multi value for the property.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><em>Notes</em>:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Generating <code>&lt;properties&gt;</code> elements referring to bundle entries is not currently supported.</p>
</li>
</ul>
</div>
<div class="sect2">
<h3 id="_naming_the_property"><a class="anchor" href="#_naming_the_property"></a>Naming the property</h3>
<div class="paragraph">
<p>It is important to carefully define the name of properties.
By using a constant of the form</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java"> /** @scr.property value="default value" */
static final String CONSTANT_NAME = "property.name";</code></pre>
</div>
</div>
<div class="paragraph">
<p>and defining the <code>scr.property</code> tag on this constant, the name of the property is taken from the constant value.
Thus it may easily be ensured, that both the property in the descriptor files and the property used by the implementation are actually the same.</p>
</div>
</div>
<div class="sect2">
<h3 id="_the_options_parameter"><a class="anchor" href="#_the_options_parameter"></a>The <code>options</code> parameter</h3>
<div class="paragraph">
<p>Some properties may only be set to a set of possible values.
To support user interfaces which provide a selection list of values or a list of checkboxes the option values and labels may be defined as parameters to the <code>scr.property</code> tag.
All parameters in the form of name-value pairs occurring <em>after</em> the <code>options</code> parameter are used to build the list of available value options.
The parameter name is used as the value while the parameter value is used as the label in the user interface.
This label may be prepended with a <code>%</code> sign to localize the string.</p>
</div>
<div class="paragraph">
<p>The options are written to the <code>metatype.xml</code> file as <code>Option</code> elements inside the <code>AD</code> element defining the property.
The name of the parameter will be used for the <code>Option.value</code> attribute while the value of the parameter defines the <code>Option.label</code> attribute.</p>
</div>
<div class="paragraph">
<p>Please note, that all parameters of the <code>scr.property</code> tag occurring <em>after</em> the <code>options</code> parameter are used to build the options list.
Hence no non-option value parameters should actually follow the <code>options</code> parameter.</p>
</div>
</div>
<div class="sect2">
<h3 id="_multivalue_properties"><a class="anchor" href="#_multivalue_properties"></a>Multivalue properties</h3>
<div class="paragraph">
<p>Generally the value of a property is scalar, that is a property has a single value such as <code>true</code>, <code>5</code> or <code>"This is a String"</code>.
Such scalar values are defined with the <code>value</code> parameter of the <code>scr.property</code> tag.
In the case of a scalar property value, the <code>cardinality</code> parameter value is assumed to be <code>0</code> (zero) unless of course set otherwise.</p>
</div>
<div class="paragraph">
<p>There may be properties, which have a list of values, such as a list of possible URL mappings for an URL Mapper.
Such multiple values are defined in one more parameters whose name starts with <code>values</code>.
Each parameter must of course have a unique name which is not in any except to differentiate the parameters.</p>
</div>
<div class="paragraph">
<p>If the cardinality of the property is not explicilty set with the <code>cardinality</code> property, it defaults to <code>Integer.MAX_INT</code>, i.e.
unbound array, if multiple values with a series of <code>values</code> parameters are defined.
Otherwise the <code>cardinality</code> parameter may be set for example to a negative value to store the values in a <code>java.util.Vector</code> instead.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_scr_service"><a class="anchor" href="#_scr_service"></a>scr.service</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>scr.service</code> tag defines whether and which service interfaces are provided by the component.</p>
</div>
<div class="paragraph">
<p>This tag is expected in the Java Class comment of the component.</p>
</div>
<div class="paragraph">
<p>This tag is used to declare <code>&lt;service&gt;</code> and <code>&lt;provide&gt;</code> elements of the component declaration.
See section 112.4.6, Service Elements, in the OSGi Service Platform Service Compendium Specification for more information.</p>
</div>
<div class="paragraph">
<p>Supported parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><em>Name</em></th>
<th class="tableblock halign-left valign-top"><em>Default Value</em></th>
<th class="tableblock halign-left valign-top"><em>Required</em></th>
<th class="tableblock halign-left valign-top"><em>Descriptor</em></th>
<th class="tableblock halign-left valign-top"><em>Description</em></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">interface</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">All implemented interfaces</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>provide.interface</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the service interface provided by the component.
This can either be the fully qualified name or just the interface class name if the interface is either in the same package or is imported.
If this property is not set <code>provide</code> elements will be generated for all interfaces generated by the class</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">servicefactory</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>false</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>service.servicefactory</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether the component is registered as a <code>ServiceFactory</code> or not</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Omitting the <code>scr.service</code> tag will just define (and activate if required) the component but not register it as a service.
Multiple <code>scr.service</code> tags may be declared each with its own <code>interface</code>.
The component is registered as a <code>ServiceFactory</code> if at least on <code>scr.service</code> tag declares the <code>servicefactory</code> parameter as <code>true</code>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_scr_reference"><a class="anchor" href="#_scr_reference"></a>scr.reference</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>scr.reference</code> tag defines references to other services made available to the component by the Service Component Runtime.</p>
</div>
<div class="paragraph">
<p>This tag may be declared in the java Class comment or any Java Field to which it might apply.
Depending on where the tag is declared, the parameters may have different default values.</p>
</div>
<div class="paragraph">
<p>This tag is used to declare <code>&lt;reference&gt;</code> elements of the component declaration.
See section 112.4.7, Reference Element, in the OSGi Service Platform Service Compendium Specification for more information.</p>
</div>
<div class="paragraph">
<p>Supported parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><em>Name</em></th>
<th class="tableblock halign-left valign-top"><em>Default Value</em></th>
<th class="tableblock halign-left valign-top"><em>Required</em></th>
<th class="tableblock halign-left valign-top"><em>Descriptor</em></th>
<th class="tableblock halign-left valign-top"><em>Description</em></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">name</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Name of the field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.name</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The local name of the reference.
If the <code>scr.reference</code> tag is declared in the class comment, this parameter is required.
If the tag is declared in the field comment, the default value for the <code>name</code> parameter is the name of the field</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">interface</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type of the field</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">yes</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.interface</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the service interface.
This name is used by the Service Component Runtime to access the service on behalf of the component.
If the <code>scr.reference</code> tag is declared in the class comment, this parameter is required.
If the tag is declared in the field comment, the default value for the <code>interface</code> parameter is the type of the field</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">cardinality</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>1..1</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.cardinality</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The cardinality of the service reference.
This must be one of <code>0..1</code>, <code>1..1</code>, <code>0..n</code>, and <code>1..n</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">policy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>static</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.policy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The dynamicity policy of the reference.
If <code>dynamic</code> the service will be made available to the component as it comes and goes.
If <code>static</code> the component will be deactivated and re-activated if the service comes and/or goes away.
This must be one of <code>static</code> and <code>dynamic</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">target</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">&#8201;&#8212;&#8201;</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.target</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">A service target filter to select specific services to be made available.
In order to be able to overwrite the value of this value by a configuration property, this parameter must be declared.
If the parameter is not declared, the respective declaration attribute will not be generated</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">bind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.bind</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the method to be called when the service is to be bound to the component.
The default value is the name created by appending the reference <code>name</code> to the string <code>bind</code>.
The method must be declared <code>public</code> or <code>protected</code> and take single argument which is declared with the service interface type</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">unbind</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">See description</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.unbind</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the method to be called when the service is to be unbound from the component.
The default value is the name created by appending the reference <code>name</code> to the string <code>unbind</code>.
The method must be declared <code>public</code> or <code>protected</code> and take single argument which is declared with the service interface type</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">strategy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>event</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">no</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>reference.strategy</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The strategy used for this reference, one of <code>event</code> or <code>lookup</code></p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><em>Notes</em>:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>If you define a reference on a field with the strategy <code>event</code> and there is no bind or unbind method, the plugin will create the necessary methods.</p>
</li>
</ul>
</div>
</div>
</div>
</article>
<aside class="toc sidebar" data-title="Contents" data-levels="2">
<div class="toc-menu"></div>
</aside>
</div>
</main>
</div>
<footer class="footer">
<p>Content licensed under AL2. UI licensed under MPL-2.0 with extensions licensed under AL2</p>
</footer>
<script src="../../../_/js/site.js"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
</body>
</html>