metaMO.xsl revision 1389
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 !
1008N/A ! Portions Copyright 2007 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 xmlns:exsl="http://exslt.org/common">
1008N/A <xsl:import href="java-utilities.xsl" />
1008N/A <xsl:import href="preprocessor.xsl" />
1008N/A <xsl:import href="property-types.xsl" />
1008N/A <xsl:output method="text" encoding="us-ascii" />
1008N/A <!--
1008N/A Template for generating the class declaration.
1008N/A -->
1008N/A <xsl:template name="generate-meta-class-declaration">
1008N/A <xsl:value-of select="'/**&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content"
1008N/A select="concat('An interface for querying the ', $this-ufn,
1008N/A ' managed object definition meta information.')" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content" select="$this/adm:synopsis" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="' */&#xa;'" />
1008N/A <xsl:value-of
1008N/A select="concat('public final class ',
1008N/A $this-java-class,
1008N/A 'CfgDefn extends ')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="$this-is-abstract">
1008N/A <xsl:value-of
1008N/A select="concat('AbstractManagedObjectDefinition&lt;',
1008N/A $this-java-class, 'CfgClient, ',
1008N/A $this-java-class, 'Cfg&gt; {&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1008N/A select="concat('ManagedObjectDefinition&lt;',
1008N/A $this-java-class, 'CfgClient, ',
1008N/A $this-java-class, 'Cfg&gt; {&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Template for generating the meta class body.
1008N/A -->
1008N/A <xsl:template name="generate-meta-class-body">
1008N/A <!--
1008N/A Singleton configuration definition instance.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' // The singleton configuration definition instance.&#xa;',
1008N/A ' private static final ',
1008N/A $this-java-class ,
1008N/A 'CfgDefn INSTANCE = new ', $this-java-class, 'CfgDefn();&#xa;')" />
1008N/A <!--
1008N/A Generate enumerations defined by this managed object..
1008N/A -->
1008N/A <xsl:for-each
1008N/A select="$this-local-properties[adm:syntax/adm:enumeration]">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-enumeration" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Generate declarations for properties defined or
1008N/A overridden by this managed object.
1008N/A -->
1008N/A <xsl:for-each select="$this-local-properties">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-declaration" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Generate declarations for relations.
1008N/A -->
1008N/A <xsl:for-each select="$this-local-relations">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-relation-declaration" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Generate constructors for properties defined or
1008N/A overridden by this managed object.
1008N/A -->
1008N/A <xsl:for-each select="$this-local-properties">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-constructor" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Generate constructors for relations.
1008N/A -->
1008N/A <xsl:for-each select="$this-local-relations">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-relation-constructor" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Configuration definition singleton getter.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of select="' /**&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content"
1008N/A select="concat('Get the ', $this-ufn,' configuration definition singleton.')" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="' *&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="indent-text2" select="' * '" />
1008N/A <xsl:with-param name="content"
1008N/A select="concat('@return Returns the ', $this-ufn,
1008N/A ' configuration definition singleton.')" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="' */&#xa;'" />
1008N/A <xsl:value-of
1008N/A select="concat(' public static ',
1008N/A $this-java-class ,
1008N/A 'CfgDefn getInstance() {&#xa;',
1008N/A ' return INSTANCE;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Private constructor.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Private constructor.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' private ',
1008N/A $this-java-class ,
1008N/A 'CfgDefn() {&#xa;')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="boolean($this/@extends)">
1008N/A <xsl:value-of
1008N/A select="concat(' super(&quot;',
1008N/A $this/@name,
1008N/A '&quot;, ',
1008N/A $parent-java-class,
1008N/A 'CfgDefn.getInstance());&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1008N/A select="concat(' super(&quot;',
1008N/A $this/@name,
1008N/A '&quot;, null);&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:value-of select="concat(' }&#xa;')" />
1008N/A <!--
1008N/A Create configuration view factory methods for non-abstract definitions
1008N/A -->
1008N/A <xsl:if test="not($this-is-abstract)">
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <!--
1008N/A Generate configuration client factory method.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ',
1008N/A $this-java-class,
1008N/A 'CfgClient createClientConfiguration(&#xa;',
1008N/A ' ManagedObject&lt;? extends ',
1008N/A $this-java-class,
1008N/A 'CfgClient&gt; impl) {&#xa;',
1008N/A ' return new ',
1008N/A $this-java-class ,
1008N/A 'CfgClientImpl(impl);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <!--
1008N/A Generate configuration server factory method.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ',
1008N/A $this-java-class,
1008N/A 'Cfg createServerConfiguration(&#xa;',
1008N/A ' ServerManagedObject&lt;? extends ',$this-java-class,'Cfg&gt; impl) {&#xa;',
1008N/A ' return new ',
1008N/A $this-java-class ,
1008N/A 'CfgServerImpl(impl);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <!--
1008N/A Generate configuration server class getter..
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public Class&lt;',
1008N/A $this-java-class,
1008N/A 'Cfg&gt; getServerConfigurationClass() {&#xa;',
1008N/A ' return ',
1008N/A $this-java-class ,
1008N/A 'Cfg.class;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:if>
1008N/A <!--
1142N/A Generate property definition getters for all properties.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-properties">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-definition-getter" />
1008N/A </xsl:for-each>
1008N/A <!--
1142N/A Generate relation definition getters for all relations.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-relations">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-relation-definition-getter" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Managed object class implementations.
1008N/A -->
1008N/A <xsl:if test="not($this-is-abstract)">
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-client-impl-class" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-server-impl-class" />
1008N/A </xsl:if>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate managed object client class implementation.
1008N/A -->
1008N/A <xsl:template name="generate-client-impl-class">
1008N/A <!--
1008N/A Declaration.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Managed object client implementation.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' private static class ',
1008N/A $this-java-class ,
1008N/A 'CfgClientImpl implements&#xa; ',
1008N/A $this-java-class ,
1008N/A 'CfgClient {&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <!--
1008N/A Private instance.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' // Private implementation.&#xa;',
1008N/A ' private ManagedObject&lt;? extends ',
1008N/A $this-java-class,
1008N/A 'CfgClient&gt; impl;&#xa;')" />
1008N/A <!--
1008N/A Private constructor.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' // Private constructor.&#xa;',
1008N/A ' private ',
1008N/A $this-java-class,
1008N/A 'CfgClientImpl(&#xa;',
1008N/A ' ManagedObject&lt;? extends ',
1008N/A $this-java-class,
1008N/A 'CfgClient&gt; impl) {&#xa;',
1008N/A ' this.impl = impl;&#xa;',
1089N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Getters/Setters for all properties.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-properties">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-getter">
1008N/A <xsl:with-param name="interface" select="'client'" />
1008N/A </xsl:call-template>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-setter" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Relation methods.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-relations">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-client-relation-methods" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Managed object definition getter.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ManagedObjectDefinition&lt;? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg&gt; definition() {&#xa;',
1008N/A ' return INSTANCE;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Property provider view.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public PropertyProvider properties() {&#xa;',
1008N/A ' return impl;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Commit method.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public void commit() throws ConcurrentModificationException,&#xa;',
1389N/A ' OperationRejectedException, AuthorizationException,&#xa;',
1389N/A ' CommunicationException {&#xa;',
1008N/A ' impl.commit();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of select="' }&#xa;'" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate managed object server class implementation.
1008N/A -->
1008N/A <xsl:template name="generate-server-impl-class">
1008N/A <!--
1008N/A Declaration.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Managed object server implementation.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' private static class ',
1008N/A $this-java-class ,
1008N/A 'CfgServerImpl implements&#xa; ',
1008N/A $this-java-class ,
1008N/A 'Cfg {&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <!--
1008N/A Private instance.
1008N/A -->
1008N/A <xsl:value-of
1008N/A select="concat(' // Private implementation.&#xa;',
1008N/A ' private ServerManagedObject&lt;? extends ', $this-java-class, 'Cfg&gt; impl;&#xa;')" />
1008N/A <!--
1008N/A Private constructor.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' // Private constructor.&#xa;',
1008N/A ' private ',
1008N/A $this-java-class,
1008N/A 'CfgServerImpl(ServerManagedObject&lt;? extends ', $this-java-class, 'Cfg&gt; impl) {&#xa;',
1008N/A ' this.impl = impl;&#xa;',
1089N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Generate all the change listener methods - one for each managed
1008N/A object in the hierarchy.
1008N/A -->
1008N/A <xsl:if test="not($this-is-root)">
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-change-listener" />
1008N/A </xsl:if>
1008N/A <!--
1008N/A Getters/Setters for all properties.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-properties">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-property-getter">
1008N/A <xsl:with-param name="interface" select="'server'" />
1008N/A </xsl:call-template>
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Relation methods.
1008N/A -->
1008N/A <xsl:for-each select="$this-all-relations">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-server-relation-methods" />
1008N/A </xsl:for-each>
1008N/A <!--
1008N/A Configuration definition getter.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ManagedObjectDefinition&lt;? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg&gt; definition() {&#xa;',
1008N/A ' return INSTANCE;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Property provider view.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public PropertyProvider properties() {&#xa;',
1008N/A ' return impl;&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <!--
1008N/A Configuration entry DN getter.
1008N/A -->
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public DN dn() {&#xa;',
1008N/A ' return impl.getDN();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of select="' }&#xa;'" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a property definition constructor.
1008N/A -->
1008N/A <xsl:template name="generate-property-declaration">
1008N/A <xsl:variable name="java-prop-name">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="@name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="type">
1008N/A <xsl:call-template name="get-property-definition-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="generic-type">
1008N/A <xsl:call-template name="get-property-definition-generic-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="pdtype">
1008N/A <xsl:choose>
1008N/A <xsl:when test="string-length($generic-type) != 0">
1008N/A <xsl:value-of
1008N/A select="concat($type, '&lt;', $generic-type, '&gt;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="$type" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' // The &quot;',
1008N/A @name,
1008N/A '&quot; property definition.&#xa;',
1008N/A ' private static final ', $pdtype, ' PD_', $java-prop-name, ';&#xa;')" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a property definition constructor.
1008N/A -->
1008N/A <xsl:template name="generate-property-constructor">
1008N/A <xsl:variable name="java-prop-name">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="@name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="type">
1008N/A <xsl:call-template name="get-property-definition-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="generic-type">
1008N/A <xsl:call-template name="get-property-definition-generic-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="value-type">
1008N/A <xsl:call-template name="get-property-java-type" />
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' // Build the &quot;', @name, '&quot; property definition.&#xa;',
1008N/A ' static {&#xa;')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="string-length($generic-type) != 0">
1008N/A <xsl:value-of
1140N/A select="concat(' ', $type, '.Builder&lt;', $generic-type, '&gt; builder = ', $type, '.createBuilder(INSTANCE, &quot;',@name, '&quot;);&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1140N/A select="concat(' ', $type, '.Builder builder = ', $type, '.createBuilder(INSTANCE, &quot;',@name, '&quot;);&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:if test="string(@multi-valued) = 'true'">
1008N/A <xsl:value-of
1008N/A select="' builder.setOption(PropertyOption.MULTI_VALUED);&#xa;'" />
1008N/A </xsl:if>
1008N/A <xsl:if test="string(@read-only) = 'true'">
1008N/A <xsl:value-of
1008N/A select="' builder.setOption(PropertyOption.READ_ONLY);&#xa;'" />
1008N/A </xsl:if>
1008N/A <xsl:if
1008N/A test="adm:requires-admin-action/adm:server-restart|adm:requires-admin-action/adm:component-restart|adm:requires-admin-action/adm:other">
1008N/A <xsl:value-of
1008N/A select="' builder.setOption(PropertyOption.REQUIRES_ADMIN_ACTION);&#xa;'" />
1008N/A </xsl:if>
1008N/A <xsl:if test="string(@mandatory) = 'true'">
1008N/A <xsl:value-of
1008N/A select="' builder.setOption(PropertyOption.MANDATORY);&#xa;'" />
1008N/A </xsl:if>
1008N/A <xsl:if test="string(@hidden) = 'true'">
1008N/A <xsl:value-of
1008N/A select="' builder.setOption(PropertyOption.HIDDEN);&#xa;'" />
1008N/A </xsl:if>
1008N/A <xsl:choose>
1008N/A <xsl:when test="string(@mandatory) = 'true'">
1008N/A <xsl:value-of
1008N/A select="concat(' builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider&lt;', $value-type,'&gt;());&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:if test="not(adm:default-behavior)">
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('No default behavior defined for non-mandatory property &quot;', @name,
1008N/A '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:if>
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:default-behavior/adm:undefined">
1008N/A <xsl:value-of
1008N/A select="concat(' builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider&lt;', $value-type,'&gt;());&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:default-behavior/adm:alias">
1008N/A <xsl:value-of
1140N/A select="concat(' builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider&lt;', $value-type,'&gt;(INSTANCE, &quot;', @name, '&quot;));&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:default-behavior/adm:defined">
1008N/A <xsl:value-of
1008N/A select="concat(' DefaultBehaviorProvider&lt;', $value-type,'&gt; provider = ',
1008N/A 'new DefinedDefaultBehaviorProvider&lt;', $value-type,'&gt;(')" />
1008N/A <xsl:for-each
1008N/A select="adm:default-behavior/adm:defined/adm:value">
1008N/A <xsl:value-of
1008N/A select="concat('&quot;', normalize-space(), '&quot;')" />
1008N/A <xsl:if test="position() != last()">
1008N/A <xsl:value-of select="', '" />
1008N/A </xsl:if>
1008N/A </xsl:for-each>
1008N/A <xsl:value-of select="');&#xa;'" />
1008N/A <xsl:value-of
1008N/A select="' builder.setDefaultBehaviorProvider(provider);&#xa;'" />
1008N/A </xsl:when>
1008N/A <xsl:when
1008N/A test="adm:default-behavior/adm:inherited/adm:relative">
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Relative inherited property defaults not yet implemented (property &quot;', @name,
1008N/A '&quot;).')" />
1008N/A </xsl:message>
1008N/A </xsl:when>
1008N/A <xsl:when
1008N/A test="adm:default-behavior/adm:inherited/adm:absolute">
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Absolute inherited property defaults not yet implemented (property &quot;', @name,
1008N/A '&quot;).')" />
1008N/A </xsl:message>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unrecognized default behavior type for property &quot;', @name,
1008N/A '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:call-template name="get-property-definition-ctor" />
1008N/A <xsl:value-of
1008N/A select="concat(' PD_', $java-prop-name, ' = builder.getInstance();&#xa;')" />
1008N/A <xsl:value-of
1008N/A select="concat(' INSTANCE.registerPropertyDefinition(PD_', $java-prop-name, ');&#xa;')" />
1008N/A <xsl:value-of select="' }&#xa;'" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a relation definition declaration.
1008N/A -->
1008N/A <xsl:template name="generate-relation-declaration">
1008N/A <xsl:variable name="relation-name">
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="@name" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-relation-name">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="$relation-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-managed-object-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' // The &quot;',
1008N/A $relation-name,
1008N/A '&quot; relation definition.&#xa;',
1008N/A ' private static final ')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-one">
1008N/A <xsl:text>SingletonRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-zero-or-one">
1008N/A <xsl:text>OptionalRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:text>InstantiableRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:value-of
1008N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg&gt; RD_', $java-relation-name, ';&#xa;')" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a relation definition constructor.
1008N/A -->
1008N/A <xsl:template name="generate-relation-constructor">
1008N/A <xsl:variable name="relation-name">
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="@name" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-relation-name">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="$relation-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-managed-object-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' // Build the &quot;', $relation-name, '&quot; relation definition.&#xa;',
1008N/A ' static {&#xa;',
1008N/A ' RD_', $java-relation-name, ' = new ')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-one">
1008N/A <xsl:text>SingletonRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-zero-or-one">
1008N/A <xsl:text>OptionalRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:text>InstantiableRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:value-of
1008N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg&gt;(&#xa;',
1008N/A ' INSTANCE, &quot;', @name, '&quot;, ')" />
1008N/A <xsl:if test="adm:one-to-many">
1008N/A <xsl:value-of
1008N/A select="concat('&quot;', adm:one-to-many/@plural-name, '&quot;, ')" />
1008N/A </xsl:if>
1008N/A <xsl:value-of
1008N/A select="concat($java-managed-object-name, 'CfgDefn.getInstance());&#xa;')" />
1008N/A <xsl:value-of
1008N/A select="concat(' INSTANCE.registerRelationDefinition(RD_', $java-relation-name,');&#xa;')" />
1008N/A <xsl:value-of select="' }&#xa;'" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a property definition getter for a locally defined
1008N/A or overriden property.
1008N/A -->
1008N/A <xsl:template name="generate-property-definition-getter">
1008N/A <xsl:variable name="java-prop-name">
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:variable>
1008N/A <xsl:variable name="java-prop-name-constant">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="@name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="type">
1008N/A <xsl:call-template name="get-property-definition-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="generic-type">
1008N/A <xsl:call-template name="get-property-definition-generic-type" />
1008N/A </xsl:variable>
1008N/A <xsl:variable name="pdtype">
1008N/A <xsl:choose>
1008N/A <xsl:when test="string-length($generic-type) != 0">
1008N/A <xsl:value-of
1008N/A select="concat($type, '&lt;', $generic-type, '&gt;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="$type" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Get the &quot;',
1008N/A @name,
1008N/A '&quot; property definition.&#xa;')" />
1008N/A <xsl:if test="adm:synopsis">
1008N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content" select="adm:synopsis" />
1008N/A </xsl:call-template>
1008N/A </xsl:if>
1008N/A <xsl:if test="adm:description">
1008N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content" select="adm:description" />
1008N/A </xsl:call-template>
1008N/A </xsl:if>
1008N/A <xsl:choose>
1008N/A <xsl:when
1008N/A test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
1008N/A <xsl:value-of
1008N/A select="concat(' *&#xa;',
1008N/A ' * @return Returns the &quot;',
1008N/A @name,
1008N/A '&quot; property definition.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ',
1008N/A $pdtype,
1008N/A ' get',
1008N/A $java-prop-name,
1008N/A 'PropertyDefinition() {&#xa;' ,
1008N/A ' return PD_',
1008N/A $java-prop-name-constant ,
1008N/A ';&#xa;' ,
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1008N/A select="concat(' *&#xa;',
1008N/A ' * @return Returns the &quot;',
1008N/A @name,
1008N/A '&quot; property definition.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ',
1008N/A $pdtype,
1008N/A ' get',
1008N/A $java-prop-name,
1008N/A 'PropertyDefinition() {&#xa;' ,
1008N/A ' return ',
1008N/A $parent-java-class, 'CfgDefn.getInstance().get',
1008N/A $java-prop-name,
1008N/A 'PropertyDefinition();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a relation definition getter.
1008N/A -->
1008N/A <xsl:template name="generate-relation-definition-getter">
1008N/A <xsl:variable name="relation-name">
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:value-of select="adm:one-to-many/@plural-name" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="@name" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-relation-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="$relation-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-relation-name-constant">
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="$relation-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Get the &quot;',
1008N/A $relation-name,
1008N/A '&quot; relation definition.&#xa;',
1008N/A ' *&#xa;',
1008N/A ' * @return Returns the &quot;',
1008N/A $relation-name,
1008N/A '&quot; relation definition.&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-one">
1008N/A <xsl:text>SingletonRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-zero-or-one">
1008N/A <xsl:text>OptionalRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:text>InstantiableRelationDefinition&lt;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', @name, '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:variable name="java-managed-object-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:choose>
1008N/A <xsl:when
1008N/A test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
1008N/A <xsl:value-of
1008N/A select="concat($java-managed-object-name, 'CfgClient,',
1008N/A $java-managed-object-name, 'Cfg&gt; get',
1008N/A $java-relation-name,
1008N/A 'RelationDefinition() {&#xa;' ,
1008N/A ' return RD_',
1008N/A $java-relation-name-constant,
1008N/A ';&#xa;' ,
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1008N/A select="concat($java-managed-object-name, 'CfgClient,',
1008N/A $java-managed-object-name, 'Cfg&gt; get',
1008N/A $java-relation-name,
1008N/A 'RelationDefinition() {&#xa;' ,
1008N/A ' return ',
1008N/A $parent-java-class, 'CfgDefn.getInstance().get',
1008N/A $java-relation-name,
1008N/A 'RelationDefinition();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a property value getter.
1008N/A -->
1008N/A <xsl:template name="generate-property-getter">
1008N/A <xsl:param name="interface" select="/.." />
1008N/A <xsl:variable name="java-prop-name">
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:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="string(@multi-valued) != 'true'">
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:default-behavior/adm:defined">
1089N/A <!--
1008N/A The method is guaranteed to return a value since there is a
1008N/A well-defined default value.
1008N/A -->
1008N/A <xsl:call-template name="get-property-java-primitive-type" />
1008N/A </xsl:when>
1008N/A <xsl:when
1008N/A test="$interface = 'server' and @mandatory = 'true'">
1089N/A <!--
1008N/A The method is guaranteed to return a value in the server interface, but
1008N/A not necessarily in the client, since the mandatory property might not
1008N/A have been created yet.
1008N/A -->
1008N/A <xsl:call-template name="get-property-java-primitive-type" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:call-template name="get-property-java-type" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="'SortedSet&lt;'" />
1008N/A <xsl:call-template name="get-property-java-type" />
1008N/A <xsl:value-of select="'&gt;'" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:syntax/adm:boolean">
1008N/A <xsl:value-of select="' is'" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="' get'" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:choose>
1008N/A <xsl:when test="string(@multi-valued) != 'true'">
1008N/A <xsl:value-of
1008N/A select="concat($java-prop-name, '() {&#xa;',
1008N/A ' return impl.getPropertyValue',
1008N/A '(INSTANCE.get', $java-prop-name ,
1008N/A 'PropertyDefinition());&#xa;' ,
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of
1008N/A select="concat($java-prop-name, '() {&#xa;',
1008N/A ' return impl.getPropertyValues',
1008N/A '(INSTANCE.get', $java-prop-name ,
1008N/A 'PropertyDefinition());&#xa;' ,
1008N/A ' }&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a property value setter.
1008N/A -->
1008N/A <xsl:template name="generate-property-setter">
1008N/A <xsl:if test="string(@read-only) != 'true'">
1008N/A <xsl:variable name="java-prop-name">
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:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void set',
1008N/A $java-prop-name ,
1008N/A '(')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="string(@multi-valued) != 'true'">
1008N/A <xsl:choose>
1008N/A <xsl:when test="@mandatory = 'true'">
1008N/A <xsl:call-template
1008N/A name="get-property-java-primitive-type" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:call-template name="get-property-java-type" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:value-of
1008N/A select="concat(' value) {&#xa;' ,
1008N/A ' impl.setPropertyValue(INSTANCE.get',
1008N/A $java-prop-name ,
1008N/A 'PropertyDefinition(), value);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="'Collection&lt;'" />
1008N/A <xsl:call-template name="get-property-java-type" />
1008N/A <xsl:value-of
1008N/A select="concat('&gt; values) {&#xa;' ,
1008N/A ' impl.setPropertyValues(INSTANCE.get',
1008N/A $java-prop-name ,
1008N/A 'PropertyDefinition(), values);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:if>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate client relation methods.
1008N/A -->
1008N/A <xsl:template name="generate-client-relation-methods">
1008N/A <xsl:variable name="name" select="@name" />
1008N/A <xsl:variable name="java-relation-name">
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:variable>
1008N/A <xsl:variable name="java-class-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-one">
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()&#xa;',
1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-name,'RelationDefinition()).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-zero-or-one">
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public boolean has', $java-relation-name, '() throws ConcurrentModificationException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.hasChild(INSTANCE.get', $java-relation-name,'RelationDefinition());&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()&#xa;',
1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-name,'RelationDefinition()).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
1389N/A ' ManagedObjectDefinition&lt;M, ?&gt; d, PropertyProvider p)&#xa;',
1389N/A ' throws ManagedObjectDecodingException, ManagedObjectAlreadyExistsException,&#xa;',
1389N/A ' ConcurrentModificationException, OperationRejectedException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.createChild(INSTANCE.get', $java-relation-name,'RelationDefinition(), d, p).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public void remove', $java-relation-name, '()&#xa;',
1389N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1389N/A ' OperationRejectedException, AuthorizationException, CommunicationException {&#xa;',
1008N/A ' impl.removeChild(INSTANCE.get', $java-relation-name,'RelationDefinition());&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:variable name="plural-name"
1008N/A select="adm:one-to-many/@plural-name" />
1008N/A <xsl:variable name="java-relation-plural-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="$plural-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public String[] list', $java-relation-plural-name, '() throws ConcurrentModificationException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.listChildren(INSTANCE.get', $java-relation-plural-name,'RelationDefinition());&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '(String name)&#xa;',
1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,&#xa;',
1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), name).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public &lt;M extends ', $java-class-name, 'CfgClient&gt; M create', $java-relation-name, '(&#xa;',
1389N/A ' ManagedObjectDefinition&lt;M, ?&gt; d, String name, PropertyProvider p)&#xa;',
1389N/A ' throws ManagedObjectDecodingException, ManagedObjectAlreadyExistsException,&#xa;',
1389N/A ' ConcurrentModificationException, OperationRejectedException,&#xa;',
1389N/A ' AuthorizationException, CommunicationException {&#xa;',
1008N/A ' return impl.createChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), d, name, p).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1389N/A ' public void remove', $java-relation-name, '(String name)&#xa;',
1389N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,&#xa;',
1389N/A ' OperationRejectedException, AuthorizationException, CommunicationException {&#xa;',
1008N/A ' impl.removeChild(INSTANCE.get', $java-relation-plural-name,'RelationDefinition(), name);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', $name, '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate server relation methods.
1008N/A -->
1008N/A <xsl:template name="generate-server-relation-methods">
1008N/A <xsl:variable name="name" select="@name" />
1008N/A <xsl:variable name="java-relation-name">
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:variable>
1008N/A <xsl:variable name="java-class-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:choose>
1008N/A <xsl:when test="adm:one-to-one">
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ', $java-class-name, 'Cfg get',
1008N/A $java-relation-name, '() throws ConfigException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-name, 'RelationDefinition()).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-zero-or-one">
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public boolean has',
1008N/A $java-relation-name, '() {&#xa;',
1008N/A ' return impl.hasChild(INSTANCE.get', $java-relation-name, 'RelationDefinition());&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ', $java-class-name, 'Cfg get',
1008N/A $java-relation-name, '() throws ConfigException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-name, 'RelationDefinition()).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void add', $java-relation-name, 'AddListener(&#xa;',
1008N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
1008N/A ' impl.registerAddListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void remove', $java-relation-name, 'AddListener(&#xa;',
1008N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.deregisterAddListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void add', $java-relation-name, 'DeleteListener(&#xa;',
1008N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
1008N/A ' impl.registerDeleteListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void remove', $java-relation-name, 'DeleteListener(&#xa;',
1008N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.deregisterDeleteListener(INSTANCE.get', $java-relation-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:when test="adm:one-to-many">
1008N/A <xsl:variable name="plural-name"
1008N/A select="adm:one-to-many/@plural-name" />
1008N/A <xsl:variable name="java-relation-plural-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="$plural-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public String[] list',
1008N/A $java-relation-plural-name, '() {&#xa;',
1008N/A ' return impl.listChildren(INSTANCE.get', $java-relation-plural-name,'RelationDefinition());&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public ', $java-class-name, 'Cfg get',
1008N/A $java-relation-name, '(String name) throws ConfigException {&#xa;',
1008N/A ' return impl.getChild(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), name).getConfiguration();&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void add', $java-relation-name, 'AddListener(&#xa;',
1008N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
1008N/A ' impl.registerAddListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void remove', $java-relation-name, 'AddListener(&#xa;',
1008N/A ' ConfigurationAddListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.deregisterAddListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void add', $java-relation-name, 'DeleteListener(&#xa;',
1008N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) throws ConfigException {&#xa;',
1008N/A ' impl.registerDeleteListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public void remove', $java-relation-name, 'DeleteListener(&#xa;',
1008N/A ' ConfigurationDeleteListener&lt;', $java-class-name,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.deregisterDeleteListener(INSTANCE.get', $java-relation-plural-name, 'RelationDefinition(), listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:message terminate="yes">
1008N/A <xsl:value-of
1008N/A select="concat('Unknown relation type &quot;', local-name(*), '&quot; in relation &quot;', $name, '&quot;.')" />
1008N/A </xsl:message>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate change listener registration methods.
1008N/A -->
1008N/A <xsl:template name="generate-change-listener">
1008N/A <!--
1008N/A Process this managed object.
1008N/A -->
1008N/A <xsl:variable name="top-name"
1008N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object[last()]/@name" />
1008N/A <xsl:call-template name="generate-change-listener-help">
1008N/A <xsl:with-param name="top-name" select="$top-name" />
1008N/A <xsl:with-param name="name" select="$this-name" />
1008N/A </xsl:call-template>
1008N/A <!--
1008N/A Process parent hierarchy.
1008N/A -->
1008N/A <xsl:for-each
1008N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
1008N/A <xsl:call-template name="generate-change-listener-help">
1008N/A <xsl:with-param name="top-name" select="$top-name" />
1008N/A <xsl:with-param name="name" select="@name" />
1008N/A </xsl:call-template>
1008N/A </xsl:for-each>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate a single set of change listener registration methods.
1008N/A -->
1008N/A <xsl:template name="generate-change-listener-help">
1008N/A <xsl:param name="top-name" select="/.." />
1008N/A <xsl:param name="name" select="/.." />
1008N/A <xsl:variable name="short-name">
1008N/A <xsl:choose>
1008N/A <xsl:when test="not($top-name) or $top-name = $name">
1008N/A <xsl:value-of select="''" />
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:variable name="top-length"
1008N/A select="string-length($top-name)" />
1008N/A <xsl:variable name="length" select="string-length($name)" />
1008N/A <xsl:variable name="diff" select="$length - $top-length" />
1008N/A <xsl:value-of select="substring($name, 1, $diff - 1)" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:variable>
1008N/A <xsl:variable name="java-class">
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:variable>
1008N/A <xsl:variable name="short-java-class">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value" select="$short-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;')" />
1008N/A <xsl:value-of
1008N/A select="concat(' public void add', $short-java-class, 'ChangeListener(&#xa;',
1008N/A ' ConfigurationChangeListener&lt;',$java-class,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.registerChangeListener(listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;')" />
1008N/A <xsl:value-of
1008N/A select="concat(' public void remove', $short-java-class, 'ChangeListener(&#xa;',
1008N/A ' ConfigurationChangeListener&lt;',$java-class,'Cfg&gt; listener) {&#xa;',
1008N/A ' impl.deregisterChangeListener(listener);&#xa;',
1008N/A ' }&#xa;')" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate import statements for change-listener
1008N/A -->
1008N/A <xsl:template name="generate-change-listener-import-statements">
1008N/A <!--
1008N/A Process this managed object.
1008N/A -->
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
1008N/A </xsl:element>
1008N/A <!--
1008N/A Process parent hierarchy.
1008N/A -->
1008N/A <xsl:for-each
1008N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
1008N/A <xsl:variable name="java-class">
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:variable>
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat(@package, '.server.', $java-class, 'Cfg')" />
1008N/A </xsl:element>
1008N/A </xsl:for-each>
1008N/A </xsl:template>
1008N/A <!--
1008N/A Generate an enumeration for a locally defined enumerated property.
1008N/A -->
1008N/A <xsl:template name="generate-enumeration">
1008N/A <xsl:value-of
1008N/A select="concat(' /**&#xa;',
1008N/A ' * Defines the set of permissable values for the &quot;', @name, '&quot; property.&#xa;')" />
1008N/A <xsl:if test="adm:synopsis">
1008N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content" select="adm:synopsis" />
1008N/A </xsl:call-template>
1008N/A </xsl:if>
1008N/A <xsl:if test="adm:description">
1008N/A <xsl:value-of select="' * &lt;p&gt;&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1008N/A <xsl:with-param name="content" select="adm:description" />
1008N/A </xsl:call-template>
1008N/A </xsl:if>
1008N/A <xsl:value-of
1008N/A select="concat(' */&#xa;',
1008N/A ' public static enum ')" />
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:value-of select="' {&#xa;'" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:for-each select="adm:syntax/adm:enumeration/adm:value">
1008N/A <xsl:sort select="@name" />
1008N/A <xsl:value-of select="' /**&#xa;'" />
1008N/A <xsl:call-template name="add-java-comment">
1008N/A <xsl:with-param name="indent-text" select="' *'" />
1141N/A <xsl:with-param name="content" select="adm:synopsis" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="' */&#xa;'" />
1008N/A <xsl:value-of select="' '" />
1008N/A <xsl:call-template name="name-to-java-constant">
1008N/A <xsl:with-param name="value" select="@name" />
1008N/A </xsl:call-template>
1008N/A <xsl:value-of select="concat('(&quot;', @name, '&quot;)')" />
1008N/A <xsl:choose>
1008N/A <xsl:when test="position() != last()">
1008N/A <xsl:value-of select="',&#xa;'" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <xsl:value-of select="';&#xa;'" />
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A </xsl:for-each>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of
1008N/A select="' // String representation of the value.&#xa;'" />
1008N/A <xsl:value-of select="' private final String name;&#xa;'" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of select="' // Private constructor.&#xa;'" />
1008N/A <xsl:value-of select="' private '" />
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:value-of
1008N/A select="concat('(String name) { this.name = name; }&#xa;',
1008N/A '&#xa;',
1008N/A '&#xa;',
1008N/A '&#xa;',
1008N/A ' /**&#xa;',
1008N/A ' * {@inheritDoc}&#xa;',
1008N/A ' */&#xa;',
1008N/A ' public String toString() { return name; }&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:value-of select="' }&#xa;'" />
1008N/A </xsl:template>
1008N/A <!--
1008N/A Main document parsing template.
1008N/A -->
1008N/A <xsl:template match="/">
1008N/A <xsl:call-template name="copyright-notice" />
1008N/A <xsl:value-of
1008N/A select="concat('package ', $this-package, '.meta;&#xa;')" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-import-statements">
1008N/A <xsl:with-param name="imports">
1008N/A <xsl:if
1008N/A test="$this-local-properties[@multi-valued='true' or
1008N/A @read-only='true' or
1008N/A @hidden='true' or
1008N/A @mandatory='true']">
1008N/A <import>org.opends.server.admin.PropertyOption</import>
1008N/A </xsl:if>
1008N/A <xsl:if
1008N/A test="$this-local-properties/adm:default-behavior/adm:undefined
1008N/A | $this-local-properties[@mandatory='true']">
1008N/A <import>
1008N/A org.opends.server.admin.UndefinedDefaultBehaviorProvider
1008N/A </import>
1008N/A </xsl:if>
1008N/A <xsl:if
1008N/A test="$this-local-properties/adm:default-behavior/adm:alias">
1008N/A <import>
1008N/A org.opends.server.admin.AliasDefaultBehaviorProvider
1008N/A </import>
1008N/A </xsl:if>
1008N/A <xsl:if
1008N/A test="$this-local-properties/adm:default-behavior/adm:defined">
1008N/A <import>
1008N/A org.opends.server.admin.DefinedDefaultBehaviorProvider
1008N/A </import>
1008N/A <import>
1008N/A org.opends.server.admin.DefaultBehaviorProvider
1008N/A </import>
1008N/A </xsl:if>
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat($this-package, '.client.', $this-java-class, 'CfgClient')" />
1008N/A </xsl:element>
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
1008N/A </xsl:element>
1008N/A <xsl:for-each select="$this-inherited-properties">
1008N/A <xsl:call-template name="get-property-java-imports" />
1008N/A </xsl:for-each>
1008N/A <xsl:for-each select="$this-all-properties">
1008N/A <xsl:call-template
1008N/A name="get-property-definition-java-imports" />
1008N/A </xsl:for-each>
1008N/A <xsl:for-each select="$this-all-relations">
1008N/A <xsl:variable name="java-class-name">
1008N/A <xsl:call-template name="name-to-java">
1008N/A <xsl:with-param name="value"
1008N/A select="@managed-object-name" />
1008N/A </xsl:call-template>
1008N/A </xsl:variable>
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat(@managed-object-package, '.client.', $java-class-name, 'CfgClient')" />
1008N/A </xsl:element>
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
1008N/A </xsl:element>
1008N/A </xsl:for-each>
1142N/A <xsl:if test="$this-all-relations/adm:one-to-many">
1142N/A <import>
1142N/A org.opends.server.admin.InstantiableRelationDefinition
1142N/A </import>
1142N/A </xsl:if>
1142N/A <xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
1142N/A <import>
1142N/A org.opends.server.admin.OptionalRelationDefinition
1142N/A </import>
1142N/A </xsl:if>
1142N/A <xsl:if test="$this-all-relations/adm:one-to-one">
1142N/A <import>
1142N/A org.opends.server.admin.SingletonRelationDefinition
1142N/A </import>
1142N/A </xsl:if>
1008N/A <xsl:choose>
1008N/A <xsl:when test="$this-is-abstract">
1008N/A <import>
1008N/A org.opends.server.admin.AbstractManagedObjectDefinition
1008N/A </import>
1008N/A </xsl:when>
1008N/A <xsl:otherwise>
1008N/A <import>
1008N/A org.opends.server.admin.ManagedObjectDefinition
1008N/A </import>
1008N/A <import>org.opends.server.admin.PropertyProvider</import>
1389N/A <import>
1389N/A org.opends.server.admin.client.AuthorizationException
1389N/A </import>
1389N/A <import>
1389N/A org.opends.server.admin.client.CommunicationException
1389N/A </import>
1389N/A <import>
1389N/A org.opends.server.admin.client.ConcurrentModificationException
1389N/A </import>
1389N/A <import>
1389N/A org.opends.server.admin.client.OperationRejectedException
1389N/A </import>
1008N/A <import>
1008N/A org.opends.server.admin.client.ManagedObject
1008N/A </import>
1008N/A <import>
1008N/A org.opends.server.admin.server.ServerManagedObject
1008N/A </import>
1008N/A <xsl:if test="not($this-is-root)">
1008N/A <import>
1008N/A org.opends.server.admin.server.ConfigurationChangeListener
1008N/A </import>
1008N/A <xsl:call-template
1008N/A name="generate-change-listener-import-statements" />
1008N/A </xsl:if>
1008N/A <import>org.opends.server.types.DN</import>
1389N/A <xsl:if test="$this-all-relations">
1389N/A <import>
1389N/A org.opends.server.admin.DefinitionDecodingException
1389N/A </import>
1389N/A <import>
1389N/A org.opends.server.admin.ManagedObjectNotFoundException
1389N/A </import>
1389N/A <import>
1389N/A org.opends.server.admin.client.ManagedObjectDecodingException
1389N/A </import>
1389N/A </xsl:if>
1008N/A <xsl:if test="$this-all-relations/adm:one-to-many">
1008N/A <import>
1389N/A org.opends.server.admin.ManagedObjectAlreadyExistsException
1389N/A </import>
1389N/A <import>
1008N/A org.opends.server.admin.server.ConfigurationAddListener
1008N/A </import>
1008N/A <import>
1008N/A org.opends.server.admin.server.ConfigurationDeleteListener
1008N/A </import>
1008N/A <import>org.opends.server.config.ConfigException</import>
1008N/A </xsl:if>
1008N/A <xsl:if test="$this-all-relations/adm:one-to-zero-or-one">
1008N/A <import>
1389N/A org.opends.server.admin.ManagedObjectAlreadyExistsException
1389N/A </import>
1389N/A <import>
1008N/A org.opends.server.admin.server.ConfigurationAddListener
1008N/A </import>
1008N/A <import>
1008N/A org.opends.server.admin.server.ConfigurationDeleteListener
1008N/A </import>
1008N/A <import>org.opends.server.config.ConfigException</import>
1008N/A </xsl:if>
1008N/A <xsl:if test="$this-all-relations/adm:one-to-one">
1008N/A <import>org.opends.server.config.ConfigException</import>
1008N/A </xsl:if>
1008N/A <xsl:if test="$this-all-properties[@multi-valued='true']">
1008N/A <import>java.util.SortedSet</import>
1008N/A <import>java.util.Collection</import>
1008N/A </xsl:if>
1008N/A </xsl:otherwise>
1008N/A </xsl:choose>
1008N/A <xsl:if test="$this/@extends">
1008N/A <xsl:if test="$parent-package != $this-package">
1008N/A <xsl:element name="import">
1008N/A <xsl:value-of
1008N/A select="concat($parent-package, '.meta.', $parent-java-class, 'CfgDefn')" />
1008N/A </xsl:element>
1008N/A </xsl:if>
1008N/A </xsl:if>
1008N/A </xsl:with-param>
1008N/A </xsl:call-template>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-meta-class-declaration" />
1008N/A <xsl:text>&#xa;</xsl:text>
1008N/A <xsl:call-template name="generate-meta-class-body" />
1008N/A <xsl:text>}&#xa;</xsl:text>
1008N/A </xsl:template>
1008N/A</xsl:stylesheet>