private static void validateOpenGraphValueContainer( ShareOpenGraphValueContainer valueContainer, Validator validator, boolean requireNamespace) { Set<String> keySet = valueContainer.keySet(); for (String key : keySet) { validateOpenGraphKey(key, requireNamespace); Object o = valueContainer.get(key); if (o instanceof List) { List list = (List) o; for (Object objectInList : list) { if (objectInList == null) { throw new FacebookException( "Cannot put null objects in Lists in " + "ShareOpenGraphObjects and ShareOpenGraphActions"); } validateOpenGraphValueContainerObject(objectInList, validator); } } else { validateOpenGraphValueContainerObject(o, validator); } } }
private static void validateOpenGraphAction( ShareOpenGraphAction openGraphAction, Validator validator) { if (openGraphAction == null) { throw new FacebookException("Must specify a non-null ShareOpenGraphAction"); } if (Utility.isNullOrEmpty(openGraphAction.getActionType())) { throw new FacebookException("ShareOpenGraphAction must have a non-empty actionType"); } validator.validate((ShareOpenGraphValueContainer) openGraphAction, false); }
private static void validateOpenGraphObject( ShareOpenGraphObject openGraphObject, Validator validator) { if (openGraphObject == null) { throw new FacebookException("Cannot share a null ShareOpenGraphObject"); } validator.validate((ShareOpenGraphValueContainer) openGraphObject, true); }
public void validate(final ShareOpenGraphValueContainer openGraphValueContainer, boolean requireNamespace) { validateOpenGraphValueContainer(openGraphValueContainer, this, requireNamespace); }