Git Product home page Git Product logo

spring-polyglot's Introduction

Welcome to Spring Polyglot!

This repository is a collection of "just for fun" composed annotations for use with the Spring Framework.

The goal of this project is to demonstrate the power of composed annotations and the use of @AliasFor for overriding attributes in meta-annotations by translating common Spring annotations into different languages. In this context, the term polyglot therefore refers to spoken languages, not programming languages.

And who knows...? Perhaps some of these translated annotations will someday make it into the Spring Framework.


Languages Represented

The following languages currently have one or more translated annotations that have been submitted to this project.


Examples

German

For example, the following is what an integration test in Spring can look like when @ContextConfiguration is translated into German. Yes, this test actually runs: see DeutscheIntegrationsTests for details.

@Kontextkonfiguration(
	Konfigurationsklassen = { LokaleTestkonfiguration.class },
	XmlDateienOderGroovySkripte = { /* keine */ },
	RessourcenErben = falsch,
	Initialisierungsprogramme = { /* keine */ },
	InitialisierungsprogrammeErben = falsch,
	Ladeprogramm = AnnotationConfigContextLoader.class,
	Name = "In diesem Fall spielt der Name keine Rolle."
)
public final class DeutscheIntegrationsTests {

	@AutomatischVerdrahtet(erforderlich = jawohl)
	private String Nachricht;

	@Test
	public void nachrichtPrüfen() {
		esWirdErwartetDass(Nachricht, istGleich("Alles in Ordnung"));
	}

	@Konfiguration
	static class LokaleTestkonfiguration {

		@Bohne
		String Nachricht() {
			return "Alles in Ordnung";
		}
	}

}

Hipster

Yes, this test actually runs: see HipsterTests for details.

@RunWith(SpringFoo.class)
@Konfigz(klassez = Konfig.class, listenToYoParents = false, whoDat = "Not I said the fly")
public class HipsterTests {

	@Autowired
	String message;

	@Test
	public void checkItOut() {
		assertEquals("Keepin' it real!", message);
	}

}

Contributing

Feel free to contribute your own translated annotations by submitting pull requests to this repository.

Contributor License Agreement

Although the spring-polyglot project is currently just for demonstration purposes, there is a slight chance that annotations from this project will eventually be incorporated into official Spring projects. In order to have your pull requests accepted, we therefore ask that you sign the Contributor License Agreement and document that you have done so in the commit message or comments of your pull request.

License

The Spring Polyglot project is released under version 2.0 of the Apache License.

See Also


Building from Source

Spring Polyglot uses a Gradle-based build system. In the instructions below, ./gradlew is invoked from the root of the project and serves as a cross-platform, self-contained bootstrap mechanism for the build.

Prerequisites

Annotations in the spring-polyglot project rely on @AliasFor which was introduced in Spring Framework 4.2 and therefore require at least Spring Framework 4.2.1 to work properly.

Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder extracted from the JDK download.

Compile and Test

Build all JARs, distribution ZIP files, and docs:

./gradlew build

Install spring-polyglot in local Maven repository

./gradlew install


spring-polyglot's People

Contributors

sbrannen avatar ttddyy avatar neiser avatar marcingrzejszczak avatar mp911de avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.