EBayConsumerExample.java :  » Tools » odata4j » org » odata4j » examples » consumer » Android Open Source

Android Open Source » Tools » odata4j 
odata4j » org » odata4j » examples » consumer » EBayConsumerExample.java
package org.odata4j.examples.consumer;

import org.odata4j.consumer.ODataConsumer;
import org.odata4j.core.OEntity;
import org.odata4j.core.ORelatedEntitiesLink;
import org.odata4j.examples.BaseExample;
import org.odata4j.examples.ODataEndpoints;

public class EBayConsumerExample extends BaseExample {

    public static void main(String[] args) {
        
        ODataConsumer c = ODataConsumer.create(ODataEndpoints.EBAY);
       
        OEntity firstCategory = c.getEntities("Categories").top(1).execute().first();
        reportEntities(firstCategory.getProperty("Name").getValue().toString(),
                c.getEntities(firstCategory.getLink("Items",ORelatedEntitiesLink.class))
                    .execute()
                    .take(5));
        
         
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.