public class JavetProxyPluginMap extends BaseJavetProxyPluginSingle<java.util.Map<java.lang.Object,java.lang.Object>>
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CLEAR |
protected static java.lang.String[] |
DEFAULT_PROXYABLE_METHODS
The constant DEFAULT_PROXYABLE_METHODS.
|
protected static java.lang.String |
DELETE |
protected static java.lang.String |
ENTRIES |
protected static java.lang.String |
ERROR_TARGET_OBJECT_MUST_BE_AN_INSTANCE_OF_MAP |
protected static java.lang.String |
FOR_EACH |
protected static java.lang.String |
GET |
protected static java.lang.String |
HAS |
protected static java.lang.String |
KEYS |
static java.lang.String |
NAME
The constant NAME.
|
protected static java.lang.String |
OBJECT_MAP |
protected java.util.Set<java.lang.String> |
proxyableMethods
The proxyable methods.
|
protected static java.lang.String |
SET |
protected static java.lang.String |
SIZE |
protected static java.lang.String |
VALUES |
proxyGetByStringMap, proxyGetBySymbolMap
HINT_BOOLEAN, HINT_DEFAULT, HINT_NUMBER, HINT_STRING, OBJECT_CONVERTER, PROXY_CONVERTER, TO_JSON, TO_STRING, VALUE_OF
Constructor and Description |
---|
JavetProxyPluginMap() |
Modifier and Type | Method and Description |
---|---|
V8Value |
clear(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.clear().
|
protected V8Value |
createTargetObject(V8Runtime v8Runtime,
java.lang.Object targetObject)
Create target object.
|
V8Value |
delete(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.delete()
The delete() method of Map instances removes the specified element from this map by key.
|
boolean |
deleteByObject(java.lang.Object targetObject,
java.lang.Object propertyKey)
Delete by object property.
|
V8Value |
entries(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.entries()
The entries() method of Map instances returns a new map iterator object that contains the [key, value]
pairs for each element in this map in insertion order.
|
V8Value |
forEach(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.forEach().
|
V8Value |
get(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.get().
|
static JavetProxyPluginMap |
getInstance()
Gets instance.
|
java.lang.String |
getName()
Gets the plugin name.
|
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.
|
V8Value |
has(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.has()
The has() method of Map instances returns a boolean indicating whether an element
with the specified key exists in this map or not.
|
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 |
isMethodProxyable(java.lang.String methodName,
java.lang.Class<?> targetClass)
Is method proxyable.
|
boolean |
isOwnKeysSupported(java.lang.Class<?> targetClass)
Is ownKeys() supported.
|
boolean |
isProxyable(java.lang.Class<?> targetClass)
Is the target class proxyable.
|
boolean |
isUniqueKeySupported(java.lang.Class<?> targetClass)
Is unique key supported.
|
V8Value |
keys(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.keys()
The keys() method of Map instances returns a new map iterator object that contains the keys for each element
in this map in insertion order.
|
void |
populateUniqueKeys(java.util.Set<java.lang.String> uniqueKeySet,
java.lang.Object targetObject)
Populate unique keys.
|
V8Value |
set(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.set().
|
V8Value |
size(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.size.
|
V8Value |
toJSON(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.toJSON().
|
V8Value |
toString(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Object.prototype.toString()
The toString() method of Map instances always returns [object Map].
|
protected java.util.Map<java.lang.Object,java.lang.Object> |
validateTargetObject(java.lang.Object targetObject)
Validate and return target object.
|
V8Value |
valueOf(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Object.prototype.valueOf().
|
V8Value |
values(V8Runtime v8Runtime,
java.lang.Object targetObject)
Polyfill Map.prototype.values()
The values() method of Map instances returns a new map iterator object that contains the values
for each element in this map in insertion order.
|
getProxyGetByString, getProxyGetBySymbol, getTargetObjectConstructor
callWithObjectConverter, getByIndex, getProxySymbolToPrimitive, isIndexSupported, setByIndex, symbolToPrimitive, typeErrorFunctionIsNotSupported
public static final java.lang.String NAME
protected static final java.lang.String CLEAR
protected static final java.lang.String DELETE
protected static final java.lang.String ENTRIES
protected static final java.lang.String ERROR_TARGET_OBJECT_MUST_BE_AN_INSTANCE_OF_MAP
protected static final java.lang.String FOR_EACH
protected static final java.lang.String GET
protected static final java.lang.String HAS
protected static final java.lang.String KEYS
protected static final java.lang.String OBJECT_MAP
protected static final java.lang.String SET
protected static final java.lang.String SIZE
protected static final java.lang.String[] DEFAULT_PROXYABLE_METHODS
protected static final java.lang.String VALUES
protected final java.util.Set<java.lang.String> proxyableMethods
public static JavetProxyPluginMap getInstance()
public V8Value clear(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionprotected V8Value createTargetObject(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
BaseJavetProxyPluginSingle
createTargetObject
in class BaseJavetProxyPluginSingle<java.util.Map<java.lang.Object,java.lang.Object>>
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value delete(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic boolean deleteByObject(java.lang.Object targetObject, java.lang.Object propertyKey)
IClassProxyPlugin
deleteByObject
in interface IClassProxyPlugin
deleteByObject
in class BaseJavetProxyPlugin
targetObject
- the target objectpropertyKey
- the property keypublic V8Value entries(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value forEach(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value get(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic java.lang.String getName()
IClassProxyPlugin
public java.lang.Object[] getProxyOwnKeys(java.lang.Object targetObject)
IClassProxyPlugin
getProxyOwnKeys
in interface IClassProxyPlugin
getProxyOwnKeys
in class BaseJavetProxyPlugin
targetObject
- the target objectpublic <T> IJavetEntityPropertyDescriptor<T> getProxyOwnPropertyDescriptor(java.lang.Object targetObject, java.lang.Object propertyName)
IClassProxyPlugin
getProxyOwnPropertyDescriptor
in interface IClassProxyPlugin
getProxyOwnPropertyDescriptor
in class BaseJavetProxyPlugin
T
- the type parametertargetObject
- the target objectpropertyName
- the property namepublic V8Value has(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic boolean hasByObject(java.lang.Object targetObject, java.lang.Object propertyKey)
IClassProxyPlugin
hasByObject
in interface IClassProxyPlugin
hasByObject
in class BaseJavetProxyPlugin
targetObject
- the target objectpropertyKey
- the property keypublic boolean isDeleteSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isDeleteSupported
in interface IClassProxyPlugin
isDeleteSupported
in class BaseJavetProxyPlugin
targetClass
- the target classpublic boolean isHasSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isHasSupported
in interface IClassProxyPlugin
isHasSupported
in class BaseJavetProxyPlugin
targetClass
- the target classpublic boolean isMethodProxyable(java.lang.String methodName, java.lang.Class<?> targetClass)
IClassProxyPlugin
methodName
- the method nametargetClass
- the target classpublic boolean isOwnKeysSupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isOwnKeysSupported
in interface IClassProxyPlugin
isOwnKeysSupported
in class BaseJavetProxyPlugin
targetClass
- the target classpublic boolean isProxyable(java.lang.Class<?> targetClass)
IClassProxyPlugin
targetClass
- the target classpublic boolean isUniqueKeySupported(java.lang.Class<?> targetClass)
IClassProxyPlugin
isUniqueKeySupported
in interface IClassProxyPlugin
isUniqueKeySupported
in class BaseJavetProxyPlugin
targetClass
- the target classpublic V8Value keys(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic void populateUniqueKeys(java.util.Set<java.lang.String> uniqueKeySet, java.lang.Object targetObject)
IClassProxyPlugin
populateUniqueKeys
in interface IClassProxyPlugin
populateUniqueKeys
in class BaseJavetProxyPlugin
uniqueKeySet
- the unique key settargetObject
- the target objectpublic V8Value set(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value size(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value toJSON(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value toString(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionprotected java.util.Map<java.lang.Object,java.lang.Object> validateTargetObject(java.lang.Object targetObject)
BaseJavetProxyPluginSingle
validateTargetObject
in class BaseJavetProxyPluginSingle<java.util.Map<java.lang.Object,java.lang.Object>>
targetObject
- the target objectpublic V8Value valueOf(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exceptionpublic V8Value values(V8Runtime v8Runtime, java.lang.Object targetObject) throws JavetException
v8Runtime
- the V8 runtimetargetObject
- the target objectJavetException
- the javet exception