321N/A ! The contents of this file are subject to the terms of the 940N/A ! Common Development and Distribution License, Version 1.0 only 940N/A ! (the "License"). You may not use this file except in compliance 178N/A ! You can obtain a copy of the license at 295N/A ! See the License for the specific language governing permissions 295N/A ! and limitations under the License. 824N/A ! When distributing Covered Code, include this CDDL HEADER in each 824N/A ! file and include the License file at 824N/A ! add the following below this CDDL HEADER, with the fields enclosed 824N/A ! by brackets "[]" replaced with your own identifying information: 824N/A ! Portions Copyright [yyyy] [name of copyright owner] 824N/A ! Portions Copyright 2007 Sun Microsystems, Inc. 178N/A <
xsl:
output method="text" encoding="us-ascii" />
1928N/A Template for generating the class declaration. 1928N/A <
xsl:
template name="generate-meta-class-declaration">
1928N/A <
xsl:
value-
of select="'/**
'" />
1928N/A <
xsl:
call-
template name="add-java-comment">
178N/A <
xsl:
with-
param name="indent-text" select="' *'" />
178N/A <
xsl:
with-
param name="content" 178N/A select="concat('An interface for querying the ', $this-ufn, 224N/A ' managed object definition meta information.')" />
183N/A <
xsl:
value-
of select="' * <p>
'" />
183N/A <
xsl:
call-
template name="add-java-comment">
183N/A <
xsl:
with-
param name="indent-text" select="' *'" />
183N/A <
xsl:
with-
param name="content" select="$this/adm:synopsis" />
2439N/A <
xsl:
value-
of select="' */
'" />
2439N/A select="concat('public final class ', 2439N/A <
xsl:
when test="$this-is-abstract">
366N/A select="concat('AbstractManagedObjectDefinition<', 366N/A $this-java-class, 'CfgClient, ', 366N/A $this-java-class, 'Cfg> {
')" />
366N/A select="concat('ManagedObjectDefinition<', 366N/A $this-java-class, 'CfgClient, ', 366N/A $this-java-class, 'Cfg> {
')" />
222N/A Template for generating the meta class body. 222N/A <
xsl:
template name="generate-meta-class-body">
222N/A Singleton configuration definition instance. 222N/A select="concat(' // The singleton configuration definition instance.
', 222N/A ' private static final ', 222N/A 'CfgDefn INSTANCE = new ', $this-java-class, 'CfgDefn();
')" />
222N/A Generate enumerations defined by this managed object.. 222N/A <
xsl:
sort select="@name" />
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
call-
template name="generate-enumeration" />
222N/A Generate declarations for properties defined or 222N/A overridden by this managed object. 222N/A <
xsl:
for-
each select="$this-local-properties">
222N/A <
xsl:
sort select="@name" />
366N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
call-
template name="generate-property-declaration" />
222N/A Generate declarations for relations. 2414N/A <
xsl:
for-
each select="$this-local-relations">
222N/A <
xsl:
sort select="@name" />
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
call-
template name="generate-relation-declaration" />
222N/A Generate constructors for properties defined or 222N/A overridden by this managed object. 222N/A <
xsl:
for-
each select="$this-local-properties">
222N/A <
xsl:
sort select="@name" />
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
call-
template name="generate-property-constructor" />
222N/A Generate constructors for relations. 222N/A <
xsl:
for-
each select="$this-local-relations">
366N/A <
xsl:
sort select="@name" />
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
call-
template name="generate-relation-constructor" />
222N/A Configuration definition singleton getter. 222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
text>
</
xsl:
text>
222N/A <
xsl:
value-
of select="' /**
'" />
222N/A <
xsl:
call-
template name="add-java-comment">
222N/A <
xsl:
with-
param name="indent-text" select="' *'" />
222N/A <
xsl:
with-
param name="content" 222N/A select="concat('Get the ', $this-ufn,' configuration definition singleton.')" />
222N/A <
xsl:
value-
of select="' *
'" />
222N/A <
xsl:
call-
template name="add-java-comment">
222N/A <
xsl:
with-
param name="indent-text" select="' *'" />
222N/A <
xsl:
with-
param name="indent-text2" select="' * '" />
222N/A <
xsl:
with-
param name="content" 222N/A select="concat('@return Returns the ', $this-ufn, 222N/A ' configuration definition singleton.')" />
222N/A <
xsl:
value-
of select="' */
'" />
222N/A select="concat(' public static ', 366N/A 'CfgDefn getInstance() {
', 222N/A ' return INSTANCE;
', 289N/A <
xsl:
text>
</
xsl:
text>
289N/A <
xsl:
text>
</
xsl:
text>
289N/A <
xsl:
text>
</
xsl:
text>
289N/A select="concat(' /**
', 289N/A ' * Private constructor.
', 289N/A 'CfgDefn() {
')" />
2439N/A <
xsl:
when test="boolean($this/@extends)">
321N/A select="concat(' super("', 321N/A select="concat(' super("', 321N/A '", null);
')" />
321N/A <
xsl:
value-
of select="concat(' }
')" />
321N/A Create configuration view factory methods for non-abstract definitions 321N/A <
xsl:
if test="not($this-is-abstract)">
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A Generate configuration client factory method. 321N/A select="concat(' /**
', 321N/A ' * {@inheritDoc}
', 321N/A 'CfgClient createClientConfiguration(
', 321N/A ' ManagedObject<? extends ', 321N/A 'CfgClient> impl) {
', 321N/A 'CfgClientImpl(impl);
', 321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A Generate configuration server factory method. 321N/A select="concat(' /**
', 321N/A ' * {@inheritDoc}
', 321N/A 'Cfg createServerConfiguration(
', 321N/A ' ServerManagedObject<? extends ',$this-java-class,'Cfg> impl) {
', 321N/A 'CfgServerImpl(impl);
', 321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A Generate configuration server class getter.. 321N/A select="concat(' /**
', 321N/A ' * {@inheritDoc}
', 321N/A 'Cfg> getServerConfigurationClass() {
', 321N/A Generate property definition getters for all properties. 321N/A <
xsl:
for-
each select="$this-all-properties">
321N/A <
xsl:
sort select="@name" />
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
call-
template name="generate-property-definition-getter" />
321N/A Generate relation definition getters for all relations. 321N/A <
xsl:
for-
each select="$this-all-relations">
2439N/A <
xsl:
sort select="@name" />
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
call-
template name="generate-relation-definition-getter" />
321N/A Managed object class implementations. 321N/A <
xsl:
if test="not($this-is-abstract)">
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
321N/A <
xsl:
text>
</
xsl:
text>
2439N/A <
xsl:
call-
template name="generate-client-impl-class" />
321N/A <
xsl:
text>
</
xsl:
text>
333N/A <
xsl:
text>
</
xsl:
text>
333N/A <
xsl:
text>
</
xsl:
text>
333N/A <
xsl:
call-
template name="generate-server-impl-class" />
333N/A Generate managed object client class implementation. 333N/A <
xsl:
template name="generate-client-impl-class">
333N/A select="concat(' /**
', 333N/A ' * Managed object client implementation.
', 333N/A ' private static class ', 333N/A 'CfgClientImpl implements
 ', 333N/A 'CfgClient {
')" />
333N/A <
xsl:
text>
</
xsl:
text>
333N/A select="concat(' // Private implementation.
', 367N/A ' private ManagedObject<? extends ', 367N/A 'CfgClient> impl;
')" />
367N/A <
xsl:
text>
</
xsl:
text>
367N/A <
xsl:
text>
</
xsl:
text>
367N/A <
xsl:
text>
</
xsl:
text>
367N/A select="concat(' // Private constructor.
', 2165N/A ' ManagedObject<? extends ', 2165N/A 'CfgClient> impl) {
', 2353N/A <
xsl:
for-
each select="$this-all-properties">
2353N/A <
xsl:
sort select="@name" />
2165N/A <
xsl:
call-
template name="generate-property-getter">
2165N/A <
xsl:
with-
param name="interface" select="'client'" />
2165N/A <
xsl:
call-
template name="generate-property-setter" />
2439N/A <
xsl:
for-
each select="$this-all-relations">
2439N/A <
xsl:
sort select="@name" />
2165N/A <
xsl:
call-
template name="generate-client-relation-methods" />
295N/A Managed object definition getter. 295N/A <
xsl:
text>
</
xsl:
text>
295N/A <
xsl:
text>
</
xsl:
text>
295N/A <
xsl:
text>
</
xsl:
text>
295N/A select="concat(' /**
', 295N/A ' * {@inheritDoc}
', 824N/A ' public ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition() {
', 295N/A ' return INSTANCE;
', 2270N/A select="concat(' /**
', 2270N/A ' public PropertyProvider properties() {
', 824N/A <
xsl:
text>
</
xsl:
text>
824N/A select="concat(' /**
', 824N/A ' * {@inheritDoc}
', 824N/A ' public void commit() throws ManagedObjectAlreadyExistsException,
', 824N/A ' MissingMandatoryPropertiesException, ConcurrentModificationException,
', 824N/A ' OperationRejectedException, AuthorizationException,
', 824N/A ' CommunicationException {
', 824N/A <
xsl:
text>
</
xsl:
text>
824N/A <
xsl:
value-
of select="' }
'" />
295N/A Generate managed object server class implementation. 295N/A <
xsl:
template name="generate-server-impl-class">
295N/A select="concat(' /**
', 824N/A ' * Managed object server implementation.
', 295N/A ' private static class ', 1240N/A 'CfgServerImpl implements
 ', 1240N/A select="concat(' // Private implementation.
', 1240N/A ' private ServerManagedObject<? extends ', $this-java-class, 'Cfg> impl;
')" />
1240N/A select="concat(' // Private constructor.
', 1240N/A 'CfgServerImpl(ServerManagedObject<? extends ', $this-java-class, 'Cfg> impl) {
', 2622N/A Generate all the change listener methods - one for each managed 2622N/A <
xsl:
if test="not($this-is-root)">
2622N/A <
xsl:
call-
template name="generate-change-listener" />
2622N/A <
xsl:
for-
each select="$this-all-properties">
2622N/A <
xsl:
sort select="@name" />
2622N/A <
xsl:
call-
template name="generate-property-getter">
2622N/A <
xsl:
with-
param name="interface" select="'server'" />
2623N/A <
xsl:
for-
each select="$this-all-relations">
2623N/A <
xsl:
sort select="@name" />
2623N/A <
xsl:
call-
template name="generate-server-relation-methods" />
2623N/A Configuration definition getter. 2623N/A select="concat(' /**
', 2623N/A ' public ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition() {
', 2622N/A select="concat(' /**
', 2622N/A ' public PropertyProvider properties() {
', 2622N/A Configuration entry DN getter. 2622N/A select="concat(' /**
', 2622N/A <
xsl:
value-
of select="' }
'" />
2622N/A Generate a property definition constructor. 1240N/A <
xsl:
template name="generate-property-declaration">
1240N/A <
xsl:
variable name="java-prop-name">
1240N/A <
xsl:
call-
template name="name-to-java-constant">
1240N/A <
xsl:
with-
param name="value" select="@name" />
1240N/A <
xsl:
call-
template name="get-property-definition-type" />
1240N/A <
xsl:
variable name="generic-type">
1240N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1240N/A <
xsl:
variable name="pdtype">
1240N/A <
xsl:
when test="string-length($generic-type) != 0">
1240N/A select="concat($type, '<', $generic-type, '>')" />
2622N/A <
xsl:
value-
of select="$type" />
2622N/A select="concat(' // The "', 2622N/A '" property definition.
', 2622N/A ' private static final ', $pdtype, ' PD_', $java-prop-name, ';
')" />
2622N/A Generate a property definition constructor. 2622N/A <
xsl:
template name="generate-property-constructor">
2622N/A <
xsl:
variable name="java-prop-name">
2622N/A <
xsl:
call-
template name="name-to-java-constant">
2622N/A <
xsl:
with-
param name="value" select="@name" />
2623N/A <
xsl:
call-
template name="get-property-definition-type" />
2623N/A <
xsl:
variable name="generic-type">
2623N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
2623N/A <
xsl:
variable name="value-type">
2623N/A <
xsl:
call-
template name="get-property-java-type" />
2623N/A select="concat(' // Build the "', @name, '" property definition.
', 2623N/A <
xsl:
when test="string-length($generic-type) != 0">
2623N/A select="concat(' ', $type, '.Builder<', $generic-type, '> builder = ', $type, '.createBuilder(INSTANCE, "',@name, '");
')" />
2623N/A select="concat(' ', $type, '.Builder builder = ', $type, '.createBuilder(INSTANCE, "',@name, '");
')" />
2623N/A <
xsl:
if test="@multi-valued='true'">
2623N/A <
xsl:
if test="@read-only='true'">
2622N/A <
xsl:
if test="@monitoring='true'">
2622N/A <
xsl:
if test="@mandatory='true'">
2622N/A <
xsl:
if test="@hidden='true'">
2622N/A <
xsl:
when test="@mandatory='true'">
2622N/A <
xsl:
if test="not(adm:default-behavior)">
2622N/A <
xsl:
message terminate="yes">
2623N/A select="concat('No default behavior defined for non-mandatory property "', @name, 2622N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 2622N/A 'new DefinedDefaultBehaviorProvider<', $value-type,'>(')" />
2622N/A select="concat('"', normalize-space(), '"')" />
2622N/A <
xsl:
if test="position() != last()">
2622N/A <
xsl:
value-
of select="', '" />
2622N/A <
xsl:
value-
of select="');
'" />
2622N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 2622N/A 'new RelativeInheritedDefaultBehaviorProvider<', $value-type,'>(')" />
2622N/A <
xsl:
variable name="managed-object-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" 2622N/A <
xsl:
variable name="property-name" 1094N/A <
xsl:
variable name="offset" 1094N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 1094N/A 'new AbsoluteInheritedDefaultBehaviorProvider<', $value-type,'>(')" />
1094N/A <
xsl:
variable name="property-name" 2014N/A <
xsl:
message terminate="yes">
1948N/A select="concat('Unrecognized default behavior type for property "', @name, 1948N/A <
xsl:
call-
template name="get-property-definition-ctor" />
1948N/A <
xsl:
value-
of select="' }
'" />
1948N/A Generate a relation definition declaration. 1094N/A <
xsl:
template name="generate-relation-declaration">
1094N/A <
xsl:
variable name="relation-name">
1094N/A <
xsl:
when test="adm:one-to-many">
1094N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
1094N/A <
xsl:
value-
of select="@name" />
1094N/A <
xsl:
variable name="java-relation-name">
1094N/A <
xsl:
call-
template name="name-to-java-constant">
1094N/A <
xsl:
with-
param name="value" select="$relation-name" />
2622N/A <
xsl:
variable name="java-managed-object-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
2622N/A select="concat(' // The "', 2622N/A '" relation definition.
', 2622N/A ' private static final ')" />
2622N/A <
xsl:
when test="adm:one-to-one">
2622N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
when test="adm:one-to-zero-or-one">
2622N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
when test="adm:one-to-many">
2622N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
2623N/A <
xsl:
message terminate="yes">
2623N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
2623N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg> RD_', $java-relation-name, ';
')" />
2623N/A Generate a relation definition constructor. 2623N/A <
xsl:
template name="generate-relation-constructor">
2623N/A <
xsl:
variable name="relation-name">
2623N/A <
xsl:
when test="adm:one-to-many">
2623N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
2623N/A <
xsl:
value-
of select="@name" />
2623N/A <
xsl:
variable name="java-relation-name">
2623N/A <
xsl:
call-
template name="name-to-java-constant">
2623N/A <
xsl:
with-
param name="value" select="$relation-name" />
2622N/A <
xsl:
variable name="java-managed-object-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
2622N/A select="concat(' // Build the "', $relation-name, '" relation definition.
', 2622N/A ' RD_', $java-relation-name, ' = new ')" />
2622N/A <
xsl:
when test="adm:one-to-one">
2622N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
when test="adm:one-to-zero-or-one">
2622N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
when test="adm:one-to-many">
2622N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
message terminate="yes">
2622N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
2622N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg>(
', 2622N/A ' INSTANCE, "', @name, '", ')" />
2622N/A <
xsl:
if test="adm:one-to-many">
2622N/A select="concat('"', adm:one-to-many/@plural-name, '", ')" />
2623N/A <
xsl:
value-
of select="' }
'" />
2623N/A Generate a property definition getter for a locally defined 2622N/A <
xsl:
template name="generate-property-definition-getter">
2622N/A <
xsl:
variable name="java-prop-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" select="@name" />
2622N/A <
xsl:
variable name="java-prop-name-constant">
2622N/A <
xsl:
call-
template name="name-to-java-constant">
2622N/A <
xsl:
with-
param name="value" select="@name" />
2622N/A <
xsl:
call-
template name="get-property-definition-type" />
2622N/A <
xsl:
variable name="generic-type">
2622N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
2622N/A <
xsl:
variable name="pdtype">
2622N/A <
xsl:
when test="string-length($generic-type) != 0">
2622N/A select="concat($type, '<', $generic-type, '>')" />
2622N/A <
xsl:
value-
of select="$type" />
1590N/A select="concat(' /**
', 1590N/A '" property definition.
')" />
1590N/A <
xsl:
if test="adm:synopsis">
1590N/A <
xsl:
value-
of select="' * <p>
'" />
1590N/A <
xsl:
call-
template name="add-java-comment">
1590N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1590N/A <
xsl:
with-
param name="content" select="adm:synopsis" />
1590N/A <
xsl:
if test="adm:description">
1590N/A <
xsl:
value-
of select="' * <p>
'" />
1590N/A <
xsl:
call-
template name="add-java-comment">
1590N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1590N/A <
xsl:
with-
param name="content" select="adm:description" />
1590N/A test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
1948N/A ' * @return Returns the "', 1948N/A '" property definition.
', 1948N/A 'PropertyDefinition() {
' , 2622N/A ' * @return Returns the "', 2622N/A '" property definition.
', 2622N/A 'PropertyDefinition() {
' , 2622N/A 'PropertyDefinition();
', 2622N/A Generate a relation definition getter. 2622N/A <
xsl:
template name="generate-relation-definition-getter">
2622N/A <
xsl:
variable name="relation-name">
2622N/A <
xsl:
when test="adm:one-to-many">
2622N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
2622N/A <
xsl:
value-
of select="@name" />
2622N/A <
xsl:
variable name="java-relation-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2623N/A <
xsl:
with-
param name="value" select="$relation-name" />
2623N/A <
xsl:
variable name="java-relation-name-constant">
2623N/A <
xsl:
call-
template name="name-to-java-constant">
2623N/A <
xsl:
with-
param name="value" select="$relation-name" />
2623N/A select="concat(' /**
', 2623N/A '" relation definition.
', 2623N/A ' * @return Returns the "', 2623N/A '" relation definition.
', 2623N/A <
xsl:
when test="adm:one-to-one">
2623N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
2623N/A <
xsl:
when test="adm:one-to-zero-or-one">
2623N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
2623N/A <
xsl:
when test="adm:one-to-many">
2623N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
2622N/A <
xsl:
message terminate="yes">
2622N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
2622N/A <
xsl:
variable name="java-managed-object-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
2622N/A test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
2622N/A select="concat($java-managed-object-name, 'CfgClient,', 2622N/A $java-managed-object-name, 'Cfg> get', 2622N/A 'RelationDefinition() {
' , 2622N/A $java-relation-name-constant, 2623N/A select="concat($java-managed-object-name, 'CfgClient,', 2623N/A $java-managed-object-name, 'Cfg> get', 2623N/A 'RelationDefinition() {
' , 2622N/A 'RelationDefinition();
', 2622N/A Generate a property value getter. 2622N/A <
xsl:
template name="generate-property-getter">
2622N/A <
xsl:
param name="interface" select="/.." />
2622N/A <
xsl:
variable name="java-prop-name">
2622N/A <
xsl:
call-
template name="name-to-java">
2622N/A <
xsl:
with-
param name="value" select="@name" />
2622N/A select="concat(' /**
', 2622N/A <
xsl:
when test="string(@multi-valued) != 'true'">
2622N/A The method is guaranteed to return a value since there is a 2622N/A well-defined default value. 2622N/A <
xsl:
call-
template name="get-property-java-primitive-type" />
2622N/A test="$interface = 'server' and @mandatory = 'true'">
2622N/A The method is guaranteed to return a value in the server interface, but 2622N/A not necessarily in the client, since the mandatory property might not 444N/A <
xsl:
call-
template name="get-property-java-primitive-type" />
444N/A <
xsl:
call-
template name="get-property-java-type" />
444N/A <
xsl:
value-
of select="'SortedSet<'" />
444N/A <
xsl:
call-
template name="get-property-java-type" />
444N/A <
xsl:
value-
of select="'>'" />
444N/A <
xsl:
value-
of select="' is'" />
444N/A <
xsl:
value-
of select="' get'" />
1948N/A <
xsl:
when test="string(@multi-valued) != 'true'">
1948N/A select="concat($java-prop-name, '() {
', 1948N/A 'PropertyDefinition());
' , 1948N/A select="concat($java-prop-name, '() {
', 1948N/A 'PropertyDefinition());
' , 444N/A Generate a property value setter. 444N/A <
xsl:
template name="generate-property-setter">
444N/A <
xsl:
if test="not(@monitoring='true')">
444N/A <
xsl:
variable name="java-prop-name">
444N/A <
xsl:
call-
template name="name-to-java">
444N/A <
xsl:
with-
param name="value" select="@name" />
444N/A select="concat(' /**
', 444N/A ' * {@inheritDoc}
', 444N/A <
xsl:
when test="not(@multi-valued='true')">
444N/A <
xsl:
when test="@mandatory='true'">
444N/A name="get-property-java-primitive-type" />
444N/A <
xsl:
call-
template name="get-property-java-type" />
444N/A <
xsl:
value-
of select="' value)'" />
444N/A <
xsl:
if test="@read-only='true'">
469N/A <
xsl:
value-
of select="' throws PropertyIsReadOnlyException'" />
444N/A select="concat(' {
' , 444N/A 'PropertyDefinition(), value);
', 2622N/A <
xsl:
value-
of select="'Collection<'" />
2622N/A <
xsl:
call-
template name="get-property-java-type" />
2622N/A select="concat('> values) {
' , 444N/A 'PropertyDefinition(), values);
', 444N/A Generate client relation methods. 444N/A <
xsl:
template name="generate-client-relation-methods">
444N/A <
xsl:
variable name="name" select="@name" />
444N/A <
xsl:
variable name="java-relation-name">
444N/A <
xsl:
call-
template name="name-to-java">
444N/A <
xsl:
with-
param name="value" select="$name" />
444N/A <
xsl:
variable name="java-class-name">
444N/A <
xsl:
call-
template name="name-to-java">
444N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
444N/A <
xsl:
when test="adm:one-to-one">
444N/A select="concat(' /**
', 444N/A ' * {@inheritDoc}
', 444N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 444N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 444N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 444N/A ' AuthorizationException, CommunicationException {
', 444N/A <
xsl:
when test="adm:one-to-zero-or-one">
444N/A select="concat(' /**
', 444N/A ' * {@inheritDoc}
', 2622N/A ' public boolean has', $java-relation-name, '() throws ConcurrentModificationException,
', 2622N/A ' AuthorizationException, CommunicationException {
', 2622N/A select="concat(' /**
', 2622N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 2622N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 2622N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 2622N/A ' AuthorizationException, CommunicationException {
', 2623N/A select="concat(' /**
', 2623N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', $java-relation-name, '(
', 2623N/A ' ManagedObjectDefinition<M, ?> d, Collection<DefaultBehaviorException> exceptions) {
', 2623N/A select="concat(' /**
', 2623N/A ' public void remove', $java-relation-name, '()
', 2623N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,
', 2623N/A ' OperationRejectedException, AuthorizationException, CommunicationException {
', 2623N/A <
xsl:
when test="adm:one-to-many">
2623N/A <
xsl:
variable name="plural-name" 2623N/A select="adm:one-to-many/@plural-name" />
2623N/A <
xsl:
variable name="java-relation-plural-name">
2623N/A <
xsl:
call-
template name="name-to-java">
2623N/A <
xsl:
with-
param name="value" select="$plural-name" />
2622N/A select="concat(' /**
', 2622N/A ' public String[] list', $java-relation-plural-name, '() throws ConcurrentModificationException,
', 2622N/A ' AuthorizationException, CommunicationException {
', 2622N/A select="concat(' /**
', 2622N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '(String name)
', 2622N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 2622N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 2622N/A ' AuthorizationException, CommunicationException {
', 2622N/A select="concat(' /**
', 1155N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', $java-relation-name, '(
', 1155N/A ' ManagedObjectDefinition<M, ?> d, String name, Collection<DefaultBehaviorException> exceptions) {
', 1155N/A select="concat(' /**
', 1948N/A ' public void remove', $java-relation-name, '(String name)
', 1155N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,
', 1155N/A ' OperationRejectedException, AuthorizationException, CommunicationException {
', 1155N/A <
xsl:
message terminate="yes">
1155N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
1948N/A Generate server relation methods. 1948N/A <
xsl:
template name="generate-server-relation-methods">
1948N/A <
xsl:
variable name="name" select="@name" />
1948N/A <
xsl:
variable name="java-relation-name">
1948N/A <
xsl:
call-
template name="name-to-java">
1948N/A <
xsl:
with-
param name="value" select="$name" />
1948N/A <
xsl:
variable name="java-class-name">
1948N/A <
xsl:
call-
template name="name-to-java">
1948N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
1948N/A <
xsl:
when test="adm:one-to-one">
1155N/A select="concat(' /**
', 1155N/A ' public ', $java-class-name, 'Cfg get', 1155N/A $java-relation-name, '() throws ConfigException {
', 1155N/A <
xsl:
when test="adm:one-to-zero-or-one">
1155N/A select="concat(' /**
', 1155N/A $java-relation-name, '() {
', 1155N/A select="concat(' /**
', 1155N/A ' public ', $java-class-name, 'Cfg get', 1155N/A $java-relation-name, '() throws ConfigException {
', 444N/A <
xsl:
text>
</
xsl:
text>
444N/A <
xsl:
text>
</
xsl:
text>
1155N/A select="concat(' /**
', 1155N/A ' public void add', $java-relation-name, 'AddListener(
', 1155N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1155N/A select="concat(' /**
', 1155N/A ' public void remove', $java-relation-name, 'AddListener(
', 1155N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) {
', 1155N/A select="concat(' /**
', 1590N/A ' public void add', $java-relation-name, 'DeleteListener(
', 1155N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1155N/A select="concat(' /**
', 2622N/A ' public void remove', $java-relation-name, 'DeleteListener(
', 2622N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) {
', 1155N/A <
xsl:
when test="adm:one-to-many">
1155N/A <
xsl:
variable name="plural-name" 1155N/A select="adm:one-to-many/@plural-name" />
1155N/A <
xsl:
variable name="java-relation-plural-name">
1155N/A <
xsl:
call-
template name="name-to-java">
1155N/A <
xsl:
with-
param name="value" select="$plural-name" />
1155N/A select="concat(' /**
', 1155N/A $java-relation-plural-name, '() {
', 1155N/A select="concat(' /**
', 1155N/A ' public ', $java-class-name, 'Cfg get', 1155N/A $java-relation-name, '(String name) throws ConfigException {
', 2622N/A select="concat(' /**
', 2622N/A ' public void add', $java-relation-name, 'AddListener(
', 2622N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 2623N/A select="concat(' /**
', 2623N/A ' public void remove', $java-relation-name, 'AddListener(
', 2623N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) {
', 2623N/A select="concat(' /**
', 2623N/A ' public void add', $java-relation-name, 'DeleteListener(
', 2623N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 2623N/A select="concat(' /**
', 2622N/A ' public void remove', $java-relation-name, 'DeleteListener(
', 2622N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) {
', 2622N/A <
xsl:
message terminate="yes">
2622N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
2622N/A Generate change listener registration methods. 2622N/A <
xsl:
template name="generate-change-listener">
2622N/A Process this managed object. 2622N/A <
xsl:
variable name="top-name" 2622N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object[last()]/@name" />
2622N/A <
xsl:
call-
template name="generate-change-listener-help">
2622N/A <
xsl:
with-
param name="top-name" select="$top-name" />
2622N/A <
xsl:
with-
param name="name" select="$this-name" />
1112N/A select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
1112N/A <
xsl:
call-
template name="generate-change-listener-help">
1112N/A <
xsl:
with-
param name="top-name" select="$top-name" />
1112N/A <
xsl:
with-
param name="name" select="@name" />
1961N/A Generate a single set of change listener registration methods. 1961N/A <
xsl:
template name="generate-change-listener-help">
1961N/A <
xsl:
param name="top-name" select="/.." />
1961N/A <
xsl:
param name="name" select="/.." />
1961N/A <
xsl:
variable name="short-name">
1961N/A <
xsl:
when test="not($top-name) or $top-name = $name">
2440N/A <
xsl:
value-
of select="''" />
2440N/A <
xsl:
variable name="top-length" 2440N/A select="string-length($top-name)" />
2440N/A <
xsl:
variable name="length" select="string-length($name)" />
2440N/A <
xsl:
variable name="diff" select="$length - $top-length" />
2440N/A <
xsl:
value-
of select="substring($name, 1, $diff - 1)" />
2440N/A <
xsl:
variable name="java-class">
2440N/A <
xsl:
call-
template name="name-to-java">
2440N/A <
xsl:
with-
param name="value" select="$name" />
2440N/A <
xsl:
variable name="short-java-class">
2440N/A <
xsl:
call-
template name="name-to-java">
2440N/A <
xsl:
with-
param name="value" select="$short-name" />
2440N/A select="concat(' /**
', 2440N/A select="concat(' public void add', $short-java-class, 'ChangeListener(
', 2440N/A ' ConfigurationChangeListener<',$java-class,'Cfg> listener) {
', 2440N/A select="concat(' /**
', 2591N/A select="concat(' public void remove', $short-java-class, 'ChangeListener(
', 2591N/A ' ConfigurationChangeListener<',$java-class,'Cfg> listener) {
', 2591N/A Generate import statements for change-listener 2591N/A <
xsl:
template name="generate-change-listener-import-statements">
Process this managed object. <
xsl:
element name="import">
select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
Process parent hierarchy. select="$this/adm:profile[@name='preprocessor']/admpp:parent-managed-object">
<
xsl:
variable name="java-class">
<
xsl:
call-
template name="name-to-java">
<
xsl:
with-
param name="value" select="@name" />
<
xsl:
element name="import">
select="concat(@package, '.server.', $java-class, 'Cfg')" />
Generate an enumeration for a locally defined enumerated property. <
xsl:
template name="generate-enumeration">
select="concat(' /**
', ' * Defines the set of permissable values for the "', @name, '" property.
')" />
<
xsl:
if test="adm:synopsis">
<
xsl:
value-
of select="' * <p>
'" />
<
xsl:
call-
template name="add-java-comment">
<
xsl:
with-
param name="indent-text" select="' *'" />
<
xsl:
with-
param name="content" select="adm:synopsis" />
<
xsl:
if test="adm:description">
<
xsl:
value-
of select="' * <p>
'" />
<
xsl:
call-
template name="add-java-comment">
<
xsl:
with-
param name="indent-text" select="' *'" />
<
xsl:
with-
param name="content" select="adm:description" />
select="concat(' */
', ' public static enum ')" />
<
xsl:
call-
template name="name-to-java">
<
xsl:
with-
param name="value" select="@name" />
<
xsl:
value-
of select="' {
'" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
sort select="@name" />
<
xsl:
value-
of select="' /**
'" />
<
xsl:
call-
template name="add-java-comment">
<
xsl:
with-
param name="indent-text" select="' *'" />
<
xsl:
with-
param name="content" select="adm:synopsis" />
<
xsl:
value-
of select="' */
'" />
<
xsl:
value-
of select="' '" />
<
xsl:
call-
template name="name-to-java-constant">
<
xsl:
with-
param name="value" select="@name" />
<
xsl:
value-
of select="concat('("', @name, '")')" />
<
xsl:
when test="position() != last()">
<
xsl:
value-
of select="',
'" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
value-
of select="';
'" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
select="' // String representation of the value.
'" />
<
xsl:
value-
of select="' private final String name;
'" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
value-
of select="' // Private constructor.
'" />
<
xsl:
value-
of select="' private '" />
<
xsl:
call-
template name="name-to-java">
<
xsl:
with-
param name="value" select="@name" />
select="concat('(String name) { this.name = name; }
', ' public String toString() { return name; }
')" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
value-
of select="' }
'" />
Main document parsing template. <
xsl:
call-
template name="copyright-notice" />
select="concat('package ', $this-package, '.meta;
')" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
call-
template name="generate-import-statements">
<
xsl:
with-
param name="imports">
test="$this-local-properties[@multi-valued='true' or | $this-local-properties[@mandatory='true']">
<
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:
element name="import">
select="concat(@managed-object-package, '.meta.', $java-class-name, 'CfgDefn')" />
<
xsl:
element name="import">
select="concat($this-package, '.client.', $this-java-class, 'CfgClient')" />
<
xsl:
element name="import">
select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
<
xsl:
for-
each select="$this-inherited-properties">
<
xsl:
call-
template name="get-property-java-imports" />
<
xsl:
for-
each select="$this-all-properties">
name="get-property-definition-java-imports" />
<
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:
element name="import">
select="concat(@managed-object-package, '.client.', $java-class-name, 'CfgClient')" />
<
xsl:
element name="import">
select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
<
xsl:
when test="$this-is-abstract">
<
xsl:
if test="not($this-is-root)">
name="generate-change-listener-import-statements" />
<
xsl:
if test="$this-all-relations">
<
xsl:
if test="$this-all-properties[@multi-valued='true']">
<
xsl:
if test="$this-all-properties[@read-only='true']">
<
xsl:
if test="$this/@extends">
<
xsl:
if test="$parent-package != $this-package">
<
xsl:
element name="import">
select="concat($parent-package, '.meta.', $parent-java-class, 'CfgDefn')" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
text>
</
xsl:
text>
<
xsl:
call-
template name="generate-meta-class-declaration" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
call-
template name="generate-meta-class-body" />
<
xsl:
text>}
</
xsl:
text>