Coder Social home page Coder Social logo

gag's Introduction

Google Annotations Gallery

Build Status

The Google Annotations Gallery is an exciting new Java open source library that provides a rich set of annotations for developers to express themselves. Do you find the standard Java annotations dry and lackluster? Have you ever resorted to leaving messages to fellow developers with the @Deprecated annotation? Wouldn't you rather leave a @LOL or @Facepalm instead? If so, then this is the gallery for you.

Not only can you leave expressive remarks in your code, you can use these annotations to draw attention to your poetic endeavors. How many times have you written a palindromic or synecdochal line of code and wished you could annotate it for future readers to admire? Look no further than @Palindrome and @Synecdoche.

But wait, there's more. The Google Annotations Gallery comes complete with dynamic bytecode instrumentation. By using the gag-agent.jar Java agent, you can have your annotations behavior-enforced at runtime. For example, if you want to ensure that a method parameter is non-zero, try @ThisHadBetterNotBe(Property.ZERO). Want to completely inhibit a method's implementation? Try @Noop.

If we've whet your appetite for truly expressive annotations, then read on and immerse yourself in the Google Annotations Gallery.

Using

You can find the annotations and supporting enumerations in gag.jar. If you want to enforce the enforceable annotations, you can find the dynamic bytecode instrumentation Java agent in gag-agent.jar.

To use the annotations, simply annotate your code with them and include gag.jar in your classpath.

To use the Java agent: use at least JDK 5; use the -javaagent:gag-agent.jar option; and put the agent-dependent jars in your classpath, like:

java -javaagent:gag-agent.jar \
    -cp asm-3.1.jar:asm-commons-3.1.jar:google-collect-1.0.jar:gag.jar \
    MyAnnotatedClass

About this fork

This project is fork of GAG. Currently it has identical code with original GAG, but it will growth with new features in next release. You can read my article about in russian

GAG is already loaded to Maven Central

<dependency>
    <groupId>com.google.gag</groupId>
    <artifactId>gag</artifactId>
    <version>1.0.1</version>
</dependency>

<dependency>
    <groupId>com.google.gag</groupId>
    <artifactId>gag-agent</artifactId>
    <version>1.0.1</version>
</dependency>

But it is not mavenized yet instead of this fork. Now, GAG builded by Maven, thats a helps to resolve transitive dependencies. This version also is uploaded to Maven Central, here is dependency:

<dependency>
    <groupId>com.github.stokito</groupId>
    <artifactId>gag-annotations</artifactId>
    <version>1.0.1</version>
</dependency>

Take a look on demo application https://github.com/stokito/gag-demo

Everybody are wellcome to fork me ;)

See also

gag's People

Contributors

dependabot[bot] avatar stokito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gag's Issues

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.