camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Endpoint Annotations
Date Tue, 23 Apr 2013 09:52:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Endpoint+Annotations">Endpoint
Annotations</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~jstrachan">James
Strachan</a>
    </h4>
        <br/>
                         <h4>Changes (6)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >h2. Endpoint Annotations <br>
<br></td></tr>
            <tr><td class="diff-changed-lines" >As of *Camel 2.12* you can annotate
[Endpoint] and Consumer classes so that their configuration documentation can be automatically
generated by the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">maven
plugin.</span> <span class="diff-added-words"style="background-color: #dfd;">camel-package-maven-plugin.</span>
<br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
following annotations are supported: <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The
documentation is then included into the jar as org/apache/camel/component/scheme.html as well
as appearing in the maven site documentation as a project report. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
Supported annotations <br> <br></td></tr>
            <tr><td class="diff-unchanged" >||Annotation||Description|| <br>|@UriEndpoint|Specifies
that an endpoint is annotated with @UriParam and/or @UriParams annotations. Also specifies
the default scheme to use in the generated documentation and the associated Consumer class
for this endpoint| <br>|@UriParam|Used to annotate a parameter value; usually specified
via ?foo=bar syntax in the URI strings in Camel. Used currently only on field declarations
but in the future could be used on setter methods too. If no name is specified then the name
of the field/setter property is used.| <br></td></tr>
            <tr><td class="diff-changed-lines" >|@UriParams|Specifies that a field
is a nested object of one or more configuration parameters; then the class of this field should
be <span class="diff-changed-words">ann<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">n</span>otated</span>
with one or more @UriParam or @UriParams annotations| <br></td></tr>
            <tr><td class="diff-unchanged" > <br>For example here is the
[TimerEndpoint|https://github.com/apache/camel/blob/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java#L40],
notice the use of these annotations and in its base classes. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>Not only are the annotations useful for automatically generating the documentation;
we can use them to refine the validation of the code during configuration and they can be
useful for tool providers so they can more easily introspect the configuration options. See
the [ComponentConfiguration] documentation on the tooling aspect. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="EndpointAnnotations-EndpointAnnotations"></a>Endpoint
Annotations</h2>

<p>As of <b>Camel 2.12</b> you can annotate <a href="/confluence/display/CAMEL/Endpoint"
title="Endpoint">Endpoint</a> and Consumer classes so that their configuration documentation
can be automatically generated by the camel-package-maven-plugin.</p>

<p>The documentation is then included into the jar as org/apache/camel/component/scheme.html
as well as appearing in the maven site documentation as a project report.</p>

<h3><a name="EndpointAnnotations-Supportedannotations"></a>Supported annotations</h3>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Annotation</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'>@UriEndpoint</td>
<td class='confluenceTd'>Specifies that an endpoint is annotated with @UriParam and/or
@UriParams annotations. Also specifies the default scheme to use in the generated documentation
and the associated Consumer class for this endpoint</td>
</tr>
<tr>
<td class='confluenceTd'>@UriParam</td>
<td class='confluenceTd'>Used to annotate a parameter value; usually specified via ?foo=bar
syntax in the URI strings in Camel. Used currently only on field declarations but in the future
could be used on setter methods too. If no name is specified then the name of the field/setter
property is used.</td>
</tr>
<tr>
<td class='confluenceTd'>@UriParams</td>
<td class='confluenceTd'>Specifies that a field is a nested object of one or more configuration
parameters; then the class of this field should be annotated with one or more @UriParam or
@UriParams annotations</td>
</tr>
</tbody></table>
</div>


<p>For example here is the <a href="https://github.com/apache/camel/blob/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java#L40"
class="external-link" rel="nofollow">TimerEndpoint</a>, notice the use of these annotations
and in its base classes.</p>

<p>Not only are the annotations useful for automatically generating the documentation;
we can use them to refine the validation of the code during configuration and they can be
useful for tool providers so they can more easily introspect the configuration options. See
the <a href="/confluence/pages/createpage.action?spaceKey=CAMEL&amp;title=ComponentConfiguration&amp;linkCreation=true&amp;fromPageId=31819227"
class="createlink">ComponentConfiguration</a> documentation on the tooling aspect.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Endpoint+Annotations">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=31819227&revisedVersion=3&originalVersion=2">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Endpoint+Annotations?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message