private void parseAttributes(AttributeSet attrs) {
    if (attrs == null || getContext() == null) {
      return;
    }

    TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.com_facebook_like_view);
    if (a == null) {
      return;
    }

    objectId =
        Utility.coerceValueIfNullOrEmpty(
            a.getString(R.styleable.com_facebook_like_view_object_id), null);
    objectType =
        ObjectType.fromInt(
            a.getInt(
                R.styleable.com_facebook_like_view_object_type, ObjectType.DEFAULT.getValue()));
    likeViewStyle =
        Style.fromInt(a.getInt(R.styleable.com_facebook_like_view_style, Style.DEFAULT.getValue()));
    if (likeViewStyle == null) {
      throw new IllegalArgumentException("Unsupported value for LikeView 'style'");
    }

    auxiliaryViewPosition =
        AuxiliaryViewPosition.fromInt(
            a.getInt(
                R.styleable.com_facebook_like_view_auxiliary_view_position,
                AuxiliaryViewPosition.DEFAULT.getValue()));
    if (auxiliaryViewPosition == null) {
      throw new IllegalArgumentException(
          "Unsupported value for LikeView 'auxiliary_view_position'");
    }

    horizontalAlignment =
        HorizontalAlignment.fromInt(
            a.getInt(
                R.styleable.com_facebook_like_view_horizontal_alignment,
                HorizontalAlignment.DEFAULT.getValue()));
    if (horizontalAlignment == null) {
      throw new IllegalArgumentException("Unsupported value for LikeView 'horizontal_alignment'");
    }

    foregroundColor =
        a.getColor(R.styleable.com_facebook_like_view_foreground_color, NO_FOREGROUND_COLOR);

    a.recycle();
  }