/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.rendering.internal.parser.reference;

import java.lang.reflect.Type;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.xwiki.component.annotation.Component;
import org.xwiki.properties.converter.AbstractConverter;
import org.xwiki.rendering.listener.reference.ResourceReference;
import org.xwiki.rendering.parser.ResourceReferenceParser;
import org.xwiki.rendering.renderer.reference.ResourceReferenceSerializer;

/**
 * XWiki Properties Bean Converter to convert Strings into
 * {@link org.xwiki.rendering.listener.reference.ResourceReference}.
 * 
 * @version $Id$
 * @since 5.2M1
 * @see org.xwiki.properties.converter.Converter
 */
@Component
@Singleton
public class ResourceReferenceConverter extends AbstractConverter<ResourceReference>
{
    /**
     * Used to convert Resource References from String to ResourceReference object.
     */
    @Inject
    private ResourceReferenceParser referenceParser;

    /**
     * Used to convert Resource References from ResourceReference object to String.
     */
    @Inject
    private ResourceReferenceSerializer referenceSerializer;

    @Override
    protected <G extends ResourceReference> G convertToType(Type targetType, Object value)
    {
        G reference = null;
        if (value != null) {
            reference = (G) this.referenceParser.parse(value.toString());
        }

        return reference;
    }

    @Override
    protected String convertToString(ResourceReference value)
    {
        return this.referenceSerializer.serialize(value);
    }
}

@@ -1137,24 +1137,83 @@
 tConverter;%0A
+import org.xwiki.properties.converter.ConversionException;%0A
 import org.x
@@ -1327,83 +1327,8 @@
 ser;
-%0Aimport org.xwiki.rendering.renderer.reference.ResourceReferenceSerializer;
 %0A%0A/*
@@ -1826,182 +1826,8 @@
 r;%0A%0A
-    /**%0A     * Used to convert Resource References from ResourceReference object to String.%0A     */%0A    @Inject%0A    private ResourceReferenceSerializer referenceSerializer;%0A%0A
     
@@ -2202,55 +2202,59 @@
     
-return this.referenceSerializer.serialize(value
+throw new ConversionException(%22not implemented yet%22
 );%0A 

Add support for generic types in properties converters * not that simple actually, lets keep it the way it was for now