metaMO.xsl revision 2517
0N/A<!--
0N/A ! CDDL HEADER START
0N/A !
0N/A ! The contents of this file are subject to the terms of the
0N/A ! Common Development and Distribution License, Version 1.0 only
0N/A ! (the "License"). You may not use this file except in compliance
0N/A ! with the License.
0N/A !
0N/A ! You can obtain a copy of the license at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A ! See the License for the specific language governing permissions
0N/A ! and limitations under the License.
0N/A !
0N/A ! When distributing Covered Code, include this CDDL HEADER in each
0N/A ! file and include the License file at
0N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
873N/A ! add the following below this CDDL HEADER, with the fields enclosed
0N/A ! by brackets "[]" replaced with your own identifying information:
0N/A ! Portions Copyright [yyyy] [name of copyright owner]
0N/A !
0N/A ! CDDL HEADER END
0N/A !
733N/A !
0N/A ! Portions Copyright 2007 Sun Microsystems, Inc.
0N/A ! -->
0N/A<xsl:stylesheet version="1.0" xmlns:adm="http://www.opends.org/admin"
0N/A xmlns:admpp="http://www.opends.org/admin-preprocessor"
0N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
0N/A xmlns:exsl="http://exslt.org/common">
0N/A <xsl:import href="java-utilities.xsl" />
0N/A <xsl:import href="preprocessor.xsl" />
0N/A <xsl:import href="property-types.xsl" />
0N/A <xsl:output method="text" encoding="us-ascii" />
0N/A <!--
0N/A Template for generating the class declaration.
0N/A -->
0N/A <xsl:template name="generate-meta-class-declaration">
0N/A <xsl:value-of select="'/**&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="content"
0N/A select="concat('An interface for querying the ', $this-ufn,
0N/A ' managed object definition meta information.')" />
0N/A </xsl:call-template>
0N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="content" select="$this/adm:synopsis" />
0N/A </xsl:call-template>
0N/A <xsl:value-of select="' */&#xa;'" />
0N/A <xsl:value-of
0N/A select="concat('public final class ',
0N/A $this-java-class,
0N/A 'CfgDefn extends ')" />
0N/A <xsl:choose>
0N/A <xsl:when test="$this-is-abstract">
0N/A <xsl:value-of
0N/A select="concat('AbstractManagedObjectDefinition&lt;',
0N/A $this-java-class, 'CfgClient, ',
0N/A $this-java-class, 'Cfg&gt; {&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of
0N/A select="concat('ManagedObjectDefinition&lt;',
0N/A $this-java-class, 'CfgClient, ',
0N/A $this-java-class, 'Cfg&gt; {&#xa;')" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:template>
0N/A <!--
0N/A Template for generating the meta class body.
0N/A -->
0N/A <xsl:template name="generate-meta-class-body">
0N/A <!--
0N/A Singleton configuration definition instance.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' // The singleton configuration definition instance.&#xa;',
0N/A ' private static final ',
0N/A $this-java-class ,
0N/A 'CfgDefn INSTANCE = new ', $this-java-class, 'CfgDefn();&#xa;')" />
0N/A <!--
0N/A Generate enumerations defined by this managed object..
0N/A -->
0N/A <xsl:for-each
0N/A select="$this-local-properties[adm:syntax/adm:enumeration and not(adm:profile[@name='preprocessor']/adm:first-defined-in)]">
0N/A <xsl:sort select="@name" />
0N/A <xsl:if
0N/A test="not(adm:profile[@name='preprocessor']/admpp:first-defined-in)">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-enumeration" />
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A <!--
0N/A Define application tags if this is the root configuration.
0N/A -->
0N/A <xsl:if test="$this-is-root">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of select="' // Define managed object tags.&#xa;'" />
0N/A <xsl:value-of select="' static {&#xa;'" />
0N/A <xsl:for-each select="$this/adm:tag-definition">
0N/A <xsl:sort select="@name" />
0N/A <xsl:value-of
0N/A select="concat(' Tag.define(&quot;', @name, '&quot;);&#xa;')" />
0N/A </xsl:for-each>
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:if>
0N/A <!--
0N/A Generate declarations for properties defined or
0N/A overridden by this managed object.
0N/A -->
0N/A <xsl:for-each select="$this-local-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-property-declaration" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Generate declarations for relations.
0N/A -->
0N/A <xsl:for-each select="$this-local-relations">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-relation-declaration" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Generate constructors for properties defined or
0N/A overridden by this managed object.
0N/A -->
0N/A <xsl:for-each select="$this-local-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-property-constructor" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Generate constructors for relations.
0N/A -->
0N/A <xsl:for-each select="$this-local-relations">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
983N/A <xsl:call-template name="generate-relation-constructor" />
983N/A </xsl:for-each>
0N/A <!--
0N/A Register any tags associated with this managed object definition.
0N/A -->
0N/A <xsl:if test="$this/adm:tag">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="' // Register the tags associated with this managed object definition.&#xa;'" />
0N/A <xsl:value-of select="' static {&#xa;'" />
0N/A <xsl:for-each select="$this/adm:tag">
0N/A <xsl:sort select="@name" />
0N/A <xsl:value-of
0N/A select="concat(' INSTANCE.registerTag(Tag.valueOf(&quot;', @name, '&quot;));&#xa;')" />
0N/A </xsl:for-each>
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:if>
0N/A <!--
0N/A Configuration definition singleton getter.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of select="' /**&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="content"
0N/A select="concat('Get the ', $this-ufn,' configuration definition singleton.')" />
0N/A </xsl:call-template>
0N/A <xsl:value-of select="' *&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="indent-text2" select="' * '" />
0N/A <xsl:with-param name="content"
0N/A select="concat('@return Returns the ', $this-ufn,
0N/A ' configuration definition singleton.')" />
0N/A </xsl:call-template>
0N/A <xsl:value-of select="' */&#xa;'" />
0N/A <xsl:value-of
0N/A select="concat(' public static ',
0N/A $this-java-class ,
0N/A 'CfgDefn getInstance() {&#xa;',
0N/A ' return INSTANCE;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Private constructor.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * Private constructor.&#xa;',
0N/A ' */&#xa;',
0N/A ' private ',
17N/A $this-java-class ,
0N/A 'CfgDefn() {&#xa;')" />
0N/A <xsl:choose>
0N/A <xsl:when test="boolean($this/@extends)">
0N/A <xsl:value-of
0N/A select="concat(' super(&quot;',
0N/A $this/@name,
0N/A '&quot;, ',
0N/A $parent-java-class,
0N/A 'CfgDefn.getInstance());&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of
0N/A select="concat(' super(&quot;',
0N/A $this/@name,
0N/A '&quot;, null);&#xa;')" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A <!--
0N/A Create configuration view factory methods for non-abstract definitions
0N/A -->
0N/A <xsl:if test="not($this-is-abstract)">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <!--
0N/A Generate configuration client factory method.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ',
0N/A $this-java-class,
0N/A 'CfgClient createClientConfiguration(&#xa;',
0N/A ' ManagedObject&lt;? extends ',
0N/A $this-java-class,
0N/A 'CfgClient&gt; impl) {&#xa;',
0N/A ' return new ',
0N/A $this-java-class ,
0N/A 'CfgClientImpl(impl);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <!--
0N/A Generate configuration server factory method.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ',
0N/A $this-java-class,
0N/A 'Cfg createServerConfiguration(&#xa;',
0N/A ' ServerManagedObject&lt;? extends ',$this-java-class,'Cfg&gt; impl) {&#xa;',
0N/A ' return new ',
0N/A $this-java-class ,
0N/A 'CfgServerImpl(impl);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <!--
0N/A Generate configuration server class getter..
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public Class&lt;',
0N/A $this-java-class,
0N/A 'Cfg&gt; getServerConfigurationClass() {&#xa;',
0N/A ' return ',
0N/A $this-java-class ,
0N/A 'Cfg.class;&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:if>
0N/A <!--
0N/A Generate property definition getters for all properties.
0N/A -->
0N/A <xsl:for-each select="$this-all-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
723N/A <xsl:call-template name="generate-property-definition-getter" />
723N/A </xsl:for-each>
0N/A <!--
48N/A Generate relation definition getters for all relations.
0N/A -->
0N/A <xsl:for-each select="$this-all-relations">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-relation-definition-getter" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Managed object class implementations.
0N/A -->
0N/A <xsl:if test="not($this-is-abstract)">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-client-impl-class" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-server-impl-class" />
0N/A </xsl:if>
0N/A </xsl:template>
0N/A <!--
0N/A Generate managed object client class implementation.
0N/A -->
0N/A <xsl:template name="generate-client-impl-class">
0N/A <!--
0N/A Declaration.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * Managed object client implementation.&#xa;',
0N/A ' */&#xa;',
0N/A ' private static class ',
0N/A $this-java-class ,
0N/A 'CfgClientImpl implements&#xa; ',
0N/A $this-java-class ,
0N/A 'CfgClient {&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <!--
0N/A Private instance.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' // Private implementation.&#xa;',
0N/A ' private ManagedObject&lt;? extends ',
0N/A $this-java-class,
0N/A 'CfgClient&gt; impl;&#xa;')" />
0N/A <!--
0N/A Private constructor.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' // Private constructor.&#xa;',
0N/A ' private ',
0N/A $this-java-class,
0N/A 'CfgClientImpl(&#xa;',
0N/A ' ManagedObject&lt;? extends ',
0N/A $this-java-class,
9N/A 'CfgClient&gt; impl) {&#xa;',
0N/A ' this.impl = impl;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Getters/Setters for all properties.
0N/A -->
0N/A <xsl:for-each select="$this-all-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template
0N/A name="generate-property-getter-implementation">
0N/A <xsl:with-param name="interface" select="'client'" />
0N/A </xsl:call-template>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-property-setter-implementation" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Relation methods.
0N/A -->
0N/A <xsl:for-each select="$this-all-relations">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-client-relation-methods" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Managed object definition getter.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ManagedObjectDefinition&lt;? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg&gt; definition() {&#xa;',
0N/A ' return INSTANCE;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Property provider view.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public PropertyProvider properties() {&#xa;',
0N/A ' return impl;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Commit method.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void commit() throws ManagedObjectAlreadyExistsException,&#xa;',
0N/A ' MissingMandatoryPropertiesException, ConcurrentModificationException,&#xa;',
0N/A ' OperationRejectedException, AuthorizationException,&#xa;',
0N/A ' CommunicationException {&#xa;',
0N/A ' impl.commit();&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate managed object server class implementation.
0N/A -->
0N/A <xsl:template name="generate-server-impl-class">
0N/A <!--
0N/A Declaration.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * Managed object server implementation.&#xa;',
0N/A ' */&#xa;',
0N/A ' private static class ',
0N/A $this-java-class ,
0N/A 'CfgServerImpl implements&#xa; ',
0N/A $this-java-class ,
0N/A 'Cfg {&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <!--
0N/A Private instance.
0N/A -->
0N/A <xsl:value-of
0N/A select="concat(' // Private implementation.&#xa;',
0N/A ' private ServerManagedObject&lt;? extends ', $this-java-class, 'Cfg&gt; impl;&#xa;')" />
0N/A <!--
0N/A Private members for each property.
0N/A -->
0N/A <xsl:for-each select="$this-all-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' // The value of the &quot;', @name, '&quot; property.&#xa;')" />
0N/A <xsl:value-of select="' private final '" />
0N/A <xsl:choose>
0N/A <xsl:when test="string(@multi-valued) != 'true'">
0N/A <xsl:choose>
0N/A <xsl:when test="adm:default-behavior/adm:defined">
0N/A <!--
0N/A The property is guaranteed to contain a value since there is a
0N/A well-defined default value.
0N/A -->
0N/A <xsl:call-template
0N/A name="get-property-java-primitive-type" />
0N/A </xsl:when>
0N/A <xsl:when test="@mandatory = 'true'">
0N/A <!--
0N/A The property is guaranteed to contain a value in the server interface.
0N/A -->
0N/A <xsl:call-template
0N/A name="get-property-java-primitive-type" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:call-template name="get-property-java-type" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="'SortedSet&lt;'" />
0N/A <xsl:call-template name="get-property-java-type" />
0N/A <xsl:value-of select="'&gt;'" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <xsl:value-of select="' p'" />
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
48N/A <xsl:value-of select="';&#xa;'" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Private constructor.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' // Private constructor.&#xa;',
0N/A ' private ',
0N/A $this-java-class,
0N/A 'CfgServerImpl(ServerManagedObject&lt;? extends ', $this-java-class, 'Cfg&gt; impl) {&#xa;',
0N/A ' this.impl = impl;&#xa;')" />
0N/A <xsl:for-each select="$this-all-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:variable name="java-prop-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' this.p', $java-prop-name, ' = ')" />
0N/A <xsl:choose>
0N/A <xsl:when test="string(@multi-valued) != 'true'">
0N/A <xsl:value-of
0N/A select="concat('impl.getPropertyValue(INSTANCE.get', $java-prop-name , 'PropertyDefinition());&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of
560N/A select="concat('impl.getPropertyValues(INSTANCE.get', $java-prop-name , 'PropertyDefinition());&#xa;')" />
560N/A </xsl:otherwise>
560N/A </xsl:choose>
560N/A </xsl:for-each>
28N/A <xsl:value-of select="' }&#xa;'" />
28N/A <!--
28N/A Generate all the change listener methods - one for each managed
28N/A object in the hierarchy.
28N/A -->
28N/A <xsl:if test="not($this-is-root)">
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-change-listener" />
0N/A </xsl:if>
0N/A <!--
0N/A Getters for all properties.
0N/A -->
0N/A <xsl:for-each select="$this-all-properties">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template
0N/A name="generate-property-getter-implementation">
0N/A <xsl:with-param name="interface" select="'server'" />
535N/A </xsl:call-template>
535N/A </xsl:for-each>
535N/A <!--
535N/A Relation methods.
0N/A -->
0N/A <xsl:for-each select="$this-all-relations">
0N/A <xsl:sort select="@name" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:call-template name="generate-server-relation-methods" />
0N/A </xsl:for-each>
0N/A <!--
0N/A Configuration definition getter.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ManagedObjectDefinition&lt;? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg&gt; definition() {&#xa;',
0N/A ' return INSTANCE;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Property provider view.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public PropertyProvider properties() {&#xa;',
0N/A ' return impl;&#xa;',
0N/A ' }&#xa;')" />
0N/A <!--
0N/A Configuration entry DN getter.
0N/A -->
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public DN dn() {&#xa;',
0N/A ' return impl.getDN();&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate a property definition constructor.
0N/A -->
0N/A <xsl:template name="generate-property-declaration">
0N/A <xsl:variable name="java-prop-name">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="type">
0N/A <xsl:call-template name="get-property-definition-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="generic-type">
0N/A <xsl:call-template name="get-property-definition-generic-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="pdtype">
0N/A <xsl:choose>
0N/A <xsl:when test="string-length($generic-type) != 0">
0N/A <xsl:value-of
0N/A select="concat($type, '&lt;', $generic-type, '&gt;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="$type" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' // The &quot;',
0N/A @name,
0N/A '&quot; property definition.&#xa;',
0N/A ' private static final ', $pdtype, ' PD_', $java-prop-name, ';&#xa;')" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate a property definition constructor.
0N/A -->
0N/A <xsl:template name="generate-property-constructor">
0N/A <xsl:variable name="java-prop-name">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="type">
0N/A <xsl:call-template name="get-property-definition-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="generic-type">
0N/A <xsl:call-template name="get-property-definition-generic-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="value-type">
0N/A <xsl:call-template name="get-property-java-type" />
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' // Build the &quot;', @name, '&quot; property definition.&#xa;',
0N/A ' static {&#xa;')" />
0N/A <xsl:choose>
0N/A <xsl:when test="string-length($generic-type) != 0">
0N/A <xsl:value-of
0N/A select="concat(' ', $type, '.Builder&lt;', $generic-type, '&gt; builder = ', $type, '.createBuilder(INSTANCE, &quot;',@name, '&quot;);&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of
0N/A select="concat(' ', $type, '.Builder builder = ', $type, '.createBuilder(INSTANCE, &quot;',@name, '&quot;);&#xa;')" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <xsl:if test="@multi-valued='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.MULTI_VALUED);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:if test="@read-only='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.READ_ONLY);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:if test="@monitoring='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.MONITORING);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:if test="@mandatory='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.MANDATORY);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:if test="@hidden='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.HIDDEN);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:if test="@advanced='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(PropertyOption.ADVANCED);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:variable name="action-type">
0N/A <xsl:choose>
0N/A <xsl:when test="adm:requires-admin-action">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value"
0N/A select="local-name(adm:requires-admin-action/*)" />
0N/A </xsl:call-template>
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="'NONE'" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.', $action-type, ', INSTANCE, &quot;', @name, '&quot;));&#xa;')" />
0N/A <xsl:choose>
0N/A <xsl:when
0N/A test="not(adm:default-behavior) or adm:default-behavior/adm:undefined">
0N/A <xsl:value-of
0N/A select="concat(' builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider&lt;', $value-type,'&gt;());&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:when test="adm:default-behavior/adm:alias">
0N/A <xsl:value-of
0N/A select="concat(' builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider&lt;', $value-type,'&gt;(INSTANCE, &quot;', @name, '&quot;));&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:when test="adm:default-behavior/adm:defined">
0N/A <xsl:value-of
0N/A select="concat(' DefaultBehaviorProvider&lt;', $value-type,'&gt; provider = ',
0N/A 'new DefinedDefaultBehaviorProvider&lt;', $value-type,'&gt;(')" />
0N/A <xsl:for-each
0N/A select="adm:default-behavior/adm:defined/adm:value">
0N/A <xsl:value-of
0N/A select="concat('&quot;', normalize-space(), '&quot;')" />
0N/A <xsl:if test="position() != last()">
0N/A <xsl:value-of select="', '" />
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A <xsl:value-of select="');&#xa;'" />
0N/A <xsl:value-of
0N/A select="' builder.setDefaultBehaviorProvider(provider);&#xa;'" />
0N/A </xsl:when>
0N/A <xsl:when
0N/A test="adm:default-behavior/adm:inherited/adm:relative">
0N/A <xsl:value-of
0N/A select="concat(' DefaultBehaviorProvider&lt;', $value-type,'&gt; provider = ',
0N/A 'new RelativeInheritedDefaultBehaviorProvider&lt;', $value-type,'&gt;(')" />
0N/A <xsl:variable name="managed-object-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value"
0N/A select="adm:default-behavior/adm:inherited/adm:relative/@managed-object-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="property-name"
0N/A select="adm:default-behavior/adm:inherited/adm:relative/@property-name" />
0N/A <xsl:variable name="offset"
0N/A select="adm:default-behavior/adm:inherited/adm:relative/@offset" />
0N/A <xsl:value-of
0N/A select="concat($managed-object-name, 'CfgDefn.getInstance(), &quot;', $property-name, '&quot;, ', $offset, ');&#xa;')" />
0N/A <xsl:value-of
0N/A select="' builder.setDefaultBehaviorProvider(provider);&#xa;'" />
0N/A </xsl:when>
0N/A <xsl:when
0N/A test="adm:default-behavior/adm:inherited/adm:absolute">
0N/A <xsl:value-of
0N/A select="concat(' DefaultBehaviorProvider&lt;', $value-type,'&gt; provider = ',
0N/A 'new AbsoluteInheritedDefaultBehaviorProvider&lt;', $value-type,'&gt;(')" />
0N/A <xsl:variable name="property-name"
0N/A select="adm:default-behavior/adm:inherited/adm:absolute/@property-name" />
0N/A <xsl:variable name="path"
0N/A select="adm:default-behavior/adm:inherited/adm:absolute/@path" />
0N/A <xsl:value-of
0N/A select="concat('&quot;', $path, '&quot;, &quot;', $property-name, '&quot;);&#xa;')" />
0N/A <xsl:value-of
0N/A select="' builder.setDefaultBehaviorProvider(provider);&#xa;'" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:message terminate="yes">
0N/A <xsl:value-of
0N/A select="concat('Unrecognized default behavior type for property &quot;', @name,
0N/A '&quot;.')" />
0N/A </xsl:message>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
864N/A <xsl:call-template name="get-property-definition-ctor" />
864N/A <xsl:value-of
0N/A select="concat(' PD_', $java-prop-name, ' = builder.getInstance();&#xa;')" />
0N/A <xsl:value-of
0N/A select="concat(' INSTANCE.registerPropertyDefinition(PD_', $java-prop-name, ');&#xa;')" />
0N/A <xsl:call-template name="get-property-definition-post-ctor" />
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate a relation definition declaration.
0N/A -->
0N/A <xsl:template name="generate-relation-declaration">
0N/A <xsl:variable name="relation-name">
0N/A <xsl:choose>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="@name" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-relation-name">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value" select="$relation-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-managed-object-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@managed-object-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' // The &quot;',
0N/A $relation-name,
0N/A '&quot; relation definition.&#xa;',
0N/A ' private static final ')" />
0N/A <xsl:choose>
0N/A <xsl:when test="adm:one-to-one">
0N/A <xsl:text>SingletonRelationDefinition&lt;</xsl:text>
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-zero-or-one">
0N/A <xsl:text>OptionalRelationDefinition&lt;</xsl:text>
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:text>InstantiableRelationDefinition&lt;</xsl:text>
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:message terminate="yes">
0N/A <xsl:value-of
0N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
0N/A </xsl:message>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <xsl:value-of
0N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg&gt; RD_', $java-relation-name, ';&#xa;')" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate a relation definition constructor.
0N/A -->
0N/A <xsl:template name="generate-relation-constructor">
0N/A <xsl:variable name="relation-name">
0N/A <xsl:choose>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="@name" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-relation-name">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value" select="$relation-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-managed-object-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@managed-object-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-relation-builder-type">
0N/A <xsl:choose>
0N/A <xsl:when test="adm:one-to-one">
0N/A <xsl:text>SingletonRelationDefinition</xsl:text>
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-zero-or-one">
0N/A <xsl:text>OptionalRelationDefinition</xsl:text>
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:text>InstantiableRelationDefinition</xsl:text>
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:message terminate="yes">
0N/A <xsl:value-of
0N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
0N/A </xsl:message>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <xsl:value-of
0N/A select="concat('.Builder&lt;', $java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg&gt;')" />
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' // Build the &quot;', $relation-name, '&quot; relation definition.&#xa;',
0N/A ' static {&#xa;',
0N/A ' ', $java-relation-builder-type, ' builder =&#xa;',
0N/A ' new ', $java-relation-builder-type, '(INSTANCE, &quot;', @name, '&quot;, ')" />
0N/A <xsl:if test="adm:one-to-many">
0N/A <xsl:value-of
0N/A select="concat('&quot;', adm:one-to-many/@plural-name, '&quot;, ')" />
0N/A </xsl:if>
0N/A <xsl:value-of
0N/A select="concat($java-managed-object-name, 'CfgDefn.getInstance());&#xa;')" />
0N/A <xsl:if test="adm:one-to-many/@naming-property">
0N/A <xsl:variable name="java-property-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value"
0N/A select="adm:one-to-many/@naming-property" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' builder.setNamingProperty(',
0N/A $java-managed-object-name,
0N/A 'CfgDefn.getInstance().get',
0N/A $java-property-name, 'PropertyDefinition());&#xa;')" />
0N/A </xsl:if>
0N/A <xsl:if test="@hidden='true'">
0N/A <xsl:value-of
0N/A select="' builder.setOption(RelationOption.HIDDEN);&#xa;'" />
0N/A </xsl:if>
0N/A <xsl:value-of
0N/A select="concat(' RD_', $java-relation-name, ' = builder.getInstance();&#xa;')" />
0N/A <xsl:value-of
0N/A select="concat(' INSTANCE.registerRelationDefinition(RD_', $java-relation-name,');&#xa;')" />
0N/A <xsl:value-of select="' }&#xa;'" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate a property definition getter for a locally defined
0N/A or overriden property.
0N/A -->
0N/A <xsl:template name="generate-property-definition-getter">
0N/A <xsl:variable name="java-prop-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-prop-name-constant">
0N/A <xsl:call-template name="name-to-java-constant">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="type">
0N/A <xsl:call-template name="get-property-definition-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="generic-type">
0N/A <xsl:call-template name="get-property-definition-generic-type" />
0N/A </xsl:variable>
0N/A <xsl:variable name="pdtype">
0N/A <xsl:choose>
0N/A <xsl:when test="string-length($generic-type) != 0">
0N/A <xsl:value-of
0N/A select="concat($type, '&lt;', $generic-type, '&gt;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="$type" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * Get the &quot;',
0N/A @name,
0N/A '&quot; property definition.&#xa;')" />
0N/A <xsl:if test="adm:synopsis">
0N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="content" select="adm:synopsis" />
0N/A </xsl:call-template>
0N/A </xsl:if>
0N/A <xsl:if test="adm:description">
0N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
0N/A <xsl:call-template name="add-java-comment">
0N/A <xsl:with-param name="indent-text" select="' *'" />
0N/A <xsl:with-param name="content" select="adm:description" />
0N/A </xsl:call-template>
0N/A </xsl:if>
0N/A <xsl:choose>
0N/A <xsl:when
0N/A test="adm:profile[@name='preprocessor']/admpp:last-defined-in[@name=$this-name and @package=$this-package]">
41N/A <xsl:value-of
41N/A select="concat(' *&#xa;',
41N/A ' * @return Returns the &quot;',
56N/A @name,
56N/A '&quot; property definition.&#xa;',
56N/A ' */&#xa;',
56N/A ' public ',
56N/A $pdtype,
56N/A ' get',
56N/A $java-prop-name,
56N/A 'PropertyDefinition() {&#xa;' ,
65N/A ' return PD_',
65N/A $java-prop-name-constant ,
65N/A ';&#xa;' ,
71N/A ' }&#xa;')" />
211N/A </xsl:when>
71N/A <xsl:otherwise>
71N/A <xsl:value-of
96N/A select="concat(' *&#xa;',
96N/A ' * @return Returns the &quot;',
96N/A @name,
96N/A '&quot; property definition.&#xa;',
96N/A ' */&#xa;',
96N/A ' public ',
96N/A $pdtype,
202N/A ' get',
202N/A $java-prop-name,
202N/A 'PropertyDefinition() {&#xa;' ,
554N/A ' return ',
549N/A $parent-java-class, 'CfgDefn.getInstance().get',
549N/A $java-prop-name,
611N/A 'PropertyDefinition();&#xa;',
611N/A ' }&#xa;')" />
611N/A </xsl:otherwise>
617N/A </xsl:choose>
617N/A </xsl:template>
617N/A <!--
617N/A Generate a relation definition getter.
617N/A -->
617N/A <xsl:template name="generate-relation-definition-getter">
617N/A <xsl:variable name="relation-name">
617N/A <xsl:choose>
617N/A <xsl:when test="adm:one-to-many">
617N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
617N/A </xsl:when>
629N/A <xsl:otherwise>
629N/A <xsl:value-of select="@name" />
629N/A </xsl:otherwise>
629N/A </xsl:choose>
629N/A </xsl:variable>
629N/A <xsl:variable name="java-relation-name">
629N/A <xsl:call-template name="name-to-java">
629N/A <xsl:with-param name="value" select="$relation-name" />
629N/A </xsl:call-template>
629N/A </xsl:variable>
629N/A <xsl:variable name="java-relation-name-constant">
629N/A <xsl:call-template name="name-to-java-constant">
630N/A <xsl:with-param name="value" select="$relation-name" />
630N/A </xsl:call-template>
630N/A </xsl:variable>
717N/A <xsl:value-of
717N/A select="concat(' /**&#xa;',
717N/A ' * Get the &quot;',
741N/A $relation-name,
741N/A '&quot; relation definition.&#xa;',
741N/A ' *&#xa;',
756N/A ' * @return Returns the &quot;',
756N/A $relation-name,
756N/A '&quot; relation definition.&#xa;',
756N/A ' */&#xa;',
756N/A ' public ')" />
756N/A <xsl:choose>
756N/A <xsl:when test="adm:one-to-one">
759N/A <xsl:text>SingletonRelationDefinition&lt;</xsl:text>
759N/A </xsl:when>
759N/A <xsl:when test="adm:one-to-zero-or-one">
759N/A <xsl:text>OptionalRelationDefinition&lt;</xsl:text>
776N/A </xsl:when>
776N/A <xsl:when test="adm:one-to-many">
776N/A <xsl:text>InstantiableRelationDefinition&lt;</xsl:text>
776N/A </xsl:when>
776N/A <xsl:otherwise>
776N/A <xsl:message terminate="yes">
824N/A <xsl:value-of
824N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
824N/A </xsl:message>
824N/A </xsl:otherwise>
824N/A </xsl:choose>
824N/A <xsl:variable name="java-managed-object-name">
824N/A <xsl:call-template name="name-to-java">
824N/A <xsl:with-param name="value" select="@managed-object-name" />
824N/A </xsl:call-template>
849N/A </xsl:variable>
849N/A <xsl:choose>
849N/A <xsl:when
849N/A test="adm:profile[@name='preprocessor']/admpp:last-defined-in[@name=$this-name and @package=$this-package]">
849N/A <xsl:value-of
849N/A select="concat($java-managed-object-name, 'CfgClient,',
849N/A $java-managed-object-name, 'Cfg&gt; get',
849N/A $java-relation-name,
849N/A 'RelationDefinition() {&#xa;' ,
849N/A ' return RD_',
849N/A $java-relation-name-constant,
849N/A ';&#xa;' ,
849N/A ' }&#xa;')" />
849N/A </xsl:when>
849N/A <xsl:otherwise>
849N/A <xsl:value-of
849N/A select="concat($java-managed-object-name, 'CfgClient,',
849N/A $java-managed-object-name, 'Cfg&gt; get',
849N/A $java-relation-name,
849N/A 'RelationDefinition() {&#xa;' ,
849N/A ' return ',
849N/A $parent-java-class, 'CfgDefn.getInstance().get',
849N/A $java-relation-name,
863N/A 'RelationDefinition();&#xa;',
863N/A ' }&#xa;')" />
863N/A </xsl:otherwise>
983N/A </xsl:choose>
1017N/A </xsl:template>
1097N/A <!--
1097N/A Generate client relation methods.
1017N/A -->
1026N/A <xsl:template name="generate-client-relation-methods">
1097N/A <xsl:variable name="name" select="@name" />
1097N/A <xsl:variable name="java-relation-name">
1026N/A <xsl:call-template name="name-to-java">
1026N/A <xsl:with-param name="value" select="$name" />
1097N/A </xsl:call-template>
1097N/A </xsl:variable>
1026N/A <xsl:variable name="java-class-name">
1026N/A <xsl:call-template name="name-to-java">
1097N/A <xsl:with-param name="value" select="@managed-object-name" />
1097N/A </xsl:call-template>
1026N/A </xsl:variable>
1057N/A <xsl:choose>
1057N/A <xsl:when test="adm:one-to-one">
1057N/A <xsl:value-of
1057N/A select="concat(' /**&#xa;',
1057N/A ' * {@inheritDoc}&#xa;',
1057N/A ' */&#xa;',
1057N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()&#xa;',
1057N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
1057N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1057N/A ' AuthorizationException, CommunicationException {&#xa;',
1057N/A ' return impl.getChild(INSTANCE.get', $java-relation-name,'RelationDefinition()).getConfiguration();&#xa;',
1057N/A ' }&#xa;')" />
1057N/A </xsl:when>
1057N/A <xsl:when test="adm:one-to-zero-or-one">
1057N/A <xsl:value-of
1057N/A select="concat(' /**&#xa;',
1057N/A ' * {@inheritDoc}&#xa;',
1057N/A ' */&#xa;',
1057N/A ' public boolean has', $java-relation-name, '() throws ConcurrentModificationException,&#xa;',
1057N/A ' AuthorizationException, CommunicationException {&#xa;',
1057N/A ' return impl.hasChild(INSTANCE.get', $java-relation-name,'RelationDefinition());&#xa;',
1057N/A ' }&#xa;')" />
1097N/A <xsl:text>&#xa;</xsl:text>
1097N/A <xsl:text>&#xa;</xsl:text>
1097N/A <xsl:text>&#xa;</xsl:text>
1097N/A <xsl:value-of
1097N/A select="concat(' /**&#xa;',
1097N/A ' * {@inheritDoc}&#xa;',
1096N/A ' */&#xa;',
1094N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()&#xa;',
1094N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
1094N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1096N/A ' AuthorizationException, CommunicationException {&#xa;',
1094N/A ' return impl.getChild(INSTANCE.get', $java-relation-name,'RelationDefinition()).getConfiguration();&#xa;',
1094N/A ' }&#xa;')" />
1094N/A <xsl:text>&#xa;</xsl:text>
1096N/A <xsl:text>&#xa;</xsl:text>
1094N/A <xsl:text>&#xa;</xsl:text>
1094N/A <xsl:value-of
1094N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
0N/A ' ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, Collection&lt;DefaultBehaviorException&gt; exceptions) {&#xa;',
983N/A ' return impl.createChild(INSTANCE.get', $java-relation-name,'RelationDefinition(), d, exceptions).getConfiguration();&#xa;',
983N/A ' }&#xa;')" />
983N/A <xsl:text>&#xa;</xsl:text>
983N/A <xsl:text>&#xa;</xsl:text>
983N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, '()&#xa;',
0N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
0N/A ' OperationRejectedException, AuthorizationException, CommunicationException {&#xa;',
0N/A ' impl.removeChild(INSTANCE.get', $java-relation-name,'RelationDefinition());&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:variable name="plural-name"
0N/A select="adm:one-to-many/@plural-name" />
0N/A <xsl:variable name="java-relation-plural-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="$plural-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
202N/A ' public String[] list', $java-relation-plural-name, '() throws ConcurrentModificationException,&#xa;',
202N/A ' AuthorizationException, CommunicationException {&#xa;',
0N/A ' return impl.listChildren(INSTANCE.get', $java-relation-plural-name,'RelationDefinition());&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
71N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '(String name)&#xa;',
0N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
0N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
0N/A ' AuthorizationException, CommunicationException {&#xa;',
0N/A ' return impl.getChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), name).getConfiguration();&#xa;',
0N/A ' }&#xa;')" />
600N/A <xsl:text>&#xa;</xsl:text>
600N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
0N/A ' ManagedObjectDefinition&lt;M, ? extends ', $java-class-name,'Cfg&gt; d, String name, Collection&lt;DefaultBehaviorException&gt; exceptions) throws IllegalManagedObjectNameException {&#xa;',
0N/A ' return impl.createChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), d, name, exceptions).getConfiguration();&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
629N/A select="concat(' /**&#xa;',
229N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, '(String name)&#xa;',
0N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
0N/A ' OperationRejectedException, AuthorizationException, CommunicationException {&#xa;',
0N/A ' impl.removeChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), name);&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
824N/A <xsl:message terminate="yes">
824N/A <xsl:value-of
0N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', $name, '&quot;.')" />
0N/A </xsl:message>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:template>
0N/A <!--
0N/A Generate server relation methods.
0N/A -->
0N/A <xsl:template name="generate-server-relation-methods">
0N/A <xsl:variable name="name" select="@name" />
0N/A <xsl:variable name="java-relation-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="$name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-class-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@managed-object-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:choose>
0N/A <xsl:when test="adm:one-to-one">
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ', $java-class-name, 'Cfg get',
0N/A $java-relation-name, '() throws ConfigException {&#xa;',
0N/A ' return impl.getChild(INSTANCE.get', $java-relation-name, 'RelationDefinition()).getConfiguration();&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-zero-or-one">
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public boolean has',
0N/A $java-relation-name, '() {&#xa;',
0N/A ' return impl.hasChild(INSTANCE.get', $java-relation-name, 'RelationDefinition());&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ', $java-class-name, 'Cfg get',
0N/A $java-relation-name, '() throws ConfigException {&#xa;',
0N/A ' return impl.getChild(INSTANCE.get', $java-relation-name, 'RelationDefinition()).getConfiguration();&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void add', $java-relation-name, 'AddListener(&#xa;',
0N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
0N/A ' impl.registerAddListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, 'AddListener(&#xa;',
0N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
0N/A ' impl.deregisterAddListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void add', $java-relation-name, 'DeleteListener(&#xa;',
0N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
0N/A ' impl.registerDeleteListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, 'DeleteListener(&#xa;',
0N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
0N/A ' impl.deregisterDeleteListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:when test="adm:one-to-many">
0N/A <xsl:variable name="plural-name"
0N/A select="adm:one-to-many/@plural-name" />
0N/A <xsl:variable name="java-relation-plural-name">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="$plural-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public String[] list',
0N/A $java-relation-plural-name, '() {&#xa;',
0N/A ' return impl.listChildren(INSTANCE.get', $java-relation-plural-name,'RelationDefinition());&#xa;',
717N/A ' }&#xa;')" />
96N/A <xsl:text>&#xa;</xsl:text>
96N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public ', $java-class-name, 'Cfg get',
0N/A $java-relation-name, '(String name) throws ConfigException {&#xa;',
0N/A ' return impl.getChild(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), name).getConfiguration();&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
824N/A <xsl:text>&#xa;</xsl:text>
824N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void add', $java-relation-name, 'AddListener(&#xa;',
0N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
0N/A ' impl.registerAddListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, 'AddListener(&#xa;',
23N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
23N/A ' impl.deregisterAddListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
23N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void add', $java-relation-name, 'DeleteListener(&#xa;',
0N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
0N/A ' impl.registerDeleteListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;',
0N/A ' public void remove', $java-relation-name, 'DeleteListener(&#xa;',
0N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
0N/A ' impl.deregisterDeleteListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:message terminate="yes">
0N/A <xsl:value-of
0N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', $name, '&quot;.')" />
0N/A </xsl:message>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:template>
0N/A <!--
0N/A Generate change listener registration methods.
0N/A -->
0N/A <xsl:template name="generate-change-listener">
0N/A <!--
0N/A Process this managed object.
0N/A -->
0N/A <xsl:variable name="top-name"
0N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object[last()]/@name" />
0N/A <xsl:call-template name="generate-change-listener-help">
28N/A <xsl:with-param name="top-name" select="$top-name" />
0N/A <xsl:with-param name="name" select="$this-name" />
0N/A </xsl:call-template>
535N/A <!--
759N/A Process parent hierarchy.
0N/A -->
0N/A <xsl:for-each
0N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
0N/A <xsl:call-template name="generate-change-listener-help">
0N/A <xsl:with-param name="top-name" select="$top-name" />
0N/A <xsl:with-param name="name" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:for-each>
0N/A </xsl:template>
0N/A <!--
0N/A Generate a single set of change listener registration methods.
0N/A -->
0N/A <xsl:template name="generate-change-listener-help">
0N/A <xsl:param name="top-name" select="/.." />
0N/A <xsl:param name="name" select="/.." />
0N/A <xsl:variable name="short-name">
0N/A <xsl:choose>
0N/A <xsl:when test="not($top-name) or $top-name = $name">
0N/A <xsl:value-of select="''" />
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:variable name="top-length"
0N/A select="string-length($top-name)" />
0N/A <xsl:variable name="length" select="string-length($name)" />
0N/A <xsl:variable name="diff" select="$length - $top-length" />
0N/A <xsl:value-of select="substring($name, 1, $diff - 1)" />
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:variable>
0N/A <xsl:variable name="java-class">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="$name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:variable name="short-java-class">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="$short-name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
0N/A ' */&#xa;')" />
0N/A <xsl:value-of
0N/A select="concat(' public void add', $short-java-class, 'ChangeListener(&#xa;',
0N/A ' ConfigurationChangeListener&lt;',$java-class,'Cfg&gt; listener) {&#xa;',
0N/A ' impl.registerChangeListener(listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:text>&#xa;</xsl:text>
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * {@inheritDoc}&#xa;',
28N/A ' */&#xa;')" />
560N/A <xsl:value-of
1046N/A select="concat(' public void remove', $short-java-class, 'ChangeListener(&#xa;',
0N/A ' ConfigurationChangeListener&lt;',$java-class,'Cfg&gt; listener) {&#xa;',
0N/A ' impl.deregisterChangeListener(listener);&#xa;',
0N/A ' }&#xa;')" />
0N/A </xsl:template>
0N/A <!--
0N/A Generate import statements for change-listener
0N/A -->
0N/A <xsl:template name="generate-change-listener-import-statements">
0N/A <!--
0N/A Process this managed object.
0N/A -->
0N/A <xsl:element name="import">
0N/A <xsl:value-of
0N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
0N/A </xsl:element>
0N/A <!--
0N/A Process parent hierarchy.
0N/A -->
0N/A <xsl:for-each
0N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
0N/A <xsl:variable name="java-class">
0N/A <xsl:call-template name="name-to-java">
0N/A <xsl:with-param name="value" select="@name" />
0N/A </xsl:call-template>
0N/A </xsl:variable>
0N/A <xsl:element name="import">
0N/A <xsl:value-of
0N/A select="concat(@package, '.server.', $java-class, 'Cfg')" />
0N/A </xsl:element>
0N/A </xsl:for-each>
0N/A </xsl:template>
0N/A <!--
0N/A Generate an enumeration for a locally defined enumerated property.
0N/A -->
0N/A <xsl:template name="generate-enumeration">
0N/A <xsl:value-of
0N/A select="concat(' /**&#xa;',
0N/A ' * Defines the set of permissable values for the &quot;', @name, '&quot; property.&#xa;')" />
0N/A <xsl:if test="adm:synopsis">
0N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
46N/A <xsl:call-template name="add-java-comment">
46N/A <xsl:with-param name="indent-text" select="' *'" />
46N/A <xsl:with-param name="content" select="adm:synopsis" />
46N/A </xsl:call-template>
56N/A </xsl:if>
56N/A <xsl:if test="adm:description">
65N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
56N/A <xsl:call-template name="add-java-comment">
56N/A <xsl:with-param name="indent-text" select="' *'" />
65N/A <xsl:with-param name="content" select="adm:description" />
65N/A </xsl:call-template>
65N/A </xsl:if>
65N/A <xsl:value-of
65N/A select="concat(' */&#xa;',
614N/A ' public static enum ')" />
614N/A <xsl:call-template name="name-to-java">
629N/A <xsl:with-param name="value" select="@name" />
629N/A </xsl:call-template>
630N/A <xsl:value-of select="' {&#xa;'" />
629N/A <xsl:text>&#xa;</xsl:text>
756N/A <xsl:for-each select="adm:syntax/adm:enumeration/adm:value">
756N/A <xsl:sort select="@name" />
629N/A <xsl:value-of select="' /**&#xa;'" />
629N/A <xsl:call-template name="add-java-comment">
629N/A <xsl:with-param name="indent-text" select="' *'" />
741N/A <xsl:with-param name="content" select="adm:synopsis" />
741N/A </xsl:call-template>
741N/A <xsl:value-of select="' */&#xa;'" />
756N/A <xsl:value-of select="' '" />
756N/A <xsl:call-template name="name-to-java-constant">
756N/A <xsl:with-param name="value" select="@name" />
776N/A </xsl:call-template>
776N/A <xsl:value-of select="concat('(&quot;', @name, '&quot;)')" />
776N/A <xsl:choose>
849N/A <xsl:when test="position() != last()">
849N/A <xsl:value-of select="',&#xa;'" />
849N/A <xsl:text>&#xa;</xsl:text>
849N/A <xsl:text>&#xa;</xsl:text>
849N/A <xsl:text>&#xa;</xsl:text>
849N/A </xsl:when>
849N/A <xsl:otherwise>
849N/A <xsl:value-of select="';&#xa;'" />
849N/A </xsl:otherwise>
849N/A </xsl:choose>
849N/A </xsl:for-each>
849N/A <xsl:text>&#xa;</xsl:text>
849N/A <xsl:text>&#xa;</xsl:text>
849N/A <xsl:text>&#xa;</xsl:text>
849N/A <xsl:value-of
849N/A select="' // String representation of the value.&#xa;'" />
849N/A <xsl:value-of select="' private final String name;&#xa;'" />
849N/A <xsl:text>&#xa;</xsl:text>
1017N/A <xsl:text>&#xa;</xsl:text>
1017N/A <xsl:text>&#xa;</xsl:text>
1017N/A <xsl:value-of select="' // Private constructor.&#xa;'" />
1017N/A <xsl:value-of select="' private '" />
1026N/A <xsl:call-template name="name-to-java">
1026N/A <xsl:with-param name="value" select="@name" />
1026N/A </xsl:call-template>
1026N/A <xsl:value-of
1026N/A select="concat('(String name) { this.name = name; }&#xa;',
1026N/A '&#xa;',
1026N/A '&#xa;',
1026N/A '&#xa;',
1026N/A ' /**&#xa;',
1026N/A ' * {@inheritDoc}&#xa;',
1057N/A ' */&#xa;',
1057N/A ' public String toString() { return name; }&#xa;')" />
1057N/A <xsl:text>&#xa;</xsl:text>
1057N/A <xsl:value-of select="' }&#xa;'" />
1057N/A </xsl:template>
1057N/A <!--
1097N/A Main document parsing template.
1097N/A -->
1097N/A <xsl:template match="/">
1097N/A <!-- Perform some initial validation.
1097N/A -->
1097N/A <xsl:for-each select="$this-all-properties">
1097N/A <!--
1097N/A Check that all non-mandatory properties have a default behavior.
1096N/A -->
1094N/A <xsl:if
1094N/A test="not(@mandatory='true') and not(adm:default-behavior)">
1094N/A <xsl:message terminate="yes">
1094N/A <xsl:value-of
0N/A select="concat('No default behavior defined for non-mandatory property &quot;', @name,
'&quot;.')" />
</xsl:message>
</xsl:if>
<!--
Check that all advanced properties are non-mandatory or have a default.
-->
<xsl:if
test="not($this-is-abstract) and @advanced='true' and @mandatory='true'">
<xsl:choose>
<xsl:when test="adm:default-behavior/adm:defined">
<!-- OK -->
</xsl:when>
<xsl:when test="adm:default-behavior/adm:inherited">
<!-- OK -->
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:value-of
select="concat('Property &quot;', @name,
'&quot; is advanced and mandatory but has no default values.')" />
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<!--
Now generate the definition.
-->
<xsl:call-template name="copyright-notice" />
<xsl:value-of
select="concat('package ', $this-package, '.meta;&#xa;')" />
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:call-template name="generate-import-statements">
<xsl:with-param name="imports">
<xsl:if
test="$this-local-properties[@multi-valued='true' or
@read-only='true' or
@monitoring='true' or
@hidden='true' or
@advanced='true' or
@mandatory='true']">
<import>org.opends.server.admin.PropertyOption</import>
</xsl:if>
<xsl:if test="$this-local-properties">
<import>org.opends.server.admin.AdministratorAction</import>
</xsl:if>
<xsl:if test="$this/adm:tag-definition or $this/adm:tag">
<import>org.opends.server.admin.Tag</import>
</xsl:if>
<xsl:if
test="$this-local-properties[adm:default-behavior/adm:undefined or not(adm:default-behavior)]">
<import>
org.opends.server.admin.UndefinedDefaultBehaviorProvider
</import>
</xsl:if>
<xsl:if
test="$this-local-properties/adm:default-behavior/adm:alias">
<import>
org.opends.server.admin.AliasDefaultBehaviorProvider
</import>
</xsl:if>
<xsl:if
test="$this-local-properties/adm:default-behavior/adm:inherited/adm:absolute">
<import>
org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider
</import>
</xsl:if>
<xsl:if
test="$this-local-properties/adm:default-behavior/adm:inherited/adm:relative">
<import>
org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider
</import>
<xsl:for-each
select="$this-local-properties/adm:default-behavior/adm:inherited/adm:relative">
<xsl:if test="@managed-object-package != $this-package">
<xsl:variable name="java-class-name">
<xsl:call-template name="name-to-java">
<xsl:with-param name="value"
select="@managed-object-name" />
</xsl:call-template>
</xsl:variable>
<xsl:element name="import">
<xsl:value-of
select="concat(@managed-object-package, '.meta.', $java-class-name, 'CfgDefn')" />
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if
test="$this-local-properties/adm:default-behavior/adm:defined">
<import>
org.opends.server.admin.DefinedDefaultBehaviorProvider
</import>
<import>
org.opends.server.admin.DefaultBehaviorProvider
</import>
</xsl:if>
<xsl:element name="import">
<xsl:value-of
select="concat($this-package, '.client.', $this-java-class, 'CfgClient')" />
</xsl:element>
<xsl:element name="import">
<xsl:value-of
select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
</xsl:element>
<xsl:for-each select="$this-inherited-properties">
<xsl:call-template name="get-property-java-imports">
<xsl:with-param name="interface" select="'server'" />
</xsl:call-template>
</xsl:for-each>
<xsl:for-each select="$this-all-properties">
<xsl:call-template
name="get-property-definition-java-imports" />
</xsl:for-each>
<xsl:for-each select="$this-all-relations">
<xsl:variable name="java-class-name">
<xsl:call-template name="name-to-java">
<xsl:with-param name="value"
select="@managed-object-name" />
</xsl:call-template>
</xsl:variable>
<xsl:element name="import">
<xsl:value-of
select="concat(@managed-object-package, '.client.', $java-class-name, 'CfgClient')" />
</xsl:element>
<xsl:element name="import">
<xsl:value-of
select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
</xsl:element>
</xsl:for-each>
<xsl:if test="$this-local-relations[@hidden='true']">
<import>org.opends.server.admin.RelationOption</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-many">
<import>
org.opends.server.admin.InstantiableRelationDefinition
</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
<import>
org.opends.server.admin.OptionalRelationDefinition
</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-one">
<import>
org.opends.server.admin.SingletonRelationDefinition
</import>
</xsl:if>
<xsl:choose>
<xsl:when test="$this-is-abstract">
<import>
org.opends.server.admin.AbstractManagedObjectDefinition
</import>
</xsl:when>
<xsl:otherwise>
<import>
org.opends.server.admin.ManagedObjectDefinition
</import>
<import>org.opends.server.admin.PropertyProvider</import>
<import>
org.opends.server.admin.client.MissingMandatoryPropertiesException
</import>
<import>
org.opends.server.admin.ManagedObjectAlreadyExistsException
</import>
<import>
org.opends.server.admin.client.AuthorizationException
</import>
<import>
org.opends.server.admin.client.CommunicationException
</import>
<import>
org.opends.server.admin.client.ConcurrentModificationException
</import>
<import>
org.opends.server.admin.client.OperationRejectedException
</import>
<import>
org.opends.server.admin.client.ManagedObject
</import>
<import>
org.opends.server.admin.server.ServerManagedObject
</import>
<xsl:if test="not($this-is-root)">
<import>
org.opends.server.admin.server.ConfigurationChangeListener
</import>
<xsl:call-template
name="generate-change-listener-import-statements" />
</xsl:if>
<import>org.opends.server.types.DN</import>
<xsl:if test="$this-all-relations">
<import>
org.opends.server.admin.DefinitionDecodingException
</import>
<import>
org.opends.server.admin.ManagedObjectNotFoundException
</import>
<import>
org.opends.server.admin.client.ManagedObjectDecodingException
</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-many">
<import>java.util.Collection</import>
<import>
org.opends.server.admin.client.IllegalManagedObjectNameException
</import>
<import>
org.opends.server.admin.DefaultBehaviorException
</import>
<import>
org.opends.server.admin.server.ConfigurationAddListener
</import>
<import>
org.opends.server.admin.server.ConfigurationDeleteListener
</import>
<import>org.opends.server.config.ConfigException</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
<import>java.util.Collection</import>
<import>
org.opends.server.admin.DefaultBehaviorException
</import>
<import>
org.opends.server.admin.server.ConfigurationAddListener
</import>
<import>
org.opends.server.admin.server.ConfigurationDeleteListener
</import>
<import>org.opends.server.config.ConfigException</import>
</xsl:if>
<xsl:if test="$this-all-relations/adm:one-to-one">
<import>org.opends.server.config.ConfigException</import>
</xsl:if>
<xsl:if test="$this-all-properties[@multi-valued='true']">
<import>java.util.SortedSet</import>
<import>java.util.Collection</import>
</xsl:if>
<xsl:if test="$this-all-properties[@read-only='true']">
<import>
org.opends.server.admin.PropertyIsReadOnlyException
</import>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$this/@extends">
<xsl:if test="$parent-package != $this-package">
<xsl:element name="import">
<xsl:value-of
select="concat($parent-package, '.meta.', $parent-java-class, 'CfgDefn')" />
</xsl:element>
</xsl:if>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:text>&#xa;</xsl:text>
<xsl:call-template name="generate-meta-class-declaration" />
<xsl:text>&#xa;</xsl:text>
<xsl:call-template name="generate-meta-class-body" />
<xsl:text>}&#xa;</xsl:text>
</xsl:template>
</xsl:stylesheet>