duration.xsl revision fb4f51ce7610bdb3d59e1601dcec8884ab76487d
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
!
! Portions Copyright 2007 Sun Microsystems, Inc.
! -->
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Templates for processing duration properties.
-->
<xsl:template match="adm:duration" mode="java-value-type">
<xsl:value-of select="'Long'" />
</xsl:template>
<xsl:template match="adm:duration" mode="java-value-primitive-type">
<xsl:value-of select="'long'" />
</xsl:template>
<xsl:template match="adm:duration" mode="java-definition-type">
<xsl:value-of select="'DurationPropertyDefinition'" />
</xsl:template>
<xsl:template match="adm:duration" mode="java-definition-ctor">
<xsl:if test="boolean(@allow-unlimited)">
<xsl:value-of
select="concat(' builder.setAllowUnlimited(',
@allow-unlimited, ');
')" />
</xsl:if>
<xsl:if test="boolean(@base-unit)">
<xsl:value-of
select="concat(' builder.setBaseUnit("',
@base-unit, '");
')" />
</xsl:if>
<xsl:if test="boolean(@maximum-unit)">
<xsl:value-of
select="concat(' builder.setMaximumUnit("',
@maximum-unit, '");
')" />
</xsl:if>
<xsl:if test="boolean(@upper-limit)">
<xsl:value-of
select="concat(' builder.setUpperLimit("',
@upper-limit, '");
')" />
</xsl:if>
<xsl:if test="boolean(@lower-limit)">
<xsl:value-of
select="concat(' builder.setLowerLimit("',
@lower-limit, '");
')" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>