<commit_before><?xml version="1.0" encoding="US-ASCII"?>
<!--
 -*- mode: Fundamental; tab-width: 4; -*-
 ex:ts=4

 $Id$
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:param name="xins_home"    />
	<xsl:param name="project_home" />
	<xsl:param name="specsdir"     />
	<xsl:param name="package"      />

	<xsl:variable name="api" select="//api/@name" />

	<xsl:output method="text" />

	<xsl:include href="../hungarian.xslt" />
	<xsl:include href="../java.xslt" />
	<xsl:include href="../rcs.xslt"  />

	<xsl:template match="api">
		<xsl:apply-templates select="impl-java" />
	</xsl:template>

	<xsl:template match="impl-java">

		<xsl:call-template name="java-header" />
		<xsl:text>package </xsl:text>
		<xsl:value-of select="$package" />
		<xsl:text>;</xsl:text>
		<xsl:text><![CDATA[

import java.io.IOException;
import java.util.Map;
import org.xins.server.API;
import org.xins.server.CallContext;

/**
 * Implementation of <code>]]></xsl:text>
		<xsl:value-of select="$api" />
		<xsl:text><![CDATA[</code> API.
 */
public class APIImpl extends API {

   //-------------------------------------------------------------------------
   // Class functions
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Class fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Constructors
   //-------------------------------------------------------------------------

   /**
    * Constructs a new <code>APIImpl</code> instance.
    */
   public APIImpl() {
]]></xsl:text>
		<xsl:for-each select="instance">
			<xsl:text>      </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = new </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text>()</xsl:text>
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="property">
			<xsl:text>      _</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = </xsl:text>
			<xsl:if test="@class = 'java.lang.String'">"</xsl:if>
			<xsl:value-of select="text()" />
			<xsl:if test="@class = 'java.lang.String'">"</xsl:if>
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="//api/function">
			<xsl:text>      _function</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = new </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>Impl(this);&#10;</xsl:text>
		</xsl:for-each>
		<xsl:text>   }
		

   //-------------------------------------------------------------------------
   // Fields
   //-------------------------------------------------------------------------

</xsl:text>
		<xsl:for-each select="instance">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text> </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="property">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text> _</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="//api/function">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> _function</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:text>

   //-------------------------------------------------------------------------
   // Methods
   //-------------------------------------------------------------------------
<commit_msg>Initialising every instance using the init() method.<commit_after><?xml version="1.0" encoding="US-ASCII"?>
<!--
 -*- mode: Fundamental; tab-width: 4; -*-
 ex:ts=4

 $Id$
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:param name="xins_home"    />
	<xsl:param name="project_home" />
	<xsl:param name="specsdir"     />
	<xsl:param name="package"      />

	<xsl:variable name="api" select="//api/@name" />

	<xsl:output method="text" />

	<xsl:include href="../hungarian.xslt" />
	<xsl:include href="../java.xslt" />
	<xsl:include href="../rcs.xslt"  />

	<xsl:template match="api">
		<xsl:apply-templates select="impl-java" />
	</xsl:template>

	<xsl:template match="impl-java">

		<xsl:call-template name="java-header" />
		<xsl:text>package </xsl:text>
		<xsl:value-of select="$package" />
		<xsl:text>;</xsl:text>
		<xsl:text><![CDATA[

import java.io.IOException;
import java.util.Map;
import org.xins.server.API;
import org.xins.server.CallContext;

/**
 * Implementation of <code>]]></xsl:text>
		<xsl:value-of select="$api" />
		<xsl:text><![CDATA[</code> API.
 */
public class APIImpl extends API {

   //-------------------------------------------------------------------------
   // Class functions
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Class fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Constructors
   //-------------------------------------------------------------------------

   /**
    * Constructs a new <code>APIImpl</code> instance.
    */
   public APIImpl() {
]]></xsl:text>
		<xsl:for-each select="instance">
			<xsl:text>      </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = new </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text>()</xsl:text>
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="property">
			<xsl:text>      _</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = </xsl:text>
			<xsl:if test="@class = 'java.lang.String'">"</xsl:if>
			<xsl:value-of select="text()" />
			<xsl:if test="@class = 'java.lang.String'">"</xsl:if>
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="//api/function">
			<xsl:text>      _function</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> = new </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>Impl(this);&#10;</xsl:text>
		</xsl:for-each>
		<xsl:text>   }
		

   //-------------------------------------------------------------------------
   // Fields
   //-------------------------------------------------------------------------

</xsl:text>
		<xsl:for-each select="instance">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text> </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="property">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@class" />
			<xsl:text> _</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="//api/function">
			<xsl:text>   private final </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text> _function</xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>;&#10;</xsl:text>
		</xsl:for-each>
		<xsl:text>

   //-------------------------------------------------------------------------
   // Methods
   //-------------------------------------------------------------------------

   public void init(Properties properties)
   throws Throwable {</xsl:text>
		<xsl:for-each select="document($impllist_file)/impllist/impl[@api=$api]/instance">
			<xsl:text>
      </xsl:text>
			<xsl:value-of select="@name" />
			<xsl:text>.init(properties);</xsl:text>
		</xsl:for-each>
		<xsl:text>
   }

{'fraction_non_alphanumeric': 0.3833966217100956, 'fraction_numerical': 0.0060233075815110644, 'mean_word_length': 1.6328852119958635, 'pattern_counts': {'":': 0, '<': 216, '<?xml version=': 2, '>': 216, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '513993', 'n_tokens_mistral': 2887, 'n_tokens_neox': 2396, 'n_words': 364}