replaced MethodHandles with custom reflection-less reflectivity

This commit is contained in:
Shautvast 2023-08-23 09:15:37 +02:00
parent 938f6e9521
commit 209e43657d
13 changed files with 6 additions and 23 deletions

View file

@ -2,7 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
import java.math.BigDecimal; import java.math.BigDecimal;
class BigDecimalHandler extends BuiltinTypeHandler<BigDecimal> { class BigDecimalHandler extends BuiltinTypeHandler<BigDecimal> {

View file

@ -2,7 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
import java.math.BigInteger; import java.math.BigInteger;
class BigIntegerHandler extends BuiltinTypeHandler<BigInteger> { class BigIntegerHandler extends BuiltinTypeHandler<BigInteger> {

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
/** /**
* Stores a byte value. * Stores a byte value.
*/ */

View file

@ -1,7 +1,9 @@
package com.github.shautvast.contiguous; package com.github.shautvast.contiguous;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
class CompoundTypeHandler extends TypeHandler { class CompoundTypeHandler extends TypeHandler {
private final Map<String, TypeHandler> properties = new LinkedHashMap<>(); private final Map<String, TypeHandler> properties = new LinkedHashMap<>();

View file

@ -1,11 +1,9 @@
package com.github.shautvast.contiguous; package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.InvokerFactory;
import com.github.shautvast.reflective.MetaClass; import com.github.shautvast.reflective.MetaClass;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import com.github.shautvast.reflective.Reflective; import com.github.shautvast.reflective.Reflective;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
/** /**
* Stores a double value. * Stores a double value.
*/ */

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
class FloatHandler extends BuiltinTypeHandler<Float> { class FloatHandler extends BuiltinTypeHandler<Float> {
public FloatHandler(String propertyName, MetaMethod getter, MetaMethod setter) { public FloatHandler(String propertyName, MetaMethod getter, MetaMethod setter) {
super(Float.class, propertyName, getter, setter); super(Float.class, propertyName, getter, setter);

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
class IntegerHandler extends BuiltinTypeHandler<Integer> { class IntegerHandler extends BuiltinTypeHandler<Integer> {
public IntegerHandler(String propertyName, MetaMethod getter, MetaMethod setter) { public IntegerHandler(String propertyName, MetaMethod getter, MetaMethod setter) {
super(Integer.class, propertyName, getter, setter); super(Integer.class, propertyName, getter, setter);

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
class LongHandler extends BuiltinTypeHandler<Long> { class LongHandler extends BuiltinTypeHandler<Long> {
public LongHandler(String propertyName, MetaMethod getter, MetaMethod setter) { public LongHandler(String propertyName, MetaMethod getter, MetaMethod setter) {
super(Long.class, propertyName, getter, setter); super(Long.class, propertyName, getter, setter);

View file

@ -2,11 +2,12 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.*; import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/* /*
* Maps the propertyvalue type to a PropertyHandler * Maps the propertyvalue type to a PropertyHandler

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
class ShortHandler extends BuiltinTypeHandler<Short> { class ShortHandler extends BuiltinTypeHandler<Short> {
public ShortHandler(String propertyName, MetaMethod getter, MetaMethod setter) { public ShortHandler(String propertyName, MetaMethod getter, MetaMethod setter) {
super(Short.class, propertyName, getter, setter); super(Short.class, propertyName, getter, setter);

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
class StringHandler extends BuiltinTypeHandler<String> { class StringHandler extends BuiltinTypeHandler<String> {
public StringHandler(String propertyName, MetaMethod getter, MetaMethod setter) { public StringHandler(String propertyName, MetaMethod getter, MetaMethod setter) {
super(String.class, propertyName, getter, setter); super(String.class, propertyName, getter, setter);

View file

@ -2,8 +2,6 @@ package com.github.shautvast.contiguous;
import com.github.shautvast.reflective.MetaMethod; import com.github.shautvast.reflective.MetaMethod;
import java.lang.invoke.MethodHandle;
/** /**
* Abstract basetype over handlers for 'primitives' (ie. long, but also Long, * Abstract basetype over handlers for 'primitives' (ie. long, but also Long,
* String..=> built-in types) and compound types (your own). * String..=> built-in types) and compound types (your own).