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 ! You can obtain a copy of the license at 1008N/A ! See the License for the specific language governing permissions 1008N/A ! and limitations under the License. 1008N/A ! When distributing Covered Code, include this CDDL HEADER in each 1008N/A ! file and include the License file at 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 ! Portions Copyright 2007 Sun Microsystems, Inc. 1008N/A <
xsl:
output method="text" encoding="us-ascii" />
1008N/A Template for generating the class declaration. 1008N/A <
xsl:
template name="generate-meta-class-declaration">
1008N/A <
xsl:
value-
of select="'/**
'" />
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:
value-
of select="' * <p>
'" />
1008N/A <
xsl:
call-
template name="add-java-comment">
1008N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1008N/A <
xsl:
value-
of select="' */
'" />
1008N/A select="concat('public final class ', 1008N/A <
xsl:
when test="$this-is-abstract">
1008N/A select="concat('AbstractManagedObjectDefinition<', 1008N/A $this-java-class, 'CfgClient, ', 1008N/A $this-java-class, 'Cfg> {
')" />
1008N/A select="concat('ManagedObjectDefinition<', 1008N/A $this-java-class, 'CfgClient, ', 1008N/A $this-java-class, 'Cfg> {
')" />
1008N/A Template for generating the meta class body. 1008N/A <
xsl:
template name="generate-meta-class-body">
1008N/A Singleton configuration definition instance. 1008N/A select="concat(' // The singleton configuration definition instance.
', 1008N/A 'CfgDefn INSTANCE = new ', $this-java-class, 'CfgDefn();
')" />
1008N/A Generate enumerations defined by this managed object.. 1008N/A <
xsl:
sort select="@name" />
2345N/A <
xsl:
call-
template name="generate-enumeration" />
1008N/A Generate declarations for properties defined or 1008N/A overridden by this managed object. 1548N/A <
xsl:
for-
each select="$this-local-properties">
1548N/A <
xsl:
sort select="@name" />
1565N/A <
xsl:
call-
template name="generate-property-declaration" />
1548N/A Generate declarations for relations. 1565N/A <
xsl:
for-
each select="$this-local-relations">
1548N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-relation-declaration" />
1008N/A Generate constructors for properties defined or 1008N/A overridden by this managed object. 1008N/A <
xsl:
for-
each select="$this-local-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-property-constructor" />
1008N/A Generate constructors for relations. 1008N/A <
xsl:
for-
each select="$this-local-relations">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-relation-constructor" />
1008N/A Configuration definition singleton getter. 1008N/A <
xsl:
value-
of select="' /**
'" />
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:
value-
of select="' *
'" />
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.')" />
1548N/A <
xsl:
value-
of select="' */
'" />
1548N/A select="concat(' public static ', 1548N/A 'CfgDefn getInstance() {
', 1548N/A select="concat(' /**
', 1548N/A ' * Private constructor.
', 1008N/A <
xsl:
when test="boolean($this/@extends)">
1008N/A select="concat(' super("', 1008N/A select="concat(' super("', 1008N/A <
xsl:
value-
of select="concat(' }
')" />
1008N/A Create configuration view factory methods for non-abstract definitions 1008N/A <
xsl:
if test="not($this-is-abstract)">
1008N/A Generate configuration client factory method. 1008N/A select="concat(' /**
', 1008N/A 'CfgClient createClientConfiguration(
', 1008N/A ' ManagedObject<? extends ', 1008N/A 'CfgClient> impl) {
', 1008N/A 'CfgClientImpl(impl);
', 1008N/A Generate configuration server factory method. 1008N/A select="concat(' /**
', 1008N/A 'Cfg createServerConfiguration(
', 1008N/A ' ServerManagedObject<? extends ',$this-java-class,'Cfg> impl) {
', 1008N/A 'CfgServerImpl(impl);
', 1008N/A Generate configuration server class getter.. 1008N/A select="concat(' /**
', 1008N/A 'Cfg> getServerConfigurationClass() {
', 1008N/A Generate property definition getters for local properties. 1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-property-definition-getter" />
1008N/A Generate relation definition getters for local relations. 1008N/A <
xsl:
for-
each select="$this-all-relations">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-relation-definition-getter" />
1008N/A Managed object class implementations. 1008N/A <
xsl:
if test="not($this-is-abstract)">
1008N/A <
xsl:
call-
template name="generate-client-impl-class" />
1008N/A <
xsl:
call-
template name="generate-server-impl-class" />
1008N/A Generate managed object client class implementation. 1008N/A <
xsl:
template name="generate-client-impl-class">
1008N/A select="concat(' /**
', 1008N/A ' * Managed object client implementation.
', 1008N/A 'CfgClientImpl implements
 ', 1008N/A select="concat(' // Private implementation.
', 1008N/A ' private ManagedObject<? extends ', 1008N/A 'CfgClient> impl;
')" />
1008N/A select="concat(' // Private constructor.
', 1008N/A ' ManagedObject<? extends ', 1008N/A 'CfgClient> impl) {
', 1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-property-getter">
1008N/A <
xsl:
with-
param name="interface" select="'client'" />
1008N/A <
xsl:
call-
template name="generate-property-setter" />
1008N/A <
xsl:
for-
each select="$this-all-relations">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-client-relation-methods" />
1008N/A Managed object definition getter. 1008N/A select="concat(' /**
', 1008N/A ' public ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition() {
', 1008N/A select="concat(' /**
', 1008N/A ' public PropertyProvider properties() {
', 1008N/A select="concat(' /**
', 1008N/A ' public void commit() throws OperationsException {
', 1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Generate managed object server class implementation. 1008N/A <
xsl:
template name="generate-server-impl-class">
1008N/A select="concat(' /**
', 1008N/A ' * Managed object server implementation.
', 1008N/A 'CfgServerImpl implements
 ', 1008N/A select="concat(' // Private implementation.
', 1008N/A ' private ServerManagedObject<? extends ', $this-java-class, 'Cfg> impl;
')" />
1418N/A select="concat(' // Private constructor.
', 1008N/A 'CfgServerImpl(ServerManagedObject<? extends ', $this-java-class, 'Cfg> impl) {
', 1008N/A Generate all the change listener methods - one for each managed 1008N/A <
xsl:
if test="not($this-is-root)">
1008N/A <
xsl:
call-
template name="generate-change-listener" />
1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-property-getter">
1008N/A <
xsl:
with-
param name="interface" select="'server'" />
1008N/A <
xsl:
for-
each select="$this-all-relations">
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-server-relation-methods" />
1008N/A Configuration definition getter. 1008N/A select="concat(' /**
', 1008N/A ' public ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition() {
', 1008N/A select="concat(' /**
', 1008N/A ' public PropertyProvider properties() {
', 1008N/A Configuration entry DN getter. 1008N/A select="concat(' /**
', 1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Generate a property definition constructor. 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 name="get-property-definition-type" />
1008N/A <
xsl:
variable name="generic-type">
1008N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1008N/A <
xsl:
variable name="pdtype">
1008N/A <
xsl:
when test="string-length($generic-type) != 0">
1008N/A select="concat($type, '<', $generic-type, '>')" />
1008N/A <
xsl:
value-
of select="$type" />
1008N/A select="concat(' // The "', 1008N/A '" property definition.
', 1008N/A ' private static final ', $pdtype, ' PD_', $java-prop-name, ';
')" />
1008N/A Generate a property definition constructor. 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 name="get-property-definition-type" />
1008N/A <
xsl:
variable name="generic-type">
1008N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1008N/A <
xsl:
variable name="value-type">
1008N/A <
xsl:
call-
template name="get-property-java-type" />
1008N/A select="concat(' // Build the "', @name, '" property definition.
', 1008N/A <
xsl:
when test="string-length($generic-type) != 0">
1008N/A select="concat(' ', $type, '.Builder<', $generic-type, '> builder = ', $type, '.createBuilder(INSTANCE, "',@name, '");
')" />
1008N/A select="concat(' ', $type, '.Builder builder = ', $type, '.createBuilder(INSTANCE, "',@name, '");
')" />
1008N/A <
xsl:
if test="string(@multi-valued) = 'true'">
1008N/A <
xsl:
if test="string(@read-only) = 'true'">
1008N/A <
xsl:
if test="string(@mandatory) = 'true'">
1008N/A <
xsl:
if test="string(@hidden) = 'true'">
1008N/A <
xsl:
when test="string(@mandatory) = 'true'">
1008N/A <
xsl:
if test="not(adm:default-behavior)">
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('No default behavior defined for non-mandatory property "', @name, 1008N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 1418N/A 'new DefinedDefaultBehaviorProvider<', $value-type,'>(')" />
1418N/A select="concat('"', normalize-space(), '"')" />
1008N/A <
xsl:
if test="position() != last()">
1008N/A <
xsl:
value-
of select="', '" />
1008N/A <
xsl:
value-
of select="');
'" />
1906N/A <
xsl:
message terminate="yes">
1565N/A select="concat('Relative inherited property defaults not yet implemented (property "', @name, 1565N/A <
xsl:
message terminate="yes">
1565N/A select="concat('Absolute inherited property defaults not yet implemented (property "', @name, 1565N/A <
xsl:
message terminate="yes">
1548N/A select="concat('Unrecognized default behavior type for property "', @name, 1426N/A <
xsl:
call-
template name="get-property-definition-ctor" />
1008N/A <
xsl:
value-
of select="' }
'" />
1426N/A Generate a relation definition declaration. 1426N/A <
xsl:
template name="generate-relation-declaration">
1426N/A <
xsl:
variable name="relation-name">
1426N/A <
xsl:
when test="adm:one-to-many">
1426N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
1426N/A <
xsl:
value-
of select="@name" />
1426N/A <
xsl:
variable name="java-relation-name">
1418N/A <
xsl:
call-
template name="name-to-java-constant">
1426N/A <
xsl:
with-
param name="value" select="$relation-name" />
1426N/A <
xsl:
variable name="java-managed-object-name">
1426N/A <
xsl:
call-
template name="name-to-java">
1426N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
1426N/A select="concat(' // The "', 1426N/A '" relation definition.
', 1426N/A ' private static final ')" />
1426N/A <
xsl:
when test="adm:one-to-one">
1426N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
1426N/A <
xsl:
when test="adm:one-to-zero-or-one">
1426N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
1426N/A <
xsl:
when test="adm:one-to-many">
1426N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
1426N/A <
xsl:
message terminate="yes">
1426N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
1426N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg> RD_', $java-relation-name, ';
')" />
1426N/A Generate a relation definition constructor. 1008N/A <
xsl:
template name="generate-relation-constructor">
1008N/A <
xsl:
variable name="relation-name">
1008N/A <
xsl:
when test="adm:one-to-many">
1008N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
1008N/A <
xsl:
value-
of select="@name" />
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:
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 select="concat(' // Build the "', $relation-name, '" relation definition.
', 1008N/A ' RD_', $java-relation-name, ' = new ')" />
1008N/A <
xsl:
when test="adm:one-to-one">
1008N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1008N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
when test="adm:one-to-many">
1008N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
1008N/A select="concat($java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg>(
', 1008N/A ' INSTANCE, "', @name, '", ')" />
1008N/A <
xsl:
if test="adm:one-to-many">
1008N/A select="concat('"', adm:one-to-many/@plural-name, '", ')" />
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Generate a property definition getter for a locally defined 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:
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 name="get-property-definition-type" />
1008N/A <
xsl:
variable name="generic-type">
1008N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1008N/A <
xsl:
variable name="pdtype">
1008N/A <
xsl:
when test="string-length($generic-type) != 0">
1008N/A select="concat($type, '<', $generic-type, '>')" />
1893N/A <
xsl:
value-
of select="$type" />
1893N/A select="concat(' /**
', 1893N/A '" property definition.
')" />
1893N/A <
xsl:
if test="adm:synopsis">
1893N/A <
xsl:
value-
of select="' * <p>
'" />
1893N/A <
xsl:
call-
template name="add-java-comment">
1893N/A <
xsl:
with-
param name="indent-text" select="' *'" />
1893N/A <
xsl:
with-
param name="content" select="adm:synopsis" />
1893N/A <
xsl:
if test="adm:description">
1893N/A <
xsl:
value-
of select="' * <p>
'" />
1893N/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 test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
1008N/A ' * @return Returns the "', 1893N/A '" property definition.
', 1893N/A 'PropertyDefinition() {
' , 1893N/A ' * @return Returns the "', 1893N/A '" property definition.
', 1008N/A 'PropertyDefinition() {
' , 1008N/A 'PropertyDefinition();
', 1008N/A Generate a relation definition getter. 1008N/A <
xsl:
template name="generate-relation-definition-getter">
1008N/A <
xsl:
variable name="relation-name">
1008N/A <
xsl:
when test="adm:one-to-many">
1008N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
1008N/A <
xsl:
value-
of 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="$relation-name" />
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 select="concat(' /**
', 1008N/A '" relation definition.
', 1008N/A ' * @return Returns the "', 1008N/A '" relation definition.
', 1008N/A <
xsl:
when test="adm:one-to-one">
1008N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1008N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
when test="adm:one-to-many">
1008N/A <
xsl:
text>InstantiableRelationDefinition<</
xsl:
text>
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', @name, '".')" />
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 test="adm:profile[@name='preprocessor']/admpp:managed-object[@name=$this-name and @package=$this-package]">
1008N/A select="concat($java-managed-object-name, 'CfgClient,', 1008N/A $java-managed-object-name, 'Cfg> get', 1008N/A 'RelationDefinition() {
' , 1008N/A $java-relation-name-constant, 1008N/A select="concat($java-managed-object-name, 'CfgClient,', 1008N/A $java-managed-object-name, 'Cfg> get', 1008N/A 'RelationDefinition() {
' , 1008N/A 'RelationDefinition();
', 1008N/A Generate a property value getter. 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 select="concat(' /**
', 1008N/A <
xsl:
when test="string(@multi-valued) != 'true'">
1008N/A The method is guaranteed to return a value since there is a 1008N/A well-defined default value. 1008N/A <
xsl:
call-
template name="get-property-java-primitive-type" />
1008N/A test="$interface = 'server' and @mandatory = 'true'">
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 <
xsl:
call-
template name="get-property-java-primitive-type" />
1008N/A <
xsl:
call-
template name="get-property-java-type" />
1008N/A <
xsl:
value-
of select="'SortedSet<'" />
1008N/A <
xsl:
call-
template name="get-property-java-type" />
1008N/A <
xsl:
value-
of select="'>'" />
1008N/A <
xsl:
value-
of select="' is'" />
1008N/A <
xsl:
value-
of select="' get'" />
1008N/A <
xsl:
when test="string(@multi-valued) != 'true'">
2345N/A select="concat($java-prop-name, '() {
', 1008N/A 'PropertyDefinition());
' , 1008N/A select="concat($java-prop-name, '() {
', 1008N/A 'PropertyDefinition());
' , 1008N/A Generate a property value setter. 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 select="concat(' /**
', 1008N/A <
xsl:
when test="string(@multi-valued) != 'true'">
1008N/A <
xsl:
when test="@mandatory = 'true'">
1008N/A name="get-property-java-primitive-type" />
1008N/A <
xsl:
call-
template name="get-property-java-type" />
1008N/A select="concat(' value) {
' , 1008N/A 'PropertyDefinition(), value);
', 1089N/A <
xsl:
value-
of select="'Collection<'" />
1008N/A <
xsl:
call-
template name="get-property-java-type" />
1008N/A select="concat('> values) {
' , 1008N/A 'PropertyDefinition(), values);
', 1008N/A Generate client relation methods. 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:
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:
when test="adm:one-to-one">
1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'CfgClient get', 1008N/A $java-relation-name, '() throws OperationsException {
', 1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1008N/A select="concat(' /**
', 1008N/A $java-relation-name, '() throws OperationsException {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'CfgClient get', 1008N/A $java-relation-name, '() throws OperationsException {
', 1008N/A select="concat(' /**
', 1418N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', 1008N/A $java-relation-name, '(ManagedObjectDefinition<M, ?> d, PropertyProvider p) throws OperationsException {
', 1418N/A select="concat(' /**
', 1418N/A $java-relation-name, '() throws OperationsException {
', 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 select="concat(' /**
', 1008N/A $java-relation-plural-name, '() throws OperationsException {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'CfgClient get', 1008N/A $java-relation-name, '(String name) throws OperationsException {
', 1008N/A select="concat(' /**
', 1008N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', 1008N/A $java-relation-name, '(ManagedObjectDefinition<M, ?> d, String name, PropertyProvider p) throws OperationsException {
', 1008N/A select="concat(' /**
', 1008N/A $java-relation-name, '(String name) throws OperationsException {
', 1389N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
1008N/A Generate server relation methods. 1389N/A <
xsl:
template name="generate-server-relation-methods">
1389N/A <
xsl:
variable name="name" select="@name" />
1389N/A <
xsl:
variable name="java-relation-name">
1389N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="$name" />
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" />
1389N/A <
xsl:
when test="adm:one-to-one">
1418N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'Cfg get', 1008N/A $java-relation-name, '() throws ConfigException {
', 1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1389N/A select="concat(' /**
', 1008N/A $java-relation-name, '() {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'Cfg get', 1008N/A $java-relation-name, '() throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void add', $java-relation-name, 'AddListener(
', 1008N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, 'AddListener(
', 1008N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) {
', 1008N/A select="concat(' /**
', 1008N/A ' public void add', $java-relation-name, 'DeleteListener(
', 1008N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, 'DeleteListener(
', 1008N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) {
', 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 select="concat(' /**
', 1008N/A $java-relation-plural-name, '() {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'Cfg get', 1008N/A $java-relation-name, '(String name) throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void add', $java-relation-name, 'AddListener(
', 1008N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, 'AddListener(
', 1008N/A ' ConfigurationAddListener<', $java-class-name,'Cfg> listener) {
', 1008N/A select="concat(' /**
', 1008N/A ' public void add', $java-relation-name, 'DeleteListener(
', 1008N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) throws ConfigException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, 'DeleteListener(
', 1008N/A ' ConfigurationDeleteListener<', $java-class-name,'Cfg> listener) {
', 1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
1008N/A Generate change listener registration methods. 1008N/A <
xsl:
template name="generate-change-listener">
1008N/A Process this managed object. 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 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 Generate a single set of change listener registration methods. 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:
when test="not($top-name) or $top-name = $name">
1008N/A <
xsl:
value-
of select="''" />
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:
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:
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 select="concat(' /**
', 1008N/A select="concat(' public void add', $short-java-class, 'ChangeListener(
', 1008N/A ' ConfigurationChangeListener<',$java-class,'Cfg> listener) {
', 1008N/A select="concat(' /**
', 1008N/A select="concat(' public void remove', $short-java-class, 'ChangeListener(
', 1008N/A ' ConfigurationChangeListener<',$java-class,'Cfg> listener) {
', 1008N/A Generate import statements for change-listener 1008N/A <
xsl:
template name="generate-change-listener-import-statements">
1008N/A Process this managed object. 1008N/A <
xsl:
element name="import">
1008N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
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:
element name="import">
1008N/A select="concat(@package, '.server.', $java-class, 'Cfg')" />
1008N/A Generate an enumeration for a locally defined enumerated property. 1008N/A <
xsl:
template name="generate-enumeration">
1008N/A select="concat(' /**
', 1008N/A ' * Defines the set of permissable values for the "', @name, '" property.
')" />
1008N/A <
xsl:
if test="adm:synopsis">
1008N/A <
xsl:
value-
of select="' * <p>
'" />
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:
if test="adm:description">
1008N/A <
xsl:
value-
of select="' * <p>
'" />
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 ' public static enum ')" />
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="@name" />
1008N/A <
xsl:
value-
of select="' {
'" />
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
value-
of select="' /**
'" />
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:
value-
of select="' */
'" />
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:
value-
of select="concat('("', @name, '")')" />
1008N/A <
xsl:
when test="position() != last()">
1008N/A <
xsl:
value-
of select="',
'" />
1008N/A <
xsl:
value-
of select="';
'" />
1008N/A select="' // String representation of the value.
'" />
1008N/A <
xsl:
value-
of select="' private final String name;
'" />
1008N/A <
xsl:
value-
of select="' // Private constructor.
'" />
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 ' public String toString() { return name; }
')" />
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Main document parsing template. 1008N/A <
xsl:
call-
template name="copyright-notice" />
1008N/A select="concat('package ', $this-package, '.meta;
')" />
1008N/A <
xsl:
call-
template name="generate-import-statements">
1008N/A <
xsl:
with-
param name="imports">
1008N/A test="$this-local-properties[@multi-valued='true' or 1008N/A | $this-local-properties[@mandatory='true']">
1008N/A <
xsl:
element name="import">
1008N/A select="concat($this-package, '.client.', $this-java-class, 'CfgClient')" />
1008N/A <
xsl:
element name="import">
1008N/A select="concat($this-package, '.server.', $this-java-class, 'Cfg')" />
1008N/A <
xsl:
for-
each select="$this-inherited-properties">
1008N/A <
xsl:
call-
template name="get-property-java-imports" />
1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A name="get-property-definition-java-imports" />
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:
element name="import">
1008N/A select="concat(@managed-object-package, '.client.', $java-class-name, 'CfgClient')" />
1008N/A <
xsl:
element name="import">
1008N/A select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
1008N/A <
xsl:
when test="$this-is-abstract">
1008N/A <
xsl:
if test="not($this-is-root)">
1008N/A name="generate-change-listener-import-statements" />
1906N/A <
xsl:
if test="$this-all-properties[@multi-valued='true']">
1906N/A <
xsl:
if test="$this/@extends">
1906N/A <
xsl:
if test="$parent-package != $this-package">
1906N/A <
xsl:
element name="import">
1008N/A select="concat($parent-package, '.meta.', $parent-java-class, 'CfgDefn')" />
1008N/A <
xsl:
call-
template name="generate-meta-class-declaration" />
1008N/A <
xsl:
call-
template name="generate-meta-class-body" />
1906N/A <
xsl:
text>}
</
xsl:
text>