#22 Support @Convert on @Attribute members

open
nobody
None
5
2013-09-11
2013-09-11
Daniel Demus
No

It seems you can only specify a converter on a member decorated with @Element. Seeing as a converter takes an InputNode, the restriction seems arbitrary. Making sure the converter receives a compatible InputNode and can produce compatible output is the responsibility of the Converter implementation.

Discussion

  • Daniel Demus
    Daniel Demus
    2013-09-11

    Also, unless there is some trickery going on, this should only require putting something like

    if (element == null)
    {
        if (type.getAnnotation(Attribute.class) == null)
        {
            throw new ConvertException("Element annotation required for %s", type);
        }
    }
    

    somewhere in the private Convert getConvert(Type type) method in ConverterScanner.java