public class ProxyHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
ProxyHelper.ProxyDecorator
An interface to decorate the
ProxyObject for some purposes, like
providing custom validation logic or adding extra handler on it. |
Constructor and Description |
---|
ProxyHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addIgnoredProxyClass(java.lang.Class<?> type)
Adds an ignored proxy class type.
|
static java.lang.String |
capitalize(java.lang.String prefix,
java.lang.String attr)
Internal use only.
|
static <T> T |
createFormProxy(T origin,
java.lang.Class<?> type)
Creates a proxy form object from the given origin object, if any.
|
static <T> T |
createFormProxy(T origin,
java.lang.Class<?> type,
java.lang.Class[] interfaces)
Creates a proxy form object from the given origin object, if any.
|
static <T> T |
createProxyIfAny(T origin)
Creates a proxy object from the given origin object, if any.
|
static <T> T |
createProxyIfAny(T origin,
java.lang.annotation.Annotation[] annotations)
Creates a proxy object from the given origin object, if any.
|
static <T> T |
getOriginObject(T origin)
Internal use only.
|
static boolean |
isImmutable(java.lang.Object origin)
Returns whether the given origin object is immutable.
|
static java.lang.String |
toAttrName(java.lang.reflect.Method method)
Internal use only.
|
static java.lang.String |
toAttrName(java.lang.reflect.Method method,
int prefix)
Internal use only.
|
static java.lang.String |
toGetter(java.lang.String attr)
Internal use only.
|
static java.lang.String |
toSetter(java.lang.String attr)
Internal use only.
|
public static <T> T createProxyIfAny(T origin)
origin
- public static <T> T createProxyIfAny(T origin, java.lang.annotation.Annotation[] annotations)
origin
- annotations
- the annotations of the caller method to indicate whether
the elements of the collection or Map type can proxy deeply, if any. (Optional)
Like ImmutableElements
public static void addIgnoredProxyClass(java.lang.Class<?> type)
Default it will apply these classes from the library property
org.zkoss.bind.proxy.IgnoredProxyClasses
public static boolean isImmutable(java.lang.Object origin)
public static <T> T getOriginObject(T origin)
public static <T> T createFormProxy(T origin, java.lang.Class<?> type)
origin
- the origin data objecttype
- the class type of the data objectpublic static <T> T createFormProxy(T origin, java.lang.Class<?> type, java.lang.Class[] interfaces)
origin
- the origin data objecttype
- the class type of the data objectinterfaces
- the interface type of the data object, if any.public static java.lang.String toSetter(java.lang.String attr)
public static java.lang.String toGetter(java.lang.String attr)
public static java.lang.String capitalize(java.lang.String prefix, java.lang.String attr)
public static java.lang.String toAttrName(java.lang.reflect.Method method, int prefix)
public static java.lang.String toAttrName(java.lang.reflect.Method method)
Copyright © 2005-2018 Potix Corporation. All Rights Reserved.