當前位置: 首頁>>代碼示例>>Java>>正文


Java FacebookGraphObjectException類代碼示例

本文整理匯總了Java中com.facebook.FacebookGraphObjectException的典型用法代碼示例。如果您正苦於以下問題:Java FacebookGraphObjectException類的具體用法?Java FacebookGraphObjectException怎麽用?Java FacebookGraphObjectException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FacebookGraphObjectException類屬於com.facebook包,在下文中一共展示了FacebookGraphObjectException類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: castToListOf

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@Override
public final <U extends GraphObject> GraphObjectList<U> castToListOf(Class<U> graphObjectClass) {
    if (GraphObject.class.isAssignableFrom(itemType)) {
        if (graphObjectClass.isAssignableFrom(itemType)) {
            @SuppressWarnings("unchecked")
            GraphObjectList<U> result = (GraphObjectList<U>)this;
            return result;
        }

        return createList(state, graphObjectClass);
    } else {
        throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type "
                + itemType);
    }
}
 
開發者ID:MobileDev418,項目名稱:AndroidBackendlessChat,代碼行數:16,代碼來源:GraphObject.java

示例2: updateObjectAttachmentUrls

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
void updateObjectAttachmentUrls(String objectProperty, List<String> attachmentUrls, boolean isUserGenerated) {
    final OpenGraphObject object;
    try {
        object = action.getPropertyAs(objectProperty, OpenGraphObject.class);
        if (object == null) {
            throw new IllegalArgumentException("Action does not contain a property '" + objectProperty + "'");
        }
    } catch (FacebookGraphObjectException exception) {
        throw new IllegalArgumentException("Property '" + objectProperty + "' is not a graph object");
    }
    if (!object.getCreateObject()) {
        throw new IllegalArgumentException(
                "The Open Graph object in '" + objectProperty + "' is not marked for creation");
    }

    GraphObjectList<GraphObject> attachments = object.getImage();
    if (attachments == null) {
        attachments = GraphObject.Factory.createList(GraphObject.class);
    }
    for (String url : attachmentUrls) {
        GraphObject graphObject = GraphObject.Factory.create();
        graphObject.setProperty(NativeProtocol.IMAGE_URL_KEY, url);
        if (isUserGenerated) {
            graphObject.setProperty(NativeProtocol.IMAGE_USER_GENERATED_KEY, true);
        }
        attachments.add(graphObject);
    }
    object.setImage(attachments);
}
 
開發者ID:yeloapp,項目名稱:yelo-android,代碼行數:30,代碼來源:FacebookDialog.java

示例3: testCantWrapBadPropertyNameOverrides

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadPropertyNameOverrides() {
    try {
        GraphObject.Factory.create(BadPropertyOverrideInterfaceGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例4: castToListOf

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
public final <U extends GraphObject> GraphObjectList<U> castToListOf(Class<U> paramClass)
{
  if (GraphObject.class.isAssignableFrom(this.itemType))
  {
    if (paramClass.isAssignableFrom(this.itemType))
      return this;
    return GraphObject.Factory.createList(this.state, paramClass);
  }
  throw new FacebookGraphObjectException("Can't cast GraphObjectCollection of non-GraphObject type " + this.itemType);
}
 
開發者ID:mmmsplay10,項目名稱:QuizUpWinner,代碼行數:11,代碼來源:GraphObject.java

示例5: testCantWrapBadGetterName

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadGetterName() {
    try {
        GraphObject.Factory.create(BadGetterNameGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例6: testCantWrapBadZeroParameterMethodName

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadZeroParameterMethodName() {
    try {
        GraphObject.Factory.create(BadNoParameterMethodNameGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例7: testCantWrapBadSetterName

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadSetterName() {
    try {
        GraphObject.Factory.create(BadSetterNameGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例8: testCantWrapBadGetterParams

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadGetterParams() {
    try {
        GraphObject.Factory.create(BadGetterParamsGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例9: testCantWrapBadBaseInterface

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadBaseInterface() {
    try {
        GraphObject.Factory.create(BadBaseInterfaceGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例10: testCantWrapBadSingleParameterMethodName

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapBadSingleParameterMethodName() {
    try {
        GraphObject.Factory.create(BadSingleParameterMethodNameGraphObject.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:b099l3,項目名稱:FacebookImageShareIntent,代碼行數:11,代碼來源:GraphObjectFactoryTests.java

示例11: testCantWrapNonInterface

import com.facebook.FacebookGraphObjectException; //導入依賴的package包/類
@SmallTest
@MediumTest
@LargeTest
public void testCantWrapNonInterface() {
    try {
        GraphObject.Factory.create(GraphObjectClass.class);
        fail("Expected exception");
    } catch (FacebookGraphObjectException exception) {
    }
}
 
開發者ID:kodamirmo,項目名稱:LostAndFound,代碼行數:11,代碼來源:GraphObjectFactoryTests.java


注:本文中的com.facebook.FacebookGraphObjectException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。