cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF > cxf-xjc-boolean
Date Fri, 22 Oct 2010 18:01:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/15/_/styles/combined.css?spaceKey=CXF&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/CXF/cxf-xjc-boolean">cxf-xjc-boolean</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~dkulp">Daniel
Kulp</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="cxf-xjc-boolean-CXFXJCBooleanGetterPlugin"></a>CXF
XJC Boolean Getter Plugin</h2>

<p>The CXF XJC Boolean Getter Plugin provides and XJC plugin that updates the generated
beans to change the boolean getter methods from "isFoo()" to "getFoo()".   This is useful
when integrating with certain other applications that use simple BeanInfo reflection to determine
the properties. </p>

<p>For example, if the schema contains:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;xs:complexType name=<span class="code-quote">"Foo"</span>&gt;</span>
  	<span class="code-tag">&lt;xs:sequence&gt;</span>
	    <span class="code-tag">&lt;xs:element name=<span class="code-quote">"value"</span>
type=<span class="code-quote">"xs:boolean"</span>/&gt;</span>
   <span class="code-tag">&lt;/xs:sequence&gt;</span>
<span class="code-tag">&lt;/xs:complexType&gt;</span>
</pre>
</div></div>

<p>it would generate getter methods like:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    <span class="code-keyword">public</span> <span class="code-object">boolean</span>
getValue() {
        <span class="code-keyword">return</span> value;
    }
</pre>
</div></div>
<p>Instead of the default method of:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    <span class="code-keyword">public</span> <span class="code-object">boolean</span>
isValue() {
        <span class="code-keyword">return</span> value;
    }
</pre>
</div></div>


<h3><a name="cxf-xjc-boolean-TousewithMaven"></a>To use with Maven</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
           <span class="code-tag">&lt;plugin&gt;</span>
                <span class="code-tag">&lt;groupId&gt;</span>org.apache.cxf<span
class="code-tag">&lt;/groupId&gt;</span>
                <span class="code-tag">&lt;artifactId&gt;</span>cxf-xjc-plugin<span
class="code-tag">&lt;/artifactId&gt;</span>
                <span class="code-tag">&lt;executions&gt;</span>
                    <span class="code-tag">&lt;execution&gt;</span>
                        <span class="code-tag">&lt;goals&gt;</span>
                            <span class="code-tag">&lt;goal&gt;</span>xsdtojava<span
class="code-tag">&lt;/goal&gt;</span>
                        <span class="code-tag">&lt;/goals&gt;</span>
                    <span class="code-tag">&lt;/execution&gt;</span>
                <span class="code-tag">&lt;/executions&gt;</span>
                <span class="code-tag">&lt;configuration&gt;</span>
                    <span class="code-tag">&lt;xsdOptions&gt;</span>
                        <span class="code-tag">&lt;xsdOption&gt;</span>
                            <span class="code-tag">&lt;extension&gt;</span>true<span
class="code-tag">&lt;/extension&gt;</span>
                            <span class="code-tag">&lt;xsd&gt;</span>${basedir}/src/main/resources/schemas/configuration/foo.xsd<span
class="code-tag">&lt;/xsd&gt;</span>
                            <span class="code-tag">&lt;extensionArgs&gt;</span>
                                <span class="code-tag">&lt;arg&gt;</span>-Xbg<span
class="code-tag">&lt;/arg&gt;</span>
                            <span class="code-tag">&lt;/extensionArgs&gt;</span>
                        <span class="code-tag">&lt;/xsdOption&gt;</span>
                    <span class="code-tag">&lt;/xsdOptions&gt;</span>
                    <span class="code-tag">&lt;extensions&gt;</span>
                        <span class="code-tag">&lt;extension&gt;</span>org.apache.cxf.xjcplugins:cxf-xjc-boolean:2.3.0<span
class="code-tag">&lt;/extension&gt;</span>
                    <span class="code-tag">&lt;/extensions&gt;</span>
                <span class="code-tag">&lt;/configuration&gt;</span>
            <span class="code-tag">&lt;/plugin&gt;</span>

</pre>
</div></div>
    </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/CXF/cxf-xjc-boolean">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/CXF/cxf-xjc-boolean?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message