1008N/A<!--
1008N/A ! CDDL HEADER START
1008N/A !
1008N/A ! The contents of this file are subject to the terms of the
1008N/A ! Common Development and Distribution License, Version 1.0 only
1008N/A ! (the "License"). You may not use this file except in compliance
1008N/A ! with the License.
1008N/A !
1008N/A ! You can obtain a copy of the license at
1008N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
1008N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1008N/A ! See the License for the specific language governing permissions
1008N/A ! and limitations under the License.
1008N/A !
1008N/A ! When distributing Covered Code, include this CDDL HEADER in each
1008N/A ! file and include the License file at
1008N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1008N/A ! add the following below this CDDL HEADER, with the fields enclosed
1008N/A ! by brackets "[]" replaced with your own identifying information:
1008N/A ! Portions Copyright [yyyy] [name of copyright owner]
1008N/A !
1008N/A ! CDDL HEADER END
1008N/A !
1008N/A !
3215N/A ! Copyright 2008 Sun Microsystems, Inc.
1008N/A ! -->
1008N/A<xsl:stylesheet version="1.0" xmlns:adm="http://www.opends.org/admin"
1008N/A xmlns:admpp="http://www.opends.org/admin-preprocessor"
1008N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
1008N/A <!--
1008N/A Templates for processing enumeration properties.
1008N/A -->
1008N/A <xsl:template match="adm:enumeration" mode="java-value-imports">
1008N/A <xsl:variable name="pp"
1008N/A select="/adm:profile[@name='preprocessor']" />
1008N/A <xsl:element name="import">
1008N/A <xsl:choose>
2345N/A <xsl:when test="$pp/admpp:first-defined-in">
2345N/A <xsl:value-of
2345N/A select="concat($pp/admpp:first-defined-in/@package, '.')" />
2345N/A <xsl:if test="$pp/admpp:first-defined-in/@name">
2345N/A <xsl:value-of select="'meta.'" />
2345N/A <xsl:call-template name="name-to-java">
2345N/A <xsl:with-param name="value"
2345N/A select="$pp/admpp:first-defined-in/@name" />
2345N/A </xsl:call-template>
2345N/A <xsl:value-of select="'CfgDefn.'" />
2345N/A </xsl:if>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
2345N/A select="concat($pp/admpp:last-defined-in/@package, '.')" />
2345N/A <xsl:value-of select="'meta.'" />
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value"
2345N/A select="$pp/admpp:last-defined-in/@name" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="'CfgDefn.'" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:apply-templates select="." mode="java-value-type" />
1008N/A </xsl:element>
1008N/A </xsl:template>
1008N/A <xsl:template match="adm:enumeration"
1008N/A mode="java-definition-imports">
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="'org.opends.server.admin.EnumPropertyDefinition'" />
1008N/A </xsl:element>
1008N/A <xsl:variable name="pp"
1008N/A select="/adm:profile[@name='preprocessor']" />
2345N/A <xsl:if test="$pp/admpp:first-defined-in">
1008N/A <xsl:element name="import">
2345N/A <xsl:value-of
2345N/A select="concat($pp/admpp:first-defined-in/@package, '.')" />
2345N/A <xsl:if test="$pp/admpp:first-defined-in/@name">
2345N/A <xsl:value-of select="'meta.'" />
2345N/A <xsl:call-template name="name-to-java">
2345N/A <xsl:with-param name="value"
2345N/A select="$pp/admpp:first-defined-in/@name" />
2345N/A </xsl:call-template>
2345N/A <xsl:value-of select="'CfgDefn.'" />
2345N/A </xsl:if>
1008N/A <xsl:apply-templates select="." mode="java-value-type" />
1008N/A </xsl:element>
1008N/A </xsl:if>
1008N/A </xsl:template>
1008N/A <xsl:template match="adm:enumeration" mode="java-value-type">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="../../@name" />
1008N/A </xsl:call-template>
1008N/A </xsl:template>
1008N/A <xsl:template match="adm:enumeration" mode="java-definition-type">
1008N/A <xsl:value-of select="'EnumPropertyDefinition'" />
1008N/A </xsl:template>
1008N/A <xsl:template match="adm:enumeration"
1008N/A mode="java-definition-generic-type">
1008N/A <xsl:apply-templates select="." mode="java-value-type" />
1008N/A </xsl:template>
1008N/A <xsl:template match="adm:enumeration" mode="java-definition-ctor">
1008N/A <xsl:value-of select="' builder.setEnumClass('" />
1008N/A <xsl:apply-templates select="." mode="java-value-type" />
1008N/A <xsl:value-of select="'.class);&#xa;'" />
1008N/A </xsl:template>
1008N/A</xsl:stylesheet>