text:
package com.chequer.axboot.core.model.extract.template;

import com.chequer.axboot.core.code.AXBootTypes;
import com.chequer.axboot.core.config.AXBootContextConfig;
import com.chequer.axboot.core.model.extract.metadata.Table;
import com.chequer.axboot.core.model.extract.template.fields.EntityFields;
import com.chequer.axboot.core.model.extract.template.fields.KeyFields;
import com.chequer.axboot.core.model.extract.template.fields.VOFields;
import com.chequer.axboot.core.model.extract.template.file.*;
import com.chequer.axboot.core.utils.NamingUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.StrSubstitutor;
import org.springframework.core.io.ClassPathResource;

import java.util.HashMap;
import java.util.Map;

public class TemplateParser {

    public static String getTemplate(String type) {
        try {
            switch (type) {
                case Templates.COMPOSITE_KEY_ENTITY_CLASS_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/ComposeKeyEntityTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.SINGLE_KEY_ENTITY_CLASS_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/EntityTemplates.tpl").getInputStream(), "UTF-8");

                case Templates.SERVICE_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/ServiceTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.REPOSITORY_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/RepositoryTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.CONTROLLER_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/ControllerTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.VO_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/VOTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.MYBATIS_INTERFACE_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/MyBatisInterfaceTemplate.tpl").getInputStream(), "UTF-8");

                case Templates.MYBATIS_XML_TEMPLATE:
                    return IOUtils.toString(new ClassPathResource("/template/MyBatisXMLTemplate.tpl").getInputStream(), "UTF-8");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return "";
    }

    public static EntityTemplateCode getEntityTemplate(String className, Table table) {
        return getEntityTemplate(className, table, "");
    }

    public static EntityTemplateCode getEntityTemplate(String className, Table table, String targetPackageName) {
        String template = getTemplate(Templates.SINGLE_KEY_ENTITY_CLASS_TEMPLATE);

        EntityFields entityFields = TemplateBuilder.EntityTemplateBuilder.build(table);

        Map<String, String> templateElements = new HashMap<>();

        templateElements.put(TemplateKeys.TABLE_NAME, table.getTableName());
        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.TABLE_COMMENT, table.getRemarks());
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.ENTITY_CLASS_FIELD_NAME, NamingUtils.classFieldName(className));
        templateElements.put(TemplateKeys.KEY_CLASS_REF_NAME, table.keyClassRefName(className));
        templateElements.put(TemplateKeys.KEY_CLASS_NAME, table.keyClassName(className));
        templateElements.put(TemplateKeys.RETURN_KEY_NAME, table.returnKeyName());
        templateElements.put(TemplateKeys.ENTITY_FIELDS, entityFields.getCode());
        templateElements.put(TemplateKeys.IMPORT_PACKAGES, entityFields.getImportPackages());
        templateElements.put(TemplateKeys.ANNOTATIONS, entityFields.getAnnotations());

        if (table.keyType().equals(Table.Key.COMPOSITE)) {
            template = getTemplate(Templates.COMPOSITE_KEY_ENTITY_CLASS_TEMPLATE);

            KeyFields keyFields = TemplateBuilder.KeyTemplateBuilder.build(table);
            templateElements.put(TemplateKeys.KEY_FIELDS, keyFields.getCode());
        }

        return EntityTemplateCode.of(new StrSubstitutor(templateElements).replace(template), NamingUtils.classFileName(className));
    }

    public static ServiceTemplateCode getServiceTemplate(String className, Table table) {
        return getServiceTemplate(className, table, "");
    }

