当前位置: 首页>>代码示例>>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;未经允许,请勿转载。