@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( Association.class.getMethod( "get" ) ) ) { Type associationType = GenericAssociationInfo.associationTypeOf( association.accessor() ); if( associationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) associationType, PropertyReference.class ), new TemplateHandler<T>( null, association, null, null ) ); } } return null; } }
@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( NamedAssociation.class.getMethod( "get", String.class ) ) ) { Type namedAssociationType = GenericAssociationInfo.associationTypeOf( namedAssociation.accessor() ); if( namedAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) namedAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, null, namedAssociation ) ); } } return null; } }
@Override public Object invoke( Object o, final Method method, Object[] objects ) throws Throwable { if( method.equals( ManyAssociation.class.getMethod( "get", Integer.TYPE ) ) ) { Type manyAssociationType = GenericAssociationInfo.associationTypeOf( manyAssociation.accessor() ); if( manyAssociationType.getClass().equals( Class.class ) ) { return Proxy.newProxyInstance( method.getDeclaringClass().getClassLoader(), array( (Class) manyAssociationType, PropertyReference.class ), new TemplateHandler<T>( null, null, manyAssociation, null ) ); } } return null; } }
Type t = GenericAssociationInfo.associationTypeOf( method ); if( t instanceof Class ) Type t = GenericAssociationInfo.associationTypeOf( method ); if( t instanceof Class ) Type t = GenericAssociationInfo.associationTypeOf( method ); if( t instanceof Class )