facebook4j.internal.util.z_F4JInternalParseUtil类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中facebook4j.internal.util.z_F4JInternalParseUtil类的一些代码示例,展示了z_F4JInternalParseUtil类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。z_F4JInternalParseUtil类的具体详情如下:
包路径:facebook4j.internal.util.z_F4JInternalParseUtil
类名称:z_F4JInternalParseUtil

z_F4JInternalParseUtil介绍

[英]A tiny parse utility class.
[中]一个很小的解析实用程序类。

代码示例

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) {
  setting = getRawString("setting", json);
  value = getBoolean("value", json);
}

代码示例来源:origin: roundrop/facebook4j

/*package*/VenueJSONImpl(JSONObject json) {
  id = getRawString("id", json);
  street = getRawString("street", json);
  city = getRawString("city", json);
  state = getRawString("state", json);
  country = getRawString("country", json);
  latitude = getDouble("latitude", json);
  longitude = getDouble("longitude", json);
  zip = getRawString("zip", json);
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  id = getRawString("id", json);
  name = getRawString("name", json);
  category = getRawString("category", json);
  createdTime = getISO8601Datetime("created_time", json);
}

代码示例来源:origin: roundrop/facebook4j

FormatJSONImpl(JSONObject json) throws FacebookException {
  embedHtml = getRawString("embed_html", json);
  filter = getRawString("filter", json);
  height = getInt("height", json);
  width = getInt("width", json);
  picture = getURL("picture", json);
}

代码示例来源:origin: org.facebook4j/facebook4j-core

private void init(JSONObject json) throws FacebookException {
  id = getRawString("id", json);
  name = getRawString("name", json);
  description = getRawString("description", json);
  category = getRawString("category", json);
  company = getRawString("company", json);
  iconUrl = getURL("icon_url", json);
  subcategory = getRawString("subcategory", json);
  link = getURL("link", json);
  logoUrl = getURL("logo_url", json);
  dailyActiveUsers = getRawString("daily_active_users", json);
  weeklyActiveUsers = getRawString("weekly_active_users", json);
  monthlyActiveUsers = getRawString("monthly_active_users", json);
  migrations = getBooleanMap("migrations", json);
  namespace = getRawString("namespace", json);
  restrictions = getStringMap("restrictions", json);
  appDomains = getStringList("app_domains", json);
  authDialogDataHelpUrl = getURL("auth_dialog_data_help_url", json);
  authDialogDescription = getRawString("auth_dialog_description", json);
  authDialogHeadline = getRawString("auth_dialog_headline", json);
  authDialogPermsExplanation = getRawString("auth_dialog_perms_explanation", json);
  authReferralUserPerms = getStringList("auth_referral_user_perms", json);
  authReferralFriendPerms = getStringList("auth_referral_friend_perms", json);
  authReferralDefaultActivityPrivacy = getRawString("auth_referral_default_activity_privacy", json);
  authReferralEnabled = getFlag("auth_referral_enabled", json);
  authReferralExtendedPerms = getStringList("auth_referral_extended_perms", json);
  authReferralResponseType = getRawString("auth_referral_response_type", json);
  canvasFluidHeight = getBoolean("canvas_fluid_height", json);
  canvasFluidWidth = getFlag("canvas_fluid_width", json);
  canvasUrl = getURL("canvas_url", json);

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  try {
    id = getRawString("id", json);
    if (!json.isNull("from")) {
      JSONObject fromJSONObject = json.getJSONObject("from");
      from = new IdNameEntityJSONImpl(fromJSONObject);
    }
    subject = getRawString("subject", json);
    message = getRawString("message", json);
    icon = getURL("icon", json);
    createdTime = getISO8601Datetime("created_time", json);
    updatedTime = getISO8601Datetime("updated_time", json);
    revision = getLong("revision", json);
    canEdit = getBoolean("can_edit", json);
    canDelete = getBoolean("can_delete", json);
  } catch (JSONException jsone) {
    throw new FacebookException(jsone.getMessage(), jsone);
  }
}

代码示例来源:origin: org.facebook4j/facebook4j-core

private void init(JSONObject json) throws FacebookException {
  try {
    if (!json.isNull("version")) {
      version = getPrimitiveInt("version", json);
    }
    name = getRawString("name", json);
    id = getRawString("id", json);
    administrator = getBoolean("administrator", json);
    if (!json.isNull("bookmark_order")) {
      bookmarkOrder = getPrimitiveInt("bookmark_order", json);
    }
    
    if (!json.isNull("owner")) {
      owner = new IdNameEntityJSONImpl(json.getJSONObject("owner"));
    }
    description = getRawString("description", json);
    privacy = GroupPrivacyType.getInstance(getRawString("privacy", json));
    icon = getURL("icon", json);
    updatedTime = getISO8601Datetime("updated_time", json);
    email = getRawString("email", json);
    if (!json.isNull("venue")) {
      venue = new VenueJSONImpl(json.getJSONObject("venue"));
    }
  } catch (JSONException jsone) {
    throw new FacebookException(jsone.getMessage(), jsone);
  }
}

代码示例来源:origin: org.facebook4j/facebook4j-core

private void init(JSONObject json) throws FacebookException {
  try {
    id = getRawString("id", json);
    name = getRawString("name", json);
    link = getURL("link", json);
    if (!json.isNull("application")) {
      application = new IdNameEntityJSONImpl(json.getJSONObject("application"));
    }
    customName = getRawString("custom_name", json);
    isPermanent = getBoolean("is_permanent", json);
    position = getInt("position", json);
    isNonConnectionLandingTab = getBoolean("is_non_connection_landing_tab", json);
    imageURL = getURL("image_url", json);
    customImageURL = getURL("custom_image_url", json);
  } catch (JSONException jsone) {
    throw new FacebookException(jsone);
  }
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  id = getRawString("id", json);
  name = getRawString("name", json);
  if (!json.isNull("offset")) {
    offset = getPrimitiveInt("offset", json);
  } else {
    offset = null;
  }
  if (!json.isNull("length")) {
    length = getPrimitiveInt("length", json);
  } else {
    length = null;
  }
  type = getRawString("type", json);
  
  if (!json.isNull("x")) {
    x = getDouble("x", json);
  } else {
    x = null;
  }
  if (!json.isNull("y")) {
    y = getDouble("y", json);
  } else {
    y = null;
  }
  createdTime = getISO8601Datetime("created_time", json);
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  try {
    id = getRawString("id", json);
    if (!json.isNull("from")) {
      JSONObject fromJSONObject = json.getJSONObject("from");
      from = new IdNameEntityJSONImpl(fromJSONObject);
    }
    if (!json.isNull("to")) {
      JSONObject toJSONObject = json.getJSONObject("to");
      to = new IdNameEntityJSONImpl(toJSONObject);
    }
    createdTime = getISO8601Datetime("created_time", json);
    updatedTime = getISO8601Datetime("updated_time", json);
    title = getRawString("title", json);
    link = getURL("link", json);
    if (!json.isNull("application")) {
      application = new ApplicationJSONImpl(json.getJSONObject("application"));
    }
    if (!json.isNull("unread")) {
      unread = getFlag("unread", json);
    }
    if (!json.isNull("object")) {
      targetObject = new TargetObjectJSONImpl(json.getJSONObject("object"));
    }
  } catch (JSONException jsone) {
    throw new FacebookException(jsone.getMessage(), jsone);
  }
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) {
  id = getRawString("id", json);
  profilePic = getRawString("profile_pic", json);
  followCount = getInt("follow_count", json);
  followedByCount = getInt("followed_by_count", json);
  mediaCount = getInt("media_count", json);
  username = getRawString("username", json);
}

代码示例来源:origin: roundrop/facebook4j

/*package*/CoverJSONImpl(JSONObject json) throws FacebookException {
  id = getRawString("id", json);
  source = getRawString("source", json);
  offsetY = getLong("offset_y", json);
}

代码示例来源:origin: roundrop/facebook4j

ValueEntryJSONImpl(JSONObject json) throws FacebookException {
  String valueRawString = getRawString("value", json);
  if (valueRawString.startsWith("{")) {
    value = getLongMap("value", json);
  } else {
    value = new HashMap<String, Long>();
    value.put("", getLong("value", json));
  }
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  try {
    id = getRawString("id", json);
    createdTime = getISO8601Datetime("created_time", json);
    
    if (isJSONObject("place", json)) {
      JSONObject placeJSONObject = json.getJSONObject("place");
      place = new PlaceJSONImpl(placeJSONObject);
    }
  } catch (JSONException jsone) {
    throw new FacebookException(jsone.getMessage(), jsone);
  }
}

代码示例来源:origin: org.facebook4j/facebook4j-core

/*package*/OptionJSONImpl(JSONObject json) throws FacebookException {
  try {
    id = getRawString("id", json);
    if (!json.isNull("from")) {
      JSONObject fromJSONObject = json.getJSONObject("from");
      from = new CategoryJSONImpl(fromJSONObject);
    }
    name = getRawString("name", json);
    voteCount = getPrimitiveInt("vote_count", json);
    createdTime = getISO8601Datetime("created_time", json);
    votes = getPrimitiveInt("votes", json);
  } catch (JSONException jsone) {
    throw new FacebookException(jsone.getMessage(), jsone);
  }
}

代码示例来源:origin: roundrop/facebook4j

public static int getPrimitiveInt(String name, JSONObject json) {
  return getPrimitiveInt(getRawString(name, json));
}
public static int getPrimitiveInt(String str) {

代码示例来源:origin: org.facebook4j/facebook4j-core

/*package*/ImageJSONImpl(JSONObject json) {
  if (!json.isNull("height")) {
    height = getPrimitiveInt("height", json);
  }
  if (!json.isNull("width")) {
    width = getPrimitiveInt("width", json);
  }
  source = getURL("source", json);
  if (source == null) {
    source = getURL("src", json);
  }
}

代码示例来源:origin: roundrop/facebook4j

/*package*/PictureJSONImpl(JSONObject json) throws FacebookException {
  try {
    JSONObject pictureJSONObject = json.getJSONObject("data");
    url = z_F4JInternalParseUtil.getURL("url", pictureJSONObject);
    isSilhouette = z_F4JInternalParseUtil.getBoolean("is_silhouette", pictureJSONObject);
  } catch (JSONException jsone) {
    throw new FacebookException(jsone);
  }
}
/*package*/PictureJSONImpl(URL url) {

代码示例来源:origin: roundrop/facebook4j

/**
 * Parses the value of a field as a timezone offset in hours. A timezone 
 * offset is the value added to UTC time to get the user's local time. 
 * A date/time reference point must be provided because the offset may 
 * differ based on the date/time for which it is to be computed, for
 * example because of daylight savings.
 * 
 * @param name the name of the member of the given json object that is 
 * the raw string to be parsed
 * @param json the json object
 * @param datetimeReference the date/time for which the offset is to be computed
 * @return the timezone offset, in hours
 */
public static Double getTimeZoneOffset(String name, JSONObject json, long datetimeReference) {
  String rawString = getRawString(name, json);
  if (null == rawString || "".equals(rawString) || "null".equals(rawString)) {
    return null;
  } else {
    try {
      return Double.valueOf(rawString);
    } catch (NumberFormatException ignore) {
      TimeZone timeZone = TimeZone.getTimeZone(rawString); // returns GMT if not understood
      return Integer.valueOf(computeTimeZoneOffsetInHours(timeZone, datetimeReference)).doubleValue();
    }
  }
}

代码示例来源:origin: roundrop/facebook4j

private void init(JSONObject json) throws FacebookException {
  isAdministrator = getBoolean("administrator", json);
}

相关文章