serverMO.xsl revision 3233
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 ! You can obtain a copy of the license at 0N/A ! See the License for the specific language governing permissions 0N/A ! and limitations under the License. 0N/A ! When distributing Covered Code, include this CDDL HEADER in each 0N/A ! file and include the License file at 0N/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 ! Copyright 2007-2008 Sun Microsystems, Inc. 0N/A <
xsl:
output method="text" encoding="us-ascii" />
0N/A Template for generating the interface declaration. 0N/A <
xsl:
template name="generate-interface-declaration">
0N/A <
xsl:
value-
of select="'/**
'" />
0N/A <
xsl:
call-
template name="add-java-comment">
0N/A <
xsl:
with-
param name="indent-text" select="' *'" />
48N/A <
xsl:
with-
param name="content" 96N/A select="concat('A server-side interface for querying ', $this-ufn, 0N/A </
xsl:
call-
template>
0N/A <
xsl:
value-
of select="' * <p>
'" />
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="' */
'" />
0N/A select="concat('public interface ', 0N/A <
xsl:
when test="boolean($this/@extends)">
0N/A <
xsl:
value-
of select="concat($parent-java-class,'Cfg ')" />
65N/A <
xsl:
value-
of select="'Configuration '" />
65N/A <
xsl:
text>{
</
xsl:
text>
65N/A Template for generating the configuration class getter. 65N/A <
xsl:
template name="generate-configuration-definition-getter">
65N/A select="concat(' /**
', 65N/A ' * Gets the configuration class associated with this ', $this-ufn, '.
', 65N/A ' * @return Returns the configuration class associated with this ', $this-ufn, '.
', 65N/A select="concat(' Class<? extends ', $this-java-class,'Cfg> configurationClass();
')" />
0N/A Template for generating the change listener declaration. 0N/A <
xsl:
template name="generate-change-listener-declaration">
0N/A select="concat(' /**
', 0N/A ' * Register to be notified when this ', $this-ufn,' is changed.
', 0N/A ' * @param listener
', 0N/A ' * The ', $this-ufn,' configuration change listener.
', 0N/A select="concat(' void add', $this-short-java-class, 0N/A 'ChangeListener(ConfigurationChangeListener<', 0N/A $this-java-class,'Cfg> listener);
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Deregister an existing ', $this-ufn,' configuration change listener.
', 0N/A ' * @param listener
', 0N/A ' * The ', $this-ufn,' configuration change listener.
', 0N/A select="concat(' void remove', $this-short-java-class, 0N/A 'ChangeListener(ConfigurationChangeListener<', 0N/A $this-java-class,'Cfg> listener);
')" />
0N/A Template for generating the relation getter declarations. 0N/A <
xsl:
template name="generate-relation-declarations">
0N/A <
xsl:
variable name="name" select="@name" />
0N/A <
xsl:
variable name="ufn">
0N/A <
xsl:
call-
template name="name-to-ufn">
0N/A <
xsl:
with-
param name="value" select="$name" />
0N/A </
xsl:
call-
template>
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 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:
when test="adm:one-to-one">
0N/A select="concat(' /**
', 0N/A ' * Gets the ', $ufn,'.
', 0N/A ' * @return Returns the ', $ufn,'.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the ', $ufn,' could not be found or it could not
', 0N/A ' * be successfully decoded.
', 0N/A select="concat(' ', $java-class-name, 'Cfg get', 0N/A $java-relation-name, '() throws ConfigException;
')" />
0N/A <
xsl:
when test="adm:one-to-zero-or-one">
0N/A select="concat(' /**
', 0N/A ' * Determines whether or not the ', $ufn,' exists.
', 0N/A ' * @return Returns <true> if the ', $ufn,' exists.
', 0N/A select="concat(' boolean has', 0N/A $java-relation-name, '();
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Gets the ', $ufn,' if it is present.
', 0N/A ' * @return Returns the ', $ufn,' if it is present.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the ', $ufn,' does not exist or it could not
', 0N/A ' * be successfully decoded.
', 0N/A select="concat(' ', $java-class-name, 'Cfg get', 0N/A $java-relation-name, '() throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Registers to be notified when the ', $ufn,' is added.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration add listener.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the add listener could not be registered.
', 0N/A select="concat(' void add', $java-relation-name, 0N/A 'AddListener(ConfigurationAddListener<', 0N/A $java-class-name,'Cfg> listener) throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Deregisters an existing ', $ufn,' configuration add listener.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration add listener.
', 0N/A select="concat(' void remove', $java-relation-name, 0N/A 'AddListener(ConfigurationAddListener<', 0N/A $java-class-name,'Cfg> listener);
')" />
71N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
48N/A select="concat(' /**
', 0N/A ' * Registers to be notified the ', $ufn,' is deleted.
', 48N/A ' * @param listener
', 48N/A ' * The ', $ufn,' configuration delete listener.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the delete listener could not be registered.
', 0N/A select="concat(' void add', $java-relation-name, 0N/A 'DeleteListener(ConfigurationDeleteListener<', 0N/A $java-class-name,'Cfg> listener) throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Deregisters an existing ', $ufn,' configuration delete listener.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration delete listener.
', 0N/A select="concat(' void remove', $java-relation-name, 0N/A 'DeleteListener(ConfigurationDeleteListener<', 0N/A $java-class-name,'Cfg> listener);
')" />
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="ufpn">
0N/A <
xsl:
call-
template name="name-to-ufn">
0N/A <
xsl:
with-
param name="value" select="$plural-name" />
0N/A </
xsl:
call-
template>
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 select="concat(' /**
', 0N/A ' * Lists the ', $ufpn, '.
', 0N/A ' * @return Returns an array containing the names of the
', 0N/A ' * ', $ufpn,'.
', 0N/A select="concat(' String[] list', $java-relation-plural-name, '();
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Gets the named ', $ufn,'.
', 9N/A ' * @param name
', 0N/A ' * The name of the ',$ufn,' to retrieve.
', 0N/A ' * @return Returns the named ', $ufn,'.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the ', $ufn,' could not be found or it
', 0N/A ' * could not be successfully decoded.
', 0N/A select="concat(' ', $java-class-name, 'Cfg get', 0N/A $java-relation-name, '(String name) throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Registers to be notified when new ', $ufpn,' are added.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration add listener.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the add listener could not be registered.
', 48N/A select="concat(' void add', $java-relation-name, 0N/A 'AddListener(ConfigurationAddListener<', 0N/A $java-class-name,'Cfg> listener) throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Deregisters an existing ', $ufn,' configuration add listener.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration add listener.
', 0N/A select="concat(' void remove', $java-relation-name, 0N/A 'AddListener(ConfigurationAddListener<', 0N/A $java-class-name,'Cfg> listener);
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Registers to be notified when existing ', $ufpn,' are deleted.
', 0N/A ' * @param listener
', 0N/A ' * The ', $ufn,' configuration delete listener.
', 0N/A ' * @throws ConfigException
', 0N/A ' * If the delete listener could not be registered.
', 0N/A select="concat(' void add', $java-relation-name, 0N/A 'DeleteListener(ConfigurationDeleteListener<', 0N/A $java-class-name,'Cfg> listener) throws ConfigException;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A select="concat(' /**
', 0N/A ' * Deregisters an existing ', $ufn,' configuration delete listener.
', 0N/A ' * @param listener
', 46N/A ' * The ', $ufn,' configuration delete listener.
', 0N/A select="concat(' void remove', $java-relation-name, 46N/A 'DeleteListener(ConfigurationDeleteListener<', 0N/A $java-class-name,'Cfg> listener);
')" />
0N/A <
xsl:
message terminate="yes">
0N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
0N/A Main document parsing template. 0N/A <
xsl:
template match="/">
0N/A <
xsl:
call-
template name="copyright-notice" />
0N/A select="concat('package ', $this-package, '.server;
')" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-import-statements">
0N/A <
xsl:
with-
param name="imports">
0N/A <
xsl:
for-
each select="$this-local-properties">
0N/A <
xsl:
call-
template name="get-property-java-imports" >
0N/A <
xsl:
with-
param name="interface" select="'server'" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
if test="$this-local-properties[@multi-valued='true']">
0N/A <
xsl:
when test="$this/@extends">
0N/A <
xsl:
if test="$parent-package != $this-package">
0N/A <
xsl:
element name="import">
0N/A select="concat($parent-package, '.server.', $parent-java-class, 'Cfg')" />
0N/A <
xsl:
if test="not($this-is-root)">
0N/A <
xsl:
if test="$this-local-relations">
0N/A </
xsl:
call-
template>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-interface-declaration" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-configuration-definition-getter" />
0N/A <
xsl:
if test="not($this-is-root)">
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-change-listener-declaration" />
0N/A <
xsl:
for-
each select="$this-local-properties">
0N/A <
xsl:
sort select="@name" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-property-getter-declaration">
0N/A <
xsl:
with-
param name="interface" select="'server'" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
for-
each select="$this-local-relations">
0N/A <
xsl:
sort select="@name" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="generate-relation-declarations" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>}
</
xsl:
text>