SimpleTypeMappingImpl(ClassTypeInfo typeInfo, PropertyMetaType<I> propertyMetaType) { ClassTypeInfo stp = (ClassTypeInfo) SimpleTypeResolver.typeDomain.resolve(SimpleTypeProvider.class); TypeVariableInfo tvi = stp.getTypeParameters().get(1); // <E> TypeInfo aaa = typeInfo.resolve(tvi); // this.propertyMetaType = propertyMetaType; this.typeInfo = typeInfo; this.external = aaa; }
SimpleTypeMappingImpl(ClassTypeInfo typeInfo) { // Find the right subclass ClassTypeInfo current = typeInfo; while (!current.getSuperClass().getName().equals(SimpleTypeProvider.class.getName())) { current = current.getSuperClass(); } // ClassTypeInfo stp = (ClassTypeInfo) SimpleTypeResolver.typeDomain.resolve(SimpleTypeProvider.class); TypeVariableInfo tvi = stp.getTypeParameters().get(1); // <E> TypeInfo aaa = typeInfo.resolve(tvi); // if (!aaa.equals(typeInfo)) { // throw new AssertionError(aaa + " should be equals to " + typeInfo); // } // PropertyMetaType aaaaa = propertyMetaTypes.get(current); // this.propertyMetaType = aaaaa; this.typeInfo = typeInfo; this.external = aaa; }
public SimpleTypeProvider<I, ?> create() { if (instance == null) { Class type = (Class) typeInfo.unwrap(); try { instance = (SimpleTypeProvider<I, ?>) type.newInstance(); } catch (InstantiationException e) { throw new AssertionError(e); } catch (IllegalAccessException e) { throw new AssertionError(e); } } return instance; }