本文整理汇总了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);
}
}
示例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);
}
示例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) {
}
}
示例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);
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}
示例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) {
}
}