// Import framework stuff
use Org\Mxchange\CoreFramework\Generic\BaseDecorator;
use Org\Mxchange\CoreFramework\Response\Responseable;
-use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
+use Org\Mxchange\CoreFramework\Template\Xml\CompileableXmlTemplate;
+use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
/**
* A decorator for XML template engines which rewrites the XML for compacting
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableTemplate {
- /**
- * Template engine instance
- */
- private $templateInstance = NULL;
+class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableXmlTemplate {
+ // Load traits
+ use CompileableTemplateTrait;
/**
* Protected constructor
/**
* Creates an instance of the class TemplateEngine and prepares it for usage
*
- * @param $innerTemplateInstance A CompileableTemplate instance
+ * @param $innerTemplateInstance A CompileableXmlTemplate instance
* @return $templateInstance An instance of TemplateEngine
*/
- public static final function createXmlRewriterTemplateDecorator (CompileableTemplate $innerTemplateInstance) {
+ public static final function createXmlRewriterTemplateDecorator (CompileableXmlTemplate $innerTemplateInstance) {
// Get a new instance
$templateInstance = new XmlRewriterTemplateDecorator();
return $templateInstance;
}
- /**
- * Setter for template engine instances
- *
- * @param $templateInstance An instance of a template engine class
- * @return void
- */
- protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
- $this->templateInstance = $templateInstance;
- }
-
- /**
- * Getter for template engine instances
- *
- * @return $templateInstance An instance of a template engine class
- */
- protected final function getTemplateInstance () {
- return $this->templateInstance;
- }
-
/**
* Settter for variable group
*
* @return void
* @todo Find something useful with this!
*/
- public function characterHandler ($resource, $characters) {
+ public function characterHandler ($resource, string $characters) {
// Call the inner class' method but trim the characters before
$this->getTemplateInstance()->characterHandler($resource, trim($characters));
}