Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1878 | jmachado | 1 | package com.owlike.genson.ext; |
2 | |||
3 | import com.owlike.genson.GensonBuilder; |
||
4 | import com.owlike.genson.reflect.AbstractBeanDescriptorProvider.ContextualConverterFactory; |
||
5 | import com.owlike.genson.reflect.BeanDescriptorProvider; |
||
6 | import com.owlike.genson.reflect.BeanMutatorAccessorResolver; |
||
7 | import com.owlike.genson.reflect.BeanPropertyFactory; |
||
8 | import com.owlike.genson.reflect.PropertyNameResolver; |
||
9 | |||
10 | /** |
||
11 | * Bundles allow to package all kind of Genson customizations into a single module and register |
||
12 | * them all together. Extensions are registered using Genson.Builder. |
||
13 | * <p/> |
||
14 | * <pre> |
||
15 | * Genson genson = new GensonBuilder().with(new SuperCoolExtension()).create(); |
||
16 | * </pre> |
||
17 | * <p/> |
||
18 | * Extension configuration is mixed with user custom configuration (no way to distinguish them), |
||
19 | * however user custom config. has preference over bundle configuration. This means that you can |
||
20 | * override bundle configuration with custom one. |
||
21 | * <p/> |
||
22 | * |
||
23 | * <b>Important note, bundles must be registered after any other configuration.</b> |
||
24 | * |
||
25 | * This part of the API is still in beta, it could change in the future in order to make it more |
||
26 | * powerful. |
||
27 | * |
||
28 | * @author eugen |
||
29 | */ |
||
30 | public abstract class GensonBundle { |
||
31 | /** |
||
32 | * This method does not provide any guarantee to when it is called: before user config, during, |
||
33 | * or after. Thus it should not rely on accessor methods from GensonBuilder they might not reflect |
||
34 | * the final configuration. Use the builder to register your components. |
||
35 | */ |
||
36 | public abstract void configure(GensonBuilder builder); |
||
37 | |||
38 | public BeanDescriptorProvider createBeanDescriptorProvider(ContextualConverterFactory contextualConverterFactory, |
||
39 | BeanPropertyFactory propertyFactory, |
||
40 | BeanMutatorAccessorResolver propertyResolver, |
||
41 | PropertyNameResolver nameResolver, |
||
42 | GensonBuilder builder) { |
||
43 | return null; |
||
44 | } |
||
45 | } |