    public static ServiceTemplateCode getServiceTemplate(String className, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.KEY_CLASS_REF_NAME, table.keyClassRefName(className));
        templateElements.put(TemplateKeys.KEY_CLASS_NAME, table.keyClassName(className));
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.SERVICE_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.SERVICE));
        templateElements.put(TemplateKeys.REPOSITORY_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.REPOSITORY));
        templateElements.put(TemplateKeys.REPOSITORY_CLASS_FIELD_NAME, NamingUtils.classFieldNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.REPOSITORY));

        return ServiceTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.SERVICE_TEMPLATE)), NamingUtils.classFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.SERVICE));
    }

    public static RepositoryTemplateCode getRepositoryTemplate(String className, Table table) {
        return getRepositoryTemplate(className, table, "");
    }

    public static RepositoryTemplateCode getRepositoryTemplate(String className, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.KEY_CLASS_REF_NAME, table.keyClassRefName(className));
        templateElements.put(TemplateKeys.KEY_CLASS_NAME, table.keyClassName(className));
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.REPOSITORY_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.REPOSITORY));

        return RepositoryTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.REPOSITORY_TEMPLATE)), NamingUtils.classFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.REPOSITORY));
    }

    public static VOTemplateCode getVoTemplate(String className, Table table) {
        return getVoTemplate(className, table, "");
    }

    public static VOTemplateCode getVoTemplate(String className, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        VOFields voFields = TemplateBuilder.VOTemplateBuilder.build(table);

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.ENTITY_CLASS_FIELD_NAME, NamingUtils.classFieldName(className));
        templateElements.put(TemplateKeys.VO_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.VO));
        templateElements.put(TemplateKeys.VO_CLASS_FIELD_NAME, NamingUtils.classFieldNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.VO));
        templateElements.put(TemplateKeys.VO_FIELDS, voFields.getCode());
        templateElements.put(TemplateKeys.IMPORT_PACKAGES, voFields.getImportPackages());

        return VOTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.VO_TEMPLATE)), NamingUtils.classFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.VO));
    }

    public static ControllerTemplateCode getControllerTemplate(String className, String apiPath, Table table) {
        return getControllerTemplate(className, apiPath, table, "");
    }

    public static ControllerTemplateCode getControllerTemplate(String className, String apiPath, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        if (StringUtils.isEmpty(apiPath)) {
            apiPath = NamingUtils.classFieldName(className) + "s";
        }

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.CONTROLLER_PACKAGE_NAME, AXBootContextConfig.getInstance().getControllerPackageName());
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.API_PATH, apiPath);
        templateElements.put(TemplateKeys.ENTITY_CLASS_FIELD_NAME, NamingUtils.classFieldName(className));
        templateElements.put(TemplateKeys.CONTROLLER_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.CONTROLLER));
        templateElements.put(TemplateKeys.SERVICE_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.SERVICE));
        templateElements.put(TemplateKeys.SERVICE_CLASS_FIELD_NAME, NamingUtils.classFieldNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.SERVICE));

        return ControllerTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.CONTROLLER_TEMPLATE)), NamingUtils.classFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.CONTROLLER));
    }

    public static MyBatisInterfaceTemplateCode getMyBatisInterfaceTemplate(String className, Table table) {
        return getMyBatisInterfaceTemplate(className, table, "");
    }

    public static MyBatisInterfaceTemplateCode getMyBatisInterfaceTemplate(String className, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.TABLE_NAME, table.getTableName());
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.ENTITY_CLASS_FIELD_NAME, NamingUtils.classFieldName(className));
        templateElements.put(TemplateKeys.MYBATIS_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));
        templateElements.put(TemplateKeys.MYBATIS_CLASS_FIELD_NAME, NamingUtils.classFieldNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));

        return MyBatisInterfaceTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.MYBATIS_INTERFACE_TEMPLATE)), NamingUtils.classFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));
    }

    public static MyBatisXMLTemplateCode getMyBatisXMLTemplate(String className, Table table) {
        return getMyBatisXMLTemplate(className, table, "");
    }

    public static MyBatisXMLTemplateCode getMyBatisXMLTemplate(String className, Table table, String targetPackageName) {
        Map<String, String> templateElements = new HashMap<>();

        templateElements.put(TemplateKeys.BASE_PACKAGE_NAME, AXBootContextConfig.getInstance().getBasePackageName());
        templateElements.put(TemplateKeys.DOMAIN_PACKAGE_NAME, AXBootContextConfig.getInstance().getDomainPackageName());
        templateElements.put(TemplateKeys.TABLE_NAME, table.getTableName());
        templateElements.put(TemplateKeys.ENTITY_CLASS_NAME, className);
        templateElements.put(TemplateKeys.TARGET_PACKAGE_NAME, targetPackageName);
        templateElements.put(TemplateKeys.ENTITY_CLASS_FIELD_NAME, NamingUtils.classFieldName(className));
        templateElements.put(TemplateKeys.MYBATIS_CLASS_NAME, NamingUtils.classNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));
        templateElements.put(TemplateKeys.MYBATIS_CLASS_FIELD_NAME, NamingUtils.classFieldNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));
        templateElements.put(TemplateKeys.SELECT_COLUMNS, table.selectQueryFields());
        templateElements.put(TemplateKeys.COLUMNS, table.queryFields());
        templateElements.put(TemplateKeys.VALUES, table.queryValues());
        templateElements.put(TemplateKeys.SET_COLUMNS, table.setColumns());
        templateElements.put(TemplateKeys.ID_WHERE, table.idWhere());

        return MyBatisXMLTemplateCode.of(new StrSubstitutor(templateElements).replace(getTemplate(Templates.MYBATIS_XML_TEMPLATE)), NamingUtils.xmlFileNameWithType(className, AXBootTypes.ModelExtractorTemplateSuffix.MYBATIS));
    }
}


text:
<?php

namespace Bolt\Tests\Events;

use Bolt\Events\ControllerEvents;
use Bolt\Tests\BoltUnitTest;

/**
 * Class to test Bolt\Events\ControllerEvents.
 *
 * @author Gawain Lynch <gawain.lynch@gmail.com>
 */
class ControllerEventsTest extends BoltUnitTest
{
    public function testConstant()
    {
        $this->assertSame('controller.mount', ControllerEvents::MOUNT);
    }

    public function testSingletonConstructor()
    {
        $reflection = new \ReflectionClass(ControllerEvents::class);
        $method = $reflection->getMethod('__construct');

        $this->assertTrue($method->isConstructor());
        $this->assertTrue($method->isPrivate());
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace SharpVectors.Dom.Svg
{
	/// <summary>
	/// Used for the various attributes which specify a set of
	/// transformations, such as the transform attribute which is
	/// available for many of Svg's elements, and which can be animated.
	/// </summary>
	/// <developer>niklas@protocol7.com</developer>
	/// <developer>kevin@kevlindev.com</developer>
	/// <completed>100</completed>
	public class SvgAnimatedTransformList : ISvgAnimatedTransformList
	{
		#region Private Fields
		private SvgTransformList baseVal;
		private SvgTransformList animVal;
		#endregion

		#region Constructors
		public SvgAnimatedTransformList(string transform)
		{
			baseVal = new SvgTransformList(transform);
			animVal = baseVal;
		}
		#endregion

        #region ISvgAnimagedTransformList Interface
		public ISvgTransformList BaseVal
		{
			get { return baseVal; }
		}

		public ISvgTransformList AnimVal
		{
			get { return animVal; }
		}
		#endregion
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.burningduck</groupId>
    <artifactId>spring-social-gitlab-demo</artifactId>
    <version>0.0.3-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>spring-social-gitlab-demo</name>
    <description>Demo project for Spring Social Gitlab</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <start-class>com.github.burningduck.SpringSocialGitlabDemoApplication</start-class>
        <java.version>1.7</java.version>
    </properties>

    <dependencies>

        <!-- Spring Boot -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
			<groupId>org.thymeleaf.extras</groupId>
			<artifactId>thymeleaf-extras-springsecurity3</artifactId>
		</dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
        </dependency>

        <!-- Spring Social -->
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.social</groupId>
            <artifactId>spring-social-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.burningduck</groupId>
            <artifactId>spring-social-gitlab</artifactId>
            <version>0.0.6-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>