oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1481770 - /oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
Date Mon, 13 May 2013 10:04:16 GMT
Author: simonetripodi
Date: Mon May 13 10:04:15 2013
New Revision: 1481770

URL: http://svn.apache.org/r1481770
Log:
check input argument for mandatory parameters

Modified:
    oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl

Modified: oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl
URL: http://svn.apache.org/viewvc/oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl?rev=1481770&r1=1481769&r2=1481770&view=diff
==============================================================================
--- oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl (original)
+++ oltu/whiteboard/simonetripodi/oltu-commons/src/main/stylesheet/commons.xsl Mon May 13
10:04:15 2013
@@ -242,8 +242,12 @@ public final class <xsl:value-of select=
          * @parameter <xsl:value-of select="@field" /> the {@code <xsl:value-of
select="@name" />} parameter.
          * @return this builder instance.
          */
-        public Builder set<xsl:call-template name="toCamelCase"><xsl:with-param
name="fieldName" select="@field" /></xsl:call-template>(<xsl:value-of select="@type"
/><xsl:text> </xsl:text><xsl:value-of select="@field" />)
+        public Builder set<xsl:call-template name="toCamelCase"><xsl:with-param
name="fieldName" select="@field" /></xsl:call-template>( final <xsl:value-of select="@type"
/><xsl:text> </xsl:text><xsl:value-of select="@field" /> )
         {
+            <xsl:if test="@required = 'true'">if ( <xsl:value-of select="@field"
/> == null )
+            {
+                throw new IllegalArgumentException( "Parameter '<xsl:value-of select="@field"
/>' [<xsl:value-of select="@name" />] can not be null." );
+            }</xsl:if>
             this.<xsl:value-of select="@field" /> = <xsl:value-of select="@field"
/>;
             return this;
         }



Mime
View raw message