Improve Map support for JCR Node based Resources
------------------------------------------------

                 Key: SLING-557
                 URL: https://issues.apache.org/jira/browse/SLING-557
             Project: Sling
          Issue Type: Improvement
          Components: JCR Resource
    Affects Versions: Scripting API 2.0.2, JCR Resource 2.0.2
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger


SLING-395 added support for adapting a JCR-Node based resource to a Map. This 
first implementation converts property values to their Java equivalent as per 
the JSR-170 specification.

As the JCR Value interface also allows on-the-fly conversion of values, it 
would be helpfull for the Map adapter to also support this kind of on-the-fly 
conversion. See also the discussion on [1]

This issue will introduce a new interface to the Sling API:

    package org.apache.sling.api.resource;
    public interface ValueMap extends Map<String, Object> {

        // returns the named value or null if not existing
        @Overwrite
        Object get(String name);

        // return named value converted to type T or
        // null if not existing
        <T> T get(String name, Class<T> type);

        // return named value converted to the type T of
        // the default value or the default value if the
        // named value does not exist
        <T> T get(String name, T defaultValue);

    }

This interface will be implemented for JCR-Node based Resources

[1] http://markmail.org/message/ouyvit4rpnzlgy4a

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to