public abstract class BaseJavetProxyPlugin extends java.lang.Object implements IClassProxyPlugin
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
HINT_BOOLEAN
The constant HINT_BOOLEAN.
|
protected static java.lang.String |
HINT_DEFAULT
The constant HINT_DEFAULT.
|
protected static java.lang.String |
HINT_NUMBER
The constant HINT_NUMBER.
|
protected static java.lang.String |
HINT_STRING
The constant HINT_STRING.
|
protected static JavetObjectConverter |
OBJECT_CONVERTER
The constant OBJECT_CONVERTER.
|
protected static JavetProxyConverter |
PROXY_CONVERTER
The constant PROXY_CONVERTER.
|
protected static java.lang.String |
TO_JSON
The constant TO_JSON.
|
protected static java.lang.String |
TO_STRING
The constant TO_STRING.
|
protected static java.lang.String |
VALUE_OF
The constant VALUE_OF.
|
Constructor and Description |
---|
BaseJavetProxyPlugin()
Instantiates a new Base javet proxy plugin.
|
Modifier and Type | Method and Description |
---|---|
protected V8Value |
callWithObjectConverter(java.lang.String functionName,
V8Runtime v8Runtime,
java.lang.Object targetObject)
Call function with the object converter by name.
|
boolean |
deleteByObject(java.lang.Object targetObject,
java.lang.Object propertyKey)
Delete by object property.
|
java.lang.Object |
getByIndex(java.lang.Object targetObject,
int index)
Gets by index.
|
<E extends java.lang.Exception> |
getProxyGetBySymbol(java.lang.Class<?> targetClass,
java.lang.String symbolName)
Gets proxy get function by symbol property.
|
java.lang.Object[] |
getProxyOwnKeys(java.lang.Object targetObject)
Get proxy own keys for Object.getOwnPropertyNames().
|
<T> IJavetEntityPropertyDescriptor<T> |
getProxyOwnPropertyDescriptor(java.lang.Object targetObject,
java.lang.Object propertyName)
Gets proxy own property descriptor.
|
<E extends java.lang.Exception> |
getProxySymbolToPrimitive()
Gets proxy symbol to primitive function.
|
<E extends java.lang.Exception> |
getTargetObjectConstructor(java.lang.Class<?> targetClass)
Gets target object constructor.
|
boolean |
hasByObject(java.lang.Object targetObject,
java.lang.Object propertyKey)
Has by object property.
|
boolean |
isDeleteSupported(java.lang.Class<?> targetClass)
Is keyword delete supported.
|
boolean |
isHasSupported(java.lang.Class<?> targetClass)
Is has() supported.
|
boolean |
isIndexSupported(java.lang.Class<?> targetClass)
Is index supported.
|
boolean |
isOwnKeysSupported(java.lang.Class<?> targetClass)
Is ownKeys() supported.
|
boolean |
isUniqueKeySupported(java.lang.Class<?> targetClass)
Is unique key supported.
|
void |
populateUniqueKeys(java.util.Set<java.lang.String> uniqueKeySet,
java.lang.Object targetObject)
Populate unique keys.
|
boolean |
setByIndex(java.lang.Object targetObject,
int index,
java.lang.Object value)
Sets by index.
|
V8Value |
symbolToPrimitive(V8Runtime v8Runtime,
java.lang.Object targetObject)
Convert to primitive.
|
protected V8Value |
typeErrorFunctionIsNotSupported(java.lang.String functionName,
V8Runtime v8Runtime)
TypeError: ${functionName}() is not supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getProxyGetByString, isMethodProxyable, isProxyable
protected static final java.lang.String HINT_BOOLEAN
protected static final java.lang.String HINT_DEFAULT
protected static final java.lang.String HINT_NUMBER
protected static final java.lang.String HINT_STRING
protected static final JavetObjectConverter OBJECT_CONVERTER
protected static final JavetProxyConverter PROXY_CONVERTER
protected static final java.lang.String TO_JSON
protected static final java.lang.String TO_STRING
protected static final java.lang.String VALUE_OF
public BaseJavetProxyPlugin()
protected V8Value callWithObjectConverter(java.lang.String functionName, V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
functionName
- the function namev8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic boolean deleteByObject(java.lang.Object targetObject, java.lang.Object propertyKey)
IClassProxyPlugin
deleteByObject
in interface IClassProxyPlugin
targetObject
- the target objectpropertyKey
- the property keypublic java.lang.Object getByIndex(java.lang.Object targetObject, int index)
IClassProxyPlugin
getByIndex
in interface IClassProxyPlugin
targetObject
- the target objectindex
- the indexpublic <E extends java.lang.Exception> IClassProxyPluginFunction<E> getProxyGetBySymbol(java.lang.Class<?> targetClass, java.lang.String symbolName)
IClassProxyPlugin
getProxyGetBySymbol
in interface IClassProxyPlugin
E
- the type parametertargetClass
- the target classsymbolName
- the symbol namepublic java.lang.Object[] getProxyOwnKeys(java.lang.Object targetObject)
IClassProxyPlugin
getProxyOwnKeys
in interface IClassProxyPlugin
targetObject
- the target objectpublic <T> IJavetEntityPropertyDescriptor<T> getProxyOwnPropertyDescriptor(java.lang.Object targetObject, java.lang.Object propertyName)
IClassProxyPlugin
getProxyOwnPropertyDescriptor
in interface IClassProxyPlugin
T
- the type parametertargetObject
- the target objectpropertyName
- the property namepublic <E extends java.lang.Exception> IClassProxyPluginFunction<E> getProxySymbolToPrimitive()
IClassProxyPlugin
getProxySymbolToPrimitive
in interface IClassProxyPlugin
E
- the type parameterpublic <E extends java.lang.Exception> IClassProxyPluginFunction<E> getTargetObjectConstructor(java.lang.Class<?> targetClass)
IClassProxyPlugin
getTargetObjectConstructor
in interface IClassProxyPlugin
E
- the type parametertargetClass
- the target classpublic boolean hasByObject(java.lang.Object targetObject, java.lang.Object propertyKey)
IClassProxyPlugin
hasByObject
in interface IClassProxyPlugin
targetObject
- the target objectpropertyKey
- the property keypublic boolean isDeleteSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isDeleteSupported
in interface IClassProxyPlugin
targetClass
- the target classpublic boolean isHasSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isHasSupported
in interface IClassProxyPlugin
targetClass
- the target classpublic boolean isIndexSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isIndexSupported
in interface IClassProxyPlugin
targetClass
- the target classpublic boolean isOwnKeysSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isOwnKeysSupported
in interface IClassProxyPlugin
targetClass
- the target classpublic boolean isUniqueKeySupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isUniqueKeySupported
in interface IClassProxyPlugin
targetClass
- the target classpublic void populateUniqueKeys(java.util.Set<java.lang.String> uniqueKeySet, java.lang.Object targetObject)
IClassProxyPlugin
populateUniqueKeys
in interface IClassProxyPlugin
uniqueKeySet
- the unique key settargetObject
- the target objectpublic boolean setByIndex(java.lang.Object targetObject, int index, java.lang.Object value)
IClassProxyPlugin
setByIndex
in interface IClassProxyPlugin
targetObject
- the target objectindex
- the indexvalue
- the valuepublic V8Value symbolToPrimitive(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exception