You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Bosschaert (JIRA)" <ji...@apache.org> on 2017/04/19 12:38:41 UTC

[jira] [Comment Edited] (FELIX-5614) Make isDTOType(Class cls) publicly available

    [ https://issues.apache.org/jira/browse/FELIX-5614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15974548#comment-15974548 ] 

David Bosschaert edited comment on FELIX-5614 at 4/19/17 12:38 PM:
-------------------------------------------------------------------

Hi [~dleangen], I've moved the DTOUtil to org.apache.felix.converter and exported that package: https://svn.apache.org/viewvc?view=revision&revision=1791907

With this you can basically do 2 things:
* You can import it as you would do with any OSGi imports. 
* However, you can also embed it which basically means that if you just use this class and don't use anything else from the converter, you don't have to have the runtime dependency. In maven you can embed an entire dependency by not marking it as <scope>provided</scope> but you can also using the Conditional-Package instruction to just pull in this specific package, more info on that here: http://njbartlett.name/2014/05/26/static-linking.html

For the static linking case, it might be better to move it to a package of its own - i.e. org.apache.felix.converter.dto since there might be other things that get added to org.apache.felix.converter in the future and then it becomes less clean to do the static linking without pulling those things in as well...


was (Author: bosschaert):
Hi [~dleangen], I've moved the DTOUtil to org.apache.felix.converter and exported that package: https://svn.apache.org/viewvc?view=revision&revision=1791907

With this you can basically do 2 things:
* You can import it as you would do with any OSGi imports. 
* However, you can also embed it which basically means that if you just use this class and don't use anything else from the converter, you don't have to have the runtime dependency. In maven you can embed an entire dependency by not marking it as <scope>provided</scope> but you can also using the Conditional-Package instruction to just pull in this specific package, more info on that here: http://njbartlett.name/2014/05/26/static-linking.html

> Make isDTOType(Class<?> cls) publicly available
> -----------------------------------------------
>
>                 Key: FELIX-5614
>                 URL: https://issues.apache.org/jira/browse/FELIX-5614
>             Project: Felix
>          Issue Type: Improvement
>          Components: Converter
>            Reporter: David Leangen
>            Assignee: David Bosschaert
>
> In ConvertingImpl, which a (bundle private) implementation class, there is a (class private) method: isDTOType(Class<?> cls)
> Since this is a rule based on the definition of a DTO in the spec, it would be nice to make this test somehow available publicly for general use (including by other bundles).
> It tedious for each user of the API to write their own test if an authoritative test is already available.
> For my particular use case, the Schematizer needs to test a class to determine whether or not it is a DTO in order to know how to handle it. Having the test available (without having to copy over the code from the Converter) would be quite useful..



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)