Add JSON versioning capability

This PR add JSON versioning capability to VRaptor4.
One of the most strategies used for API versioning is through URI. 
With this PR, one can do API versioning allowing the controller to build a result based on URI parameter. 

A sample example of usage follows:
```java
@Get("/example/{version}")
public void example(String version) {
	Object response = new Object();
	result.use(Results.json()).version(version).from(response).serialize();
}
```

@adolfoweloy @andrelrs 
this is a better name!

On Wed, Oct 29, 2014 at 4:37 PM, Rodrigo Turini <notifications@github.com>
wrote:

> In
> vraptor-core/src/test/java/br/com/caelum/vraptor/serialization/gson/SinceExclusionStrategy.java:
>
> > +import com.google.gson.FieldAttributes;
> > +import com.google.gson.annotations.Since;
> > +
> > +public class SinceExclusionStrategy implements ExclusionStrategy {
> > +
> > +	@Override
> > +	public boolean shouldSkipField(FieldAttributes f) {
> > +		return f.getAnnotation(Since.class) == null;
> > +	}
> > +
> > +	@Override
> > +	public boolean shouldSkipClass(Class<?> clazz) {
> > +		return false;
> > +	}
> > +
> > +}
>
> Indeed. The SinceExclusionStrategy shouldn't be part of this feature (it
> can be
> useful for specific cases, but it's not that expected). But maybe we can
> leave the
> method setExclusionStrategies, what u think? So users can easily
> implement it.
>
> ps: If we keep it, I prefer renaming for something like withExclusions,
> just like:
>
>
> serialization.version(1.0).withExclusion(strategy).from(client).recursive().serialize();
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/caelum/vraptor4/pull/859/files#r19565885>.
>



-- 
Rafael Ponte
TriadWorks | Formação Java
http://cursos.triadworks.com.br