[
https://issues.apache.org/jira/browse/STANBOL-710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474941#comment-13474941
]
Bertrand Delacretaz commented on STANBOL-710:
---------------------------------------------
Ok, so IIUC basically your
public interface OWLExportable {
<O> O export(Class<O> returnType, boolean merge, IRI prefix);
}
is very similar to a Sling Adaptable:
public interface Adaptable {
<AdapterType> AdapterType adaptTo(Class<AdapterType> type);
}
but takes additional options, so if you want to make it more generic you could
do something like
public interface Adaptable {
// no-options variant
<AdapterType> AdapterType adaptTo(Class<AdapterType> type);
// with options
<AdapterType> AdapterType adaptTo(Class<AdapterType> type, Map<String,
Object> options);
}
the Sling adaptable interface does not provide for such options, OTOH it is
available in bundles, as part of the Sling API, and adapter extension, see
links below.
I'm not sure if reusing the Sling code is useful, if you need the options you
might just use your own adapter pattern.
Code links:
http://svn.apache.org/repos/asf/sling/trunk/bundles/api
http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/adapter
> Use the Sling Adaptable interface to export OWL artifacts
> ---------------------------------------------------------
>
> Key: STANBOL-710
> URL: https://issues.apache.org/jira/browse/STANBOL-710
> Project: Stanbol
> Issue Type: Wish
> Components: Ontology Manager
> Affects Versions: 0.9.0-incubating
> Reporter: Alessandro Adamou
> Priority: Minor
> Labels: adapters, pattern, sling
>
> Sling has a nice interface that can be used for implementing an Adapter
> pattern
> org.apache.sling.api.adapter.Adaptable
> It would be good to use this in lieu of the custom export methods in the
> OWLExportable interface.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira