Returns the value mapped by {@code name} if it exists and is an int or
can be coerced to an int, or throws otherwise.

@throws JsonException if the mapping doesn't exist or cannot be coerced
to an int.
8641
public Integer getInt(String name, boolean strict) throws JsonException {
        JsonElement el = get(name);
        Integer res = null;
        if (strict && !el.isNumber()) {
            throw Util.typeMismatch(name, el, "int", true);
        }
        if (el.isNumber()) {
            res = el.asInt();
        }
        if (el.isString()) {
            res = Util.toInteger(el.asString());
        }
        if (res == null)
            throw Util.typeMismatch(name, el, "int", strict);
        return res;
    }
656138
@Nullable
	public static Type evaluateJavaLangType(@Nonnull final String name) {
		Check.notEmpty(name, "name");
		Type ret = null;
		for (final Type type : JAVA_LANG_VALUE_TYPES) {
			if (type.getName().equals(name.replace("java.lang.", ""))) {
				ret = type;
				break;
			}
		}
		return ret;
	}
36110
@Override
  public int getIntProperty(final String name) throws OptionsException {
    String val = getStringProperty(name);

    try {
      return Integer.valueOf(val).intValue();
    } catch (Throwable t) {
      throw new OptionsException("org.bedework.calenv.bad.option.value");
    }
  }
112624
private Integer getIntegerField(JsonNode json, String fieldName) {
        if (!json.has(fieldName)) {
            return null;
        }
        return json.get(fieldName).intValue();
    }
1092405
public Object get(String name) throws IOException {
        return Boolean.valueOf(isSet(name2Index(name)));
    }
586842
public Integer getInt(String name) {
        Object o = get(name);
        if (o instanceof Number) {
            return ((Number)o).intValue();
        }

        if (o != null) {
            try {
                String string = o.toString();
                if (string != null) {
                    return Integer.parseInt(string);
                }
            }
            catch (NumberFormatException e) {}
        }
        return null;
    }
1135756
public JsonWriter name(String name) throws IOException {
        if (name == null) {
            throw new NullPointerException("name == null");
        }
        beforeName();
        string(name);
        return this;
    }
286306
public int getInt(String key) throws JSONException {
        Object object = this.get(key);
        try {
            return object instanceof Number ? ((Number) object).intValue()
                    : Integer.parseInt((String) object);
        } catch (Exception e) {
            throw new JSONException("JSONObject[" + quote(key)
                    + "] is not an int.");
        }
    }
323875
static double checkDouble(double d) throws JSONException {
        if (Double.isInfinite(d) || Double.isNaN(d)) {
            throw new JSONException("Forbidden numeric value: " + d);
        }
        return d;
    }
267331
@Override
    public Object getMember(String name) {
        switch (name) {
            case "toJSON":
                return F_toJSON;
            case "toString":
                return F_toString;
            case "valueOf":
                return F_valueOf;
            case "getJavaObject":
                return F_getJavaObject;
        }
        return null;
//        throw new RuntimeException(getClassName() + "." + name + " is not defined");
    }
74225
public JSONArray getJSONArray(String name) throws JSONException {
		Object object = get(name);
		if (object instanceof JSONArray) {
			return (JSONArray) object;
		}
		else {
			throw JSON.typeMismatch(name, object, "JSONArray");
		}
	}
333010
public Double getDouble(String name, boolean strict) throws JsonException {
        JsonElement el = get(name);
        Double res = null;
        if (strict && !el.isNumber()) {
            throw Util.typeMismatch(name, el, "double", true);
        }
        if (el.isNumber()) {
            res = el.asDouble();
        }
        if (el.isString()) {
            res = Util.toDouble(el.asString());
        }
        if (res == null)
            throw Util.typeMismatch(name, el, "double", strict);
        return res;
    }
539346
public JsonObject optJsonObject(String name) {
        JsonElement el = null;
        try {
            el = get(name);
        } catch (JsonException e) {
            return null;
        }
        if (!el.isJsonObject()) {
            return null;
        }
        return el.asJsonObject();
    }
184615
public JsonArray getJsonArray(String name) throws JsonException {
        JsonElement el = get(name);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(name, el, "JsonArray");
        }
        return el.asJsonArray();
    }
149141
public Object nextValue() throws JSONException {
        char c = this.nextClean();
        String string;

        switch (c) {
        case '"':
        case '\'':
            return this.nextString(c);
        case '{':
            this.back();
            return new JSONObject(this);
        case '[':
            this.back();
            return new JSONArray(this);
        }

        /*
         * Handle unquoted text. This could be the values true, false, or
         * null, or it can be a number. An implementation (such as this one)
         * is allowed to also accept non-standard forms.
         *
         * Accumulate characters until we reach the end of the text or a
         * formatting character.
         */

        StringBuilder sb = new StringBuilder();
        while (c > ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
            sb.append(c);
            c = this.next();
        }
        if( false == this.eof ) {
            this.back();
        }

        string = sb.toString().trim();
        if ("".equals(string)) {
            throw this.syntaxError("Missing value");
        }
        return JSONObject.stringToValue(string);
    }
336784
public int getValue(String name, int dflt) {
        try {
            return Integer.parseInt(getValue(name, Integer.toString(dflt)));
        } catch (Exception e) {
            return dflt;
        }
    }
940070
public Object getAttributeValue(String name) throws IOException {
        ObjectIdentifier oid = PKCS9Attribute.getOID(name);

        if (oid == null)
            throw new IOException("Attribute name " + name +
                                  " not recognized or not supported.");

        return getAttributeValue(oid);
    }