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