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