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 2362N/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 0N/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 ! Copyright 2008-2010 Sun Microsystems, Inc. 0N/A Templates for processing aggregation properties. 0N/A <
xsl:
template match="adm:aggregation" 0N/A mode="java-definition-imports">
0N/A <
xsl:
element name="import">
0N/A <
xsl:
call-
template name="get-definition-package" />
0N/A <
xsl:
value-
of select="'.client.'" />
0N/A <
xsl:
call-
template name="get-client-type" />
0N/A <
xsl:
element name="import">
0N/A <
xsl:
call-
template name="get-definition-package" />
0N/A <
xsl:
value-
of select="'.server.'" />
0N/A <
xsl:
call-
template name="get-server-type" />
0N/A <
xsl:
if test="../../@multi-valued = 'true'">
0N/A <
xsl:
template match="adm:aggregation" mode="java-value-type">
0N/A <
xsl:
value-
of select="'String'" />
0N/A <
xsl:
template match="adm:aggregation" mode="java-value-imports">
0N/A <
xsl:
param name="interface" select="/.." />
0N/A <
xsl:
if test="$interface = 'server'">
0N/A <
xsl:
template match="adm:aggregation" mode="java-definition-type">
0N/A <
xsl:
value-
of select="'AggregationPropertyDefinition'" />
0N/A <
xsl:
template match="adm:aggregation" 0N/A mode="java-definition-generic-type">
0N/A <
xsl:
call-
template name="get-client-type" />
0N/A <
xsl:
value-
of select="', '" />
0N/A <
xsl:
call-
template name="get-server-type" />
0N/A <
xsl:
template match="adm:aggregation" mode="java-definition-ctor">
0N/A <
xsl:
if test="not(@parent-path)">
0N/A <
xsl:
message terminate="yes">
0N/A select="concat('No parent-path defined for aggregation property ', ../../@name)" />
0N/A <
xsl:
if test="not(@relation-name)">
0N/A <
xsl:
message terminate="yes">
0N/A select="concat('No relation-name defined for aggregation property ', ../../@name)" />
0N/A normalize-space(@parent-path), '");
')" />
0N/A normalize-space(@relation-name), '");
')" />
0N/A <
xsl:
apply-
templates 0N/A mode="compile-condition" />
0N/A <
xsl:
value-
of select="');
'" />
0N/A mode="compile-condition" />
0N/A <
xsl:
value-
of select="');
'" />
0N/A <
xsl:
template match="adm:aggregation" 0N/A mode="java-definition-post-ctor">
0N/A <
xsl:
call-
template name="name-to-java-constant">
0N/A <
xsl:
with-
param name="value" select="../../@name" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
value-
of select="'.getSourceConstraint());
'" />
0N/A Generate property getter declaration(s). 0N/A <
xsl:
template match="adm:aggregation" 0N/A mode="java-property-getter-declaration">
0N/A <
xsl:
param name="interface" select="/.." />
0N/A name="generate-default-property-getter-declaration">
0N/A <
xsl:
with-
param name="interface" select="$interface" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
if test="$interface='server'">
0N/A <
xsl:
variable name="name" select="../../@name" />
0N/A <
xsl:
variable name="java-property-name">
0N/A <
xsl:
call-
template name="name-to-java">
0N/A <
xsl:
with-
param name="value" select="$name" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
variable name="comment">
0N/A <
xsl:
value-
of select="'<p>
'" />
0N/A <
xsl:
value-
of select="normalize-space(/adm:synopsis)" />
0N/A <
xsl:
value-
of select="'
'" />
0N/A <
xsl:
if test="/adm:description">
0N/A <
xsl:
value-
of select="'<p>
'" />
0N/A <
xsl:
value-
of select="normalize-space(/adm:description)" />
0N/A <
xsl:
value-
of select="'
'" />
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
when test="string(../../@multi-valued) != 'true'">
0N/A <
xsl:
call-
template name="add-java-comment2">
0N/A <
xsl:
with-
param name="indent" select="2" />
0N/A <
xsl:
with-
param name="content" 0N/A 'Gets the "', $name,'" property as a DN.
', 0N/A '@return Returns the DN value of the "', $name, '" property.
')" />
0N/A </
xsl:
call-
template>
0N/A select="concat(' DN get', $java-property-name, 'DN();
')" />
0N/A <
xsl:
call-
template name="add-java-comment2">
0N/A <
xsl:
with-
param name="indent" select="2" />
0N/A <
xsl:
with-
param name="content" 0N/A 'Gets the "', $name,'" property as a set of DNs.
', 0N/A '@return Returns the DN values of the "', $name, '" property.
')" />
0N/A </
xsl:
call-
template>
0N/A select="concat(' SortedSet<DN> get', $java-property-name, 'DNs();
')" />
0N/A Generate property getter implementation(s). 0N/A <
xsl:
template match="adm:aggregation" 0N/A mode="java-property-getter-implementation">
0N/A <
xsl:
param name="interface" select="/.." />
0N/A name="generate-default-property-getter-implementation">
0N/A <
xsl:
with-
param name="interface" select="$interface" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
if test="$interface='server'">
0N/A <
xsl:
variable name="name" select="../../@name" />
0N/A <
xsl:
variable name="java-property-name">
0N/A <
xsl:
call-
template name="name-to-java">
0N/A <
xsl:
with-
param name="value" select="$name" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
text>
</
xsl:
text>
0N/A <
xsl:
call-
template name="add-java-comment2">
0N/A <
xsl:
with-
param name="indent" select="4" />
0N/A <
xsl:
with-
param name="content" select="'{@inheritDoc}
'" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
when test="string(../../@multi-valued) != 'true'">
0N/A select="concat(' public DN get', $java-property-name, 'DN() {
')" />
0N/A select="concat(' String value = get', $java-property-name, '();
')" />
0N/A select="' if (value == null) return null;
'" />
0N/A select="concat(' return INSTANCE.get', $java-property-name, 'PropertyDefinition().getChildDN(value);
')" />
0N/A <
xsl:
value-
of select="' }
'" />
0N/A select="concat(' public SortedSet<DN> get', $java-property-name, 'DNs() {
')" />
0N/A select="concat(' SortedSet<String> values = get', $java-property-name, '();
')" />
0N/A select="' SortedSet<DN> dnValues = new TreeSet<DN>();
'" />
0N/A select="' for (String value : values) {
'" />
0N/A select="concat(' DN dn = INSTANCE.get', $java-property-name, 'PropertyDefinition().getChildDN(value);
')" />
0N/A <
xsl:
value-
of select="' }
'" />
0N/A <
xsl:
value-
of select="' return dnValues;
'" />
0N/A <
xsl:
value-
of select="' }
'" />
0N/A Gets the Java client configuration interface for the referenced type. 0N/A <
xsl:
template name="get-client-type">
0N/A <
xsl:
call-
template name="get-reference-type" />
0N/A <
xsl:
value-
of select="'CfgClient'" />
0N/A Gets the Java server configuration interface for the referenced type. 0N/A <
xsl:
template name="get-server-type">
0N/A <
xsl:
call-
template name="get-reference-type" />
0N/A <
xsl:
value-
of select="'Cfg'" />
0N/A Gets the Java definition configuration interface for the referenced type. 0N/A <
xsl:
template name="get-definition-type">
0N/A <
xsl:
call-
template name="get-reference-type" />
0N/A <
xsl:
value-
of select="'CfgDefn'" />
0N/A Gets the Java definition configuration package. 0N/A <
xsl:
template name="get-definition-package">
0N/A <
xsl:
when test="@managed-object-package">
0N/A <
xsl:
value-
of select="@managed-object-package" />
0N/A <
xsl:
value-
of select="$this-package" />
0N/A Gets the Java name for the referenced type. 0N/A <
xsl:
template name="get-reference-type">
0N/A <
xsl:
when test="@managed-object-name">
0N/A <
xsl:
call-
template name="name-to-java">
0N/A <
xsl:
with-
param name="value" select="@managed-object-name" />
0N/A </
xsl:
call-
template>
0N/A <
xsl:
call-
template name="name-to-java">
0N/A <
xsl:
with-
param name="value" select="@relation-name" />
0N/A </
xsl:
call-
template>