Package org.cyclos.impl.utils.formatting
Class DataTranslationProxy
- java.lang.Object
-
- org.cyclos.impl.utils.formatting.DataTranslationProxy
-
public class DataTranslationProxy extends Object
Proxies entities to use data translation instead of raw string values
-
-
Constructor Summary
Constructors Constructor Description DataTranslationProxy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends ProcessableForDataTranslation>
Tproxy(T input, DataTranslationHandler dataTranslationHandler)Returns a proxy capable of translating the given input.static <T extends ProcessableForDataTranslation>
Tproxy(T input, DataTranslationHandler dataTranslationHandler, Language language)Returns a proxy capable of translating the given input.static <T extends ProcessableForDataTranslation>
Tproxy(T input, DataTranslationHandler dataTranslationHandler, Language language, IdentityHashMap<Object,javassist.util.proxy.Proxy> resolved)Creates a proxy for the given input, allowing passing in the already resolved proxy instancesstatic <T> Tunproxy(Object input)Returns the "proxied" instance only if the given input is a an instance ofProxyobtained through one of the "proxy(...)" methods defined in this class.
-
-
-
Method Detail
-
proxy
public static final <T extends ProcessableForDataTranslation> T proxy(T input, DataTranslationHandler dataTranslationHandler)
Returns a proxy capable of translating the given input. A proxy (subclass) is returned, which handles getters for translatable properties by delegating them toDataTranslationHandler. Also, all fields which are also entities are proxied as well. The current language is used.
-
proxy
public static final <T extends ProcessableForDataTranslation> T proxy(T input, DataTranslationHandler dataTranslationHandler, Language language)
Returns a proxy capable of translating the given input. A proxy (subclass) is returned, which handles getters for translatable properties by delegating them toDataTranslationHandler. Also, all fields which are also entities are proxied as well. A custom language is used.
-
proxy
public static <T extends ProcessableForDataTranslation> T proxy(T input, DataTranslationHandler dataTranslationHandler, Language language, IdentityHashMap<Object,javassist.util.proxy.Proxy> resolved)
Creates a proxy for the given input, allowing passing in the already resolved proxy instances
-
unproxy
public static final <T> T unproxy(Object input)
Returns the "proxied" instance only if the given input is a an instance ofProxyobtained through one of the "proxy(...)" methods defined in this class. Otherwise it returns the input instance unchanged.
-
-