| | |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:call-template name="generate-property-getter"> |
| | | <xsl:call-template name="generate-property-getter-implementation"> |
| | | <xsl:with-param name="interface" select="'client'" /> |
| | | </xsl:call-template> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:call-template name="generate-property-setter" /> |
| | | <xsl:call-template name="generate-property-setter-implementation" /> |
| | | </xsl:for-each> |
| | | <!-- |
| | | Relation methods. |
| | |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:call-template name="generate-property-getter"> |
| | | <xsl:call-template name="generate-property-getter-implementation"> |
| | | <xsl:with-param name="interface" select="'server'" /> |
| | | </xsl:call-template> |
| | | </xsl:for-each> |
| | |
| | | </xsl:choose> |
| | | </xsl:template> |
| | | <!-- |
| | | 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" /> |
| | | </xsl:call-template> |
| | | </xsl:variable> |
| | | <xsl:value-of |
| | | select="concat(' /**
', |
| | | ' * {@inheritDoc}
', |
| | | ' */
', |
| | | ' public ')" /> |
| | | <xsl:choose> |
| | | <xsl:when test="string(@multi-valued) != 'true'"> |
| | | <xsl:choose> |
| | | <xsl:when test="adm:default-behavior/adm:defined"> |
| | | <!-- |
| | | 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" /> |
| | | </xsl:when> |
| | | <xsl:when |
| | | 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 |
| | | have been created yet. |
| | | --> |
| | | <xsl:call-template name="get-property-java-primitive-type" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:call-template name="get-property-java-type" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:value-of select="'SortedSet<'" /> |
| | | <xsl:call-template name="get-property-java-type" /> |
| | | <xsl:value-of select="'>'" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | <xsl:choose> |
| | | <xsl:when test="adm:syntax/adm:boolean"> |
| | | <xsl:value-of select="' is'" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:value-of select="' get'" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | <xsl:choose> |
| | | <xsl:when test="string(@multi-valued) != 'true'"> |
| | | <xsl:value-of |
| | | select="concat($java-prop-name, '() {
', |
| | | ' return impl.getPropertyValue', |
| | | '(INSTANCE.get', $java-prop-name , |
| | | 'PropertyDefinition());
' , |
| | | ' }
')" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:value-of |
| | | select="concat($java-prop-name, '() {
', |
| | | ' return impl.getPropertyValues', |
| | | '(INSTANCE.get', $java-prop-name , |
| | | 'PropertyDefinition());
' , |
| | | ' }
')" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:template> |
| | | <!-- |
| | | 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" /> |
| | | </xsl:call-template> |
| | | </xsl:variable> |
| | | <xsl:value-of |
| | | select="concat(' /**
', |
| | | ' * {@inheritDoc}
', |
| | | ' */
', |
| | | ' public void set', |
| | | $java-prop-name , |
| | | '(')" /> |
| | | <xsl:choose> |
| | | <xsl:when test="not(@multi-valued='true')"> |
| | | <xsl:choose> |
| | | <xsl:when test="@mandatory='true'"> |
| | | <xsl:call-template |
| | | name="get-property-java-primitive-type" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:call-template name="get-property-java-type" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | <xsl:value-of select="' value)'" /> |
| | | <xsl:if test="@read-only='true'"> |
| | | <xsl:value-of |
| | | select="' throws PropertyIsReadOnlyException'" /> |
| | | </xsl:if> |
| | | <xsl:value-of |
| | | select="concat(' {
' , |
| | | ' impl.setPropertyValue(INSTANCE.get', |
| | | $java-prop-name , |
| | | 'PropertyDefinition(), value);
', |
| | | ' }
')" /> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:value-of select="'Collection<'" /> |
| | | <xsl:call-template name="get-property-java-type" /> |
| | | <xsl:value-of |
| | | select="concat('> values) {
' , |
| | | ' impl.setPropertyValues(INSTANCE.get', |
| | | $java-prop-name , |
| | | 'PropertyDefinition(), values);
', |
| | | ' }
')" /> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:if> |
| | | </xsl:template> |
| | | <!-- |
| | | Generate client relation methods. |
| | | --> |
| | | <xsl:template name="generate-client-relation-methods"> |
| | |
| | | <import> |
| | | org.opends.server.admin.AbsoluteInheritedDefaultBehaviorProvider |
| | | </import> |
| | | <import>org.opends.server.admin.ManagedObjectPath</import> |
| | | </xsl:if> |
| | | <xsl:if |
| | | test="$this-local-properties/adm:default-behavior/adm:inherited/adm:relative"> |
| | |
| | | select="concat($this-package, '.server.', $this-java-class, 'Cfg')" /> |
| | | </xsl:element> |
| | | <xsl:for-each select="$this-inherited-properties"> |
| | | <xsl:call-template name="get-property-java-imports" /> |
| | | <xsl:call-template name="get-property-java-imports"> |
| | | <xsl:with-param name="interface" select="'server'" /> |
| | | </xsl:call-template> |
| | | </xsl:for-each> |
| | | <xsl:for-each select="$this-all-properties"> |
| | | <xsl:call-template |