You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "clint@computer.org" <cl...@computer.org> on 2009/07/22 03:17:49 UTC

Handling of generics other than Java Collection types

I see that aegis can deal with generic Java collection types like List<Foo>
without any special configuration. Can it also handle something like a
FooContainer<T> class that contains a List<T> (as well as some primitives),
or would I need to implement a custom type creator for FooContainer<T>? 
-- 
View this message in context: http://www.nabble.com/Handling-of-generics-other-than-Java-Collection-types-tp24598487p24598487.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Handling of generics other than Java Collection types

Posted by Benson Margulies <bi...@gmail.com>.
Beans can have properties of collection type in Aegis. But you might
need, at least, a dummy setter.

On Tue, Jul 21, 2009 at 11:02 PM, clint@computer.org<cl...@computer.org> wrote:
>
> For example, suppose I need to return two values, an int and a List of Foo. I
> know it will work without any special coding if I return just
> List&lt;Foo&gt;. But what if I want to return a container for both values,
> like ListResults&lt;Foo&gt;...?
>
>
> public class ListResults&lt;T&gt; {
>        private List&lt;T&gt; page;
>        private int totalCount;
>
>        public ListResults(List&lt;T&gt; page, int totalCount) {
>                this.page = page;
>                this.totalCount = totalCount;
>        }
>
>        public List&lt;T&gt; getPage() {
>                return page;
>        }
>
>        public int getTotalCount() {
>                return totalCount;
>        }
> }
>
> --
> View this message in context: http://www.nabble.com/Handling-of-generics-other-than-Java-Collection-types-tp24598487p24599321.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

Re: Handling of generics other than Java Collection types

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi

I'm not sure but may be providing a custom mappings file can help ?
See here for more info : http://cwiki.apache.org/CXF20DOC/aegis-21.html

cheers, Sergey

----- Original Message ----- 
From: <cl...@computer.org>
To: <us...@cxf.apache.org>
Sent: Wednesday, July 22, 2009 4:02 AM
Subject: Re: Handling of generics other than Java Collection types


>
> For example, suppose I need to return two values, an int and a List of Foo. I
> know it will work without any special coding if I return just
> List&lt;Foo&gt;. But what if I want to return a container for both values,
> like ListResults&lt;Foo&gt;...?
>
>
> public class ListResults&lt;T&gt; {
> private List&lt;T&gt; page;
> private int totalCount;
>
> public ListResults(List&lt;T&gt; page, int totalCount) {
> this.page = page;
> this.totalCount = totalCount;
> }
>
> public List&lt;T&gt; getPage() {
> return page;
> }
>
> public int getTotalCount() {
> return totalCount;
> }
> }
>
> -- 
> View this message in context: http://www.nabble.com/Handling-of-generics-other-than-Java-Collection-types-tp24598487p24599321.html
> Sent from the cxf-user mailing list archive at Nabble.com.
> 


Re: Handling of generics other than Java Collection types

Posted by "clint@computer.org" <cl...@computer.org>.
For example, suppose I need to return two values, an int and a List of Foo. I
know it will work without any special coding if I return just
List&lt;Foo&gt;. But what if I want to return a container for both values,
like ListResults&lt;Foo&gt;...?


public class ListResults&lt;T&gt; {
	private List&lt;T&gt; page;
	private int totalCount;

	public ListResults(List&lt;T&gt; page, int totalCount) {
		this.page = page;
		this.totalCount = totalCount;
	}

	public List&lt;T&gt; getPage() {
		return page;
	}

	public int getTotalCount() {
		return totalCount;
	}
}

-- 
View this message in context: http://www.nabble.com/Handling-of-generics-other-than-Java-Collection-types-tp24598487p24599321.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Handling of generics other than Java Collection types

Posted by Benson Margulies <bi...@gmail.com>.
What exactly do you mean by 'contains'? Extends? Implements? has some
other protocol?

On Tue, Jul 21, 2009 at 9:17 PM, clint@computer.org<cl...@computer.org> wrote:
>
> I see that aegis can deal with generic Java collection types like List<Foo>
> without any special configuration. Can it also handle something like a
> FooContainer<T> class that contains a List<T> (as well as some primitives),
> or would I need to implement a custom type creator for FooContainer<T>?
> --
> View this message in context: http://www.nabble.com/Handling-of-generics-other-than-Java-Collection-types-tp24598487p24598487.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>