T
- the type parameterE
- the type parameterpublic abstract class BaseJavetReflectionProxyHandler<T,E extends java.lang.Exception> extends BaseJavetProxyHandler<T,E>
IJavetDirectCallable.DirectCall, IJavetDirectCallable.GetterAndNoThis<E extends java.lang.Exception>, IJavetDirectCallable.GetterAndThis<E extends java.lang.Exception>, IJavetDirectCallable.NoThisAndNoResult<E extends java.lang.Exception>, IJavetDirectCallable.NoThisAndResult<E extends java.lang.Exception>, IJavetDirectCallable.SetterAndNoThis<E extends java.lang.Exception>, IJavetDirectCallable.SetterAndThis<E extends java.lang.Exception>, IJavetDirectCallable.ThisAndNoResult<E extends java.lang.Exception>, IJavetDirectCallable.ThisAndResult<E extends java.lang.Exception>
Modifier and Type | Field and Description |
---|---|
protected ClassDescriptor |
classDescriptor
The Class descriptor.
|
protected static java.lang.String[] |
GETTER_PREFIX_ARRAY
The constant GETTER_PREFIX_ARRAY.
|
protected static java.util.regex.Pattern |
PATTERN_CAPITALIZED_PREFIX
The constant PATTERN_CAPITALIZED_PREFIX.
|
protected static java.lang.String[] |
SETTER_PREFIX_ARRAY
The constant SETTER_PREFIX_ARRAY.
|
callbackContexts, targetObject, v8Runtime
FUNCTION_NAME_TO_JSON, FUNCTION_NAME_TO_V8_VALUE, PROXY_FUNCTION_NAME_APPLY, PROXY_FUNCTION_NAME_CONSTRUCT, PROXY_FUNCTION_NAME_DELETE_PROPERTY, PROXY_FUNCTION_NAME_GET, PROXY_FUNCTION_NAME_GET_OWN_PROPERTY_DESCRIPTOR, PROXY_FUNCTION_NAME_GET_PROTOTYPE_OF, PROXY_FUNCTION_NAME_HAS, PROXY_FUNCTION_NAME_OWN_KEYS, PROXY_FUNCTION_NAME_SET
Constructor and Description |
---|
BaseJavetReflectionProxyHandler(V8Runtime v8Runtime,
T targetObject)
Instantiates a new Base javet reflection proxy handler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMethod(java.lang.reflect.Method method,
int startIndex,
java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> map)
Add method.
|
protected static <E extends java.lang.reflect.AccessibleObject> |
execute(IJavetReflectionObjectFactory reflectionObjectFactory,
java.lang.Object targetObject,
V8ValueObject thisObject,
java.util.List<E> executables,
JavetVirtualObject[] javetVirtualObjects)
Execute.
|
V8Value |
get(V8Value target,
V8Value property,
V8Value receiver)
handler.get()
The handler.get() method is a trap for the [[Get]] object internal method,
which is used by operations such as property accessors.
|
protected V8Value |
getByField(V8Value property)
Gets by field.
|
protected V8Value |
getByGetter(V8Value property)
Gets by getter.
|
protected V8Value |
getByMethod(V8Value target,
V8Value property)
Gets by method.
|
protected int |
getGetterPrefixLength(java.lang.reflect.Method method)
Gets getter prefix length.
|
V8Value |
getOwnPropertyDescriptor(V8Value target,
V8Value property)
handler.getOwnPropertyDescriptor()
The handler.getOwnPropertyDescriptor() method is a trap for the [[GetOwnProperty]] object internal method,
which is used by operations such as Object.getOwnPropertyDescriptor().
|
V8Value |
getPrototypeOf(V8Value target)
handler.getPrototypeOf()
The handler.getPrototypeOf() method is a trap for the [[GetPrototypeOf]] object internal method,
which is used by operations such as Object.getPrototypeOf().
|
abstract V8ProxyMode |
getProxyMode()
Gets proxy mode.
|
protected int |
getSetterPrefixLength(java.lang.reflect.Method method)
Gets setter prefix length.
|
protected boolean |
hasFromGeneric(V8Value property)
Has from generic.
|
protected boolean |
hasFromRegular(V8Value property)
Has from regular.
|
protected abstract void |
initialize()
Initialize.
|
protected void |
initializeConstructors(java.lang.Class<?> currentClass,
V8ConversionMode conversionMode)
Initialize constructors.
|
protected void |
initializePublicFields(java.lang.Class<?> currentClass,
V8ConversionMode conversionMode,
boolean staticMode)
Initialize public fields.
|
protected void |
initializePublicMethods(java.lang.Class<?> currentClass,
V8ConversionMode conversionMode,
boolean staticMode)
Initialize public methods.
|
protected abstract V8Value |
internalGet(V8Value target,
V8Value property)
Internal get.
|
protected boolean |
isAllowed(V8ConversionMode conversionMode,
java.lang.reflect.AccessibleObject accessibleObject)
Is allowed.
|
protected boolean |
isApplyFunction(java.lang.reflect.Method method)
Is apply function.
|
protected boolean |
isGenericGetter(java.lang.reflect.Method method)
Is generic getter.
|
protected boolean |
isGenericSetter(java.lang.reflect.Method method)
Is generic setter.
|
protected boolean |
setToField(V8Value propertyKey,
V8Value propertyValue)
Sets to field.
|
protected boolean |
setToSetter(V8Value target,
V8Value propertyKey,
V8Value propertyValue)
Sets to setter.
|
getTargetObject, getV8Runtime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, construct, defineProperty, deleteProperty, has, isExtensible, ownKeys, preventExtensions, set, setPrototypeOf
getCallbackContexts, setV8Runtime
protected static final java.lang.String[] GETTER_PREFIX_ARRAY
protected static final java.util.regex.Pattern PATTERN_CAPITALIZED_PREFIX
protected static final java.lang.String[] SETTER_PREFIX_ARRAY
protected ClassDescriptor classDescriptor
protected static <E extends java.lang.reflect.AccessibleObject> java.lang.Object execute(IJavetReflectionObjectFactory reflectionObjectFactory, java.lang.Object targetObject, V8ValueObject thisObject, java.util.List<E> executables, JavetVirtualObject[] javetVirtualObjects) throws java.lang.Throwable
E
- the type parameterreflectionObjectFactory
- the reflection object factorytargetObject
- the target objectthisObject
- this objectexecutables
- the executablesjavetVirtualObjects
- the javet virtual objectsjava.lang.Throwable
- the throwableprotected void addMethod(java.lang.reflect.Method method, int startIndex, java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> map)
method
- the methodstartIndex
- the start indexmap
- the mappublic V8Value get(V8Value target, V8Value property, V8Value receiver) throws JavetException, E extends java.lang.Exception
IJavetProxyHandler
target
- the targetproperty
- the propertyreceiver
- the receiverJavetException
- the javet exceptionE
- the custom exceptionE extends java.lang.Exception
protected V8Value getByField(V8Value property) throws JavetException
property
- the propertyJavetException
- the javet exceptionprotected V8Value getByGetter(V8Value property) throws JavetException
property
- the propertyJavetException
- the javet exceptionprotected V8Value getByMethod(V8Value target, V8Value property) throws JavetException, E extends java.lang.Exception
target
- the targetproperty
- the propertyJavetException
- the javet exceptionE
- the custom exceptionE extends java.lang.Exception
protected int getGetterPrefixLength(java.lang.reflect.Method method)
method
- the methodpublic V8Value getOwnPropertyDescriptor(V8Value target, V8Value property) throws JavetException, E extends java.lang.Exception
IJavetProxyHandler
target
- the targetproperty
- the propertyJavetException
- the javet exceptionE
- the custom exceptionE extends java.lang.Exception
public V8Value getPrototypeOf(V8Value target) throws JavetException, E extends java.lang.Exception
IJavetProxyHandler
target
- the targetJavetException
- the javet exceptionE
- the custom exceptionE extends java.lang.Exception
public abstract V8ProxyMode getProxyMode()
protected int getSetterPrefixLength(java.lang.reflect.Method method)
method
- the methodprotected boolean hasFromGeneric(V8Value property) throws JavetException
property
- the propertyJavetException
- the javet exceptionprotected boolean hasFromRegular(V8Value property)
property
- the propertyprotected abstract void initialize()
protected void initializeConstructors(java.lang.Class<?> currentClass, V8ConversionMode conversionMode)
currentClass
- the current classconversionMode
- the conversion modeprotected void initializePublicFields(java.lang.Class<?> currentClass, V8ConversionMode conversionMode, boolean staticMode)
currentClass
- the current classconversionMode
- the conversion modestaticMode
- the static modeprotected void initializePublicMethods(java.lang.Class<?> currentClass, V8ConversionMode conversionMode, boolean staticMode)
currentClass
- the current classconversionMode
- the conversion modestaticMode
- the static modeprotected abstract V8Value internalGet(V8Value target, V8Value property) throws JavetException, E extends java.lang.Exception
target
- the targetproperty
- the propertyJavetException
- the javet exceptionE
- the custom exceptionE extends java.lang.Exception
protected boolean isAllowed(V8ConversionMode conversionMode, java.lang.reflect.AccessibleObject accessibleObject)
conversionMode
- the conversion modeaccessibleObject
- the accessible objectprotected boolean isApplyFunction(java.lang.reflect.Method method)
method
- the methodprotected boolean isGenericGetter(java.lang.reflect.Method method)
method
- the methodprotected boolean isGenericSetter(java.lang.reflect.Method method)
method
- the methodprotected boolean setToField(V8Value propertyKey, V8Value propertyValue) throws JavetException
propertyKey
- the property keypropertyValue
- the property valueJavetException
- the javet exceptionprotected boolean setToSetter(V8Value target, V8Value propertyKey, V8Value propertyValue) throws JavetException
target
- the targetpropertyKey
- the property keypropertyValue
- the property valueJavetException
- the javet exception