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 select="$this-local-properties[adm:syntax/adm:enumeration and not(adm:profile[@name='preprocessor']/adm:first-defined-in)]">
1008N/A <
xsl:
sort select="@name" />
1008N/A test="not(adm:profile[@name='preprocessor']/admpp:first-defined-in)">
1008N/A <
xsl:
call-
template name="generate-enumeration" />
1548N/A Define application tags if this is the root configuration. 1548N/A <
xsl:
if test="$this-is-root">
1548N/A <
xsl:
value-
of select="' // Define managed object tags.
'" />
1565N/A <
xsl:
value-
of select="' static {
'" />
1548N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Generate declarations 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-declaration" />
1008N/A Generate declarations 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-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" />
1548N/A <
xsl:
call-
template name="generate-relation-constructor" />
1548N/A Register any optins associated with this managed object definition. 1548N/A <
xsl:
if test="$this-is-advanced or $this-is-hidden">
1548N/A select="' // Register the options associated with this managed object definition.
'" />
1565N/A <
xsl:
value-
of select="' static {
'" />
1565N/A <
xsl:
if test="$this-is-advanced">
1548N/A <
xsl:
if test="$this-is-hidden">
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Register any tags associated with this managed object definition. 1008N/A select="' // Register the tags associated with this managed object definition.
'" />
1008N/A <
xsl:
value-
of select="' static {
'" />
1008N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A Register any constraints associated with this managed object definition. 1008N/A select="' // Register the constraints associated with this managed object definition.
'" />
1008N/A <
xsl:
value-
of select="' static {
'" />
1008N/A <
xsl:
apply-
templates select="adm:condition/*" 1008N/A mode="compile-condition" />
1008N/A <
xsl:
value-
of select="'));
'" />
1008N/A <
xsl:
value-
of select="' }
'" />
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.')" />
1008N/A <
xsl:
value-
of select="' */
'" />
1008N/A select="concat(' public static ', 1008N/A 'CfgDefn getInstance() {
', 1008N/A select="concat(' /**
', 1008N/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="' }
'" />
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 ', 1142N/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 all 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 all 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 name="generate-property-getter-implementation">
1008N/A <
xsl:
with-
param name="interface" select="'client'" />
1008N/A <
xsl:
call-
template name="generate-property-setter-implementation" />
1418N/A <
xsl:
for-
each select="$this-all-relations">
1418N/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 ManagedObjectAlreadyExistsException,
', 1089N/A ' MissingMandatoryPropertiesException, ConcurrentModificationException,
', 1008N/A ' OperationRejectedException, AuthorizationException,
', 1008N/A ' CommunicationException {
', 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;
')" />
1008N/A Private members for each property. 1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A select="concat(' // The value of the "', @name, '" property.
')" />
1008N/A <
xsl:
value-
of select="' private final '" />
1008N/A <
xsl:
when test="string(@multi-valued) != 'true'">
1008N/A The property is guaranteed to contain a value since there is a 1008N/A well-defined default value. 1008N/A name="get-property-java-primitive-type" />
1008N/A <
xsl:
when test="@mandatory = 'true'">
1008N/A The property is guaranteed to contain a value in the server interface. 1008N/A 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="' p'" />
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 select="concat(' // Private constructor.
', 1008N/A 'CfgServerImpl(ServerManagedObject<? extends ', $this-java-class, 'Cfg> impl) {
', 1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
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:
when test="string(@multi-valued) != 'true'">
1008N/A <
xsl:
value-
of select="' }
'" />
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 Getters for all properties. 1008N/A <
xsl:
for-
each select="$this-all-properties">
1008N/A <
xsl:
sort select="@name" />
1008N/A name="generate-property-getter-implementation">
1008N/A <
xsl:
with-
param name="interface" select="'server'" />
1008N/A <
xsl:
for-
each select="$this-all-relations">
1140N/A <
xsl:
sort select="@name" />
1008N/A <
xsl:
call-
template name="generate-server-relation-methods" />
1418N/A Configuration definition getter. 1418N/A select="concat(' /**
', 1008N/A ' public ManagedObjectDefinition<? extends ', $this-java-class,'CfgClient, ? extends ', $this-java-class,'Cfg> definition() {
', 1008N/A Server managed object getter. 1906N/A select="concat(' /**
', 1565N/A ' public ServerManagedObject<? extends ', $this-java-class,'Cfg> managedObject() {
', 1565N/A Configuration entry DN getter. 1565N/A select="concat(' /**
', 1008N/A <
xsl:
value-
of select="' }
'" />
1426N/A Generate a property definition constructor. 1426N/A <
xsl:
template name="generate-property-declaration">
1426N/A <
xsl:
variable name="java-prop-name">
1426N/A <
xsl:
call-
template name="name-to-java-constant">
1426N/A <
xsl:
with-
param name="value" select="@name" />
1426N/A <
xsl:
call-
template name="get-property-definition-type" />
1426N/A <
xsl:
variable name="generic-type">
1426N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1426N/A <
xsl:
variable name="pdtype">
1426N/A <
xsl:
when test="string-length($generic-type) != 0">
1426N/A select="concat($type, '<', $generic-type, '>')" />
1426N/A <
xsl:
value-
of select="$type" />
1426N/A select="concat(' // The "', 1426N/A '" property definition.
', 1426N/A ' private static final ', $pdtype, ' PD_', $java-prop-name, ';
')" />
1426N/A Generate a property definition constructor. 1426N/A <
xsl:
template name="generate-property-constructor">
1426N/A <
xsl:
variable name="java-prop-name">
1426N/A <
xsl:
call-
template name="name-to-java-constant">
1426N/A <
xsl:
with-
param name="value" select="@name" />
1426N/A <
xsl:
call-
template name="get-property-definition-type" />
1418N/A <
xsl:
variable name="generic-type">
1426N/A <
xsl:
call-
template name="get-property-definition-generic-type" />
1426N/A <
xsl:
variable name="value-type">
1426N/A <
xsl:
call-
template name="get-property-java-type" />
1426N/A select="concat(' // Build the "', @name, '" property definition.
', 1426N/A <
xsl:
when test="string-length($generic-type) != 0">
1426N/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="@multi-valued='true'">
1008N/A <
xsl:
if test="@read-only='true'">
1008N/A <
xsl:
if test="@monitoring='true'">
1008N/A <
xsl:
if test="@mandatory='true'">
1008N/A <
xsl:
if test="@hidden='true'">
1008N/A <
xsl:
if test="@advanced='true'">
1008N/A <
xsl:
variable name="action-type">
1008N/A <
xsl:
when test="adm:requires-admin-action">
1008N/A <
xsl:
call-
template name="name-to-java-constant">
1008N/A <
xsl:
with-
param name="value" 1008N/A select="local-name(adm:requires-admin-action/*)" />
1008N/A <
xsl:
value-
of select="'NONE'" />
1008N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 1008N/A 'new DefinedDefaultBehaviorProvider<', $value-type,'>(')" />
1008N/A select="concat('"', normalize-space(), '"')" />
1008N/A <
xsl:
if test="position() != last()">
1008N/A <
xsl:
value-
of select="', '" />
1008N/A <
xsl:
value-
of select="');
'" />
1008N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 1008N/A 'new RelativeInheritedDefaultBehaviorProvider<', $value-type,'>(')" />
1008N/A <
xsl:
variable name="managed-object-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" 1008N/A <
xsl:
variable name="property-name" 1008N/A <
xsl:
variable name="offset" 1893N/A select="concat(' DefaultBehaviorProvider<', $value-type,'> provider = ', 1893N/A 'new AbsoluteInheritedDefaultBehaviorProvider<', $value-type,'>(')" />
1893N/A <
xsl:
variable name="property-name" 1893N/A select="concat('"', $path, '", "', $property-name, '");
')" />
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unrecognized default behavior type for property "', @name, 1008N/A <
xsl:
call-
template name="get-property-definition-ctor" />
1893N/A <
xsl:
call-
template name="get-property-definition-post-ctor" />
1893N/A <
xsl:
value-
of select="' }
'" />
1893N/A Generate a relation definition declaration. 1893N/A <
xsl:
template name="generate-relation-declaration">
1893N/A <
xsl:
variable name="relation-name">
1884N/A <
xsl:
when test="adm:one-to-many">
1893N/A <
xsl:
value-
of select="adm:one-to-many/@plural-name" />
1893N/A <
xsl:
value-
of select="@name" />
1893N/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(' // The "', 1008N/A '" relation definition.
', 1008N/A ' private static final ')" />
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> RD_', $java-relation-name, ';
')" />
1008N/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 <
xsl:
variable name="java-relation-builder-type">
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('.Builder<', $java-managed-object-name, 'CfgClient, ', $java-managed-object-name, 'Cfg>')" />
1008N/A select="concat(' // Build the "', $relation-name, '" relation definition.
', 1008N/A ' ', $java-relation-builder-type, ' builder =
', 1008N/A ' new ', $java-relation-builder-type, '(INSTANCE, "', @name, '", ')" />
1008N/A <
xsl:
if test="adm:one-to-many">
1008N/A select="concat('"', adm:one-to-many/@plural-name, '", ')" />
1008N/A <
xsl:
if test="adm:one-to-many/@naming-property">
1008N/A <
xsl:
variable name="java-property-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" 1008N/A select="adm:one-to-many/@naming-property" />
1008N/A $java-property-name, 'PropertyDefinition());
')" />
1008N/A <
xsl:
for-
each select="*/adm:default-managed-object">
1008N/A <
xsl:
variable name="dmo-java-name">
1008N/A <
xsl:
call-
template name="name-to-java">
1008N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
1008N/A <
xsl:
value-
of select="' {
'" />
1008N/A $dmo-java-name, 'CfgClient, ', 1008N/A $dmo-java-name, 'CfgClient, ', 1008N/A $dmo-java-name, 'Cfg>(', 1008N/A <
xsl:
for-
each select="adm:property">
1008N/A <
xsl:
for-
each select="adm:value">
1008N/A select="concat(', "', normalize-space(), '"')" />
1008N/A <
xsl:
value-
of select="');
'" />
1008N/A <
xsl:
value-
of select="' }
'" />
1008N/A <
xsl:
if test="@advanced='true'">
1008N/A <
xsl:
if test="@hidden='true'">
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, '>')" />
1008N/A <
xsl:
value-
of select="$type" />
1008N/A select="concat(' /**
', 1008N/A '" property definition.
')" />
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">
1089N/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" />
1089N/A test="adm:profile[@name='preprocessor']/admpp:last-defined-in[@name=$this-name and @package=$this-package]">
1008N/A ' * @return Returns the "', 1008N/A '" property definition.
', 1008N/A 'PropertyDefinition() {
' , 1008N/A ' * @return Returns the "', 1008N/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(' /**
', 1418N/A '" relation definition.
', 1008N/A ' * @return Returns the "', 1008N/A '" relation definition.
', 1418N/A <
xsl:
when test="adm:one-to-one">
1418N/A <
xsl:
text>SingletonRelationDefinition<</
xsl:
text>
1426N/A <
xsl:
when test="adm:one-to-zero-or-one">
1418N/A <
xsl:
text>OptionalRelationDefinition<</
xsl:
text>
1418N/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:last-defined-in[@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();
', 1389N/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" />
1389N/A <
xsl:
variable name="java-class-name">
1389N/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(' /**
', 1389N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException {
', 1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1008N/A select="concat(' /**
', 1008N/A ' public boolean has', $java-relation-name, '() throws ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '()
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException {
', 1008N/A select="concat(' /**
', 1008N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', $java-relation-name, '(
', 1008N/A ' ManagedObjectDefinition<M, ? extends ', $java-class-name,'Cfg> d, Collection<DefaultBehaviorException> exceptions) {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, '()
', 1008N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,
', 1008N/A ' OperationRejectedException, AuthorizationException, CommunicationException {
', 1389N/A <
xsl:
when test="adm:one-to-many">
1389N/A <
xsl:
variable name="plural-name" 1389N/A select="adm:one-to-many/@plural-name" />
1389N/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 ' public String[] list', $java-relation-plural-name, '() throws ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException {
', 1008N/A select="concat(' /**
', 1008N/A ' public ', $java-class-name, 'CfgClient get', $java-relation-name, '(String name)
', 1389N/A ' throws DefinitionDecodingException, ManagedObjectDecodingException,
', 1389N/A ' ManagedObjectNotFoundException, ConcurrentModificationException,
', 1389N/A ' AuthorizationException, CommunicationException {
', 1008N/A select="concat(' /**
', 1008N/A ' public <M extends ', $java-class-name, 'CfgClient> M create', $java-relation-name, '(
', 1008N/A ' ManagedObjectDefinition<M, ? extends ', $java-class-name,'Cfg> d, String name, Collection<DefaultBehaviorException> exceptions) throws IllegalManagedObjectNameException {
', 1008N/A select="concat(' /**
', 1008N/A ' public void remove', $java-relation-name, '(String name)
', 1008N/A ' throws ManagedObjectNotFoundException, ConcurrentModificationException,
', 1008N/A ' OperationRejectedException, AuthorizationException, CommunicationException {
', 1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Unknown relation type "', local-name(*), '" in relation "', $name, '".')" />
1008N/A Generate server relation methods. 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:
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, 'Cfg get', 1008N/A $java-relation-name, '() throws ConfigException {
', 1008N/A <
xsl:
when test="adm:one-to-zero-or-one">
1008N/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="' *'" />
1141N/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;
'" />
1906N/A <
xsl:
value-
of select="' // Private constructor.
'" />
1906N/A <
xsl:
value-
of select="' private '" />
1906N/A <
xsl:
call-
template name="name-to-java">
1906N/A <
xsl:
with-
param name="value" select="@name" />
1906N/A ' public String toString() { return name; }
')" />
1906N/A <
xsl:
value-
of select="' }
'" />
1906N/A Main document parsing template. 1906N/A <!-- Perform some initial validation. 1906N/A <
xsl:
for-
each select="$this-all-properties">
1906N/A Check that all non-mandatory properties have a default behavior. 1906N/A test="not(@mandatory='true') and not(adm:default-behavior)">
1906N/A <
xsl:
message terminate="yes">
1906N/A select="concat('No default behavior defined for non-mandatory property "', @name, 1906N/A Check that all advanced properties conform to one of 1008N/A * is mandatory and has a defined default value(s) 1008N/A * is mandatory and is part of an advanced managed object 1008N/A * is mandatory and is part of an abstract managed object 1008N/A <
xsl:
when test="$this-is-advanced">
1418N/A <
xsl:
when test="$this-is-abstract">
1008N/A <
xsl:
when test="@advanced='true' and @mandatory='true'">
1008N/A <
xsl:
message terminate="yes">
1008N/A select="concat('Advanced property "', @name, 1008N/A '" must have defined or inherited default values.')" />
1008N/A Now generate the definition. 1418N/A <
xsl:
call-
template name="copyright-notice" />
1418N/A select="concat('package ', $this-package, '.meta;
')" />
1418N/A <
xsl:
call-
template name="generate-import-statements">
1418N/A <
xsl:
with-
param name="imports">
1418N/A <
xsl:
if test="not(boolean($this/@extends))">
1418N/A test="$this-local-properties[@multi-valued='true' or 1418N/A <
xsl:
if test="$this-local-properties">
1008N/A <
xsl:
if test="@managed-object-package != $this-package">
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, '.meta.', $java-class-name, 'CfgDefn')" />
1142N/A <
xsl:
element name="import">
1142N/A select="concat($this-package, '.client.', $this-java-class, 'CfgClient')" />
1142N/A <
xsl:
element name="import">
1142N/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:
with-
param name="interface" select="'server'" />
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">
1389N/A <
xsl:
variable name="java-class-name">
1418N/A <
xsl:
call-
template name="name-to-java">
1418N/A <
xsl:
with-
param name="value" 1418N/A select="@managed-object-name" />
1418N/A <
xsl:
element name="import">
1389N/A select="concat(@managed-object-package, '.client.', $java-class-name, 'CfgClient')" />
1389N/A <
xsl:
element name="import">
1389N/A select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
1389N/A test="$this-local-relations/*/adm:default-managed-object">
1008N/A select="$this-local-relations/*/adm:default-managed-object">
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">
1389N/A select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" />
1389N/A <
xsl:
element name="import">
1389N/A select="concat(@managed-object-package, '.meta.', $java-class-name, 'CfgDefn')" />
1389N/A test="$this-local-relations[@advanced='true' or @hidden='true']">
1418N/A <
xsl:
if test="$this-is-hidden or $this-is-advanced">
1389N/A <
xsl:
when test="$this-is-abstract">
1008N/A <
xsl:
if test="not($this-is-root)">
1008N/A 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>