@Override public void parseJson(JsonValue value) { JsonObject o = value.asJsonObject(); this.name = o.getString("name"); this.typeCode = o.getInteger("typeCode"); this.typeName = o.getString("typeName"); this.length = o.getInteger("length"); this.precision = o.getInteger("precision"); this.scale = o.getInteger("scale"); this.nullable = o.getBoolean("nullable"); this.primaryKey = o.getBoolean("primaryKey"); this.unique = o.getBoolean("unique"); this.autoIncrement = o.getBoolean("autoIncrement"); this.comment = o.getString("comment"); this.defaultValue = o.getString("defaultValue"); } }
@Override public void parseJson(JsonValue value) { JsonObject o = value.asJsonObject(); this.catalog = o.getString("catalog"); this.schema = o.getString("schema"); this.name = o.getString("name"); this.quoted = o.getBoolean("quoted", false); this.minValue = o.getLong("minValue"); this.maxValue = o.getLong("maxValue"); this.increment = o.getInteger("increment"); this.start = o.getLong("start"); this.cache = o.getInteger("cache"); this.cycle = o.getBoolean("cycle"); } }
protected void readParameterBase(String name, JsonObject p, MApiParameterBaseBuilder mp, SwaggerExtension ex) { mp.setName(p.getString(NAME)); mp.setTitle(p.getString(TITLE)); mp.setSummary(p.getString(SUMMARY)); mp.setDescription(p.getString(DESCRIPTION)); mp.setRequired(p.get(REQUIRED, Boolean.class)); mp.setType(readParameterType(name, p, ex)); mp.setDefaultValue(p.get(DEFAULT)); MApiValidationBuilder v = new MApiValidationBuilder(); v.setPattern(p.getString(PATTERN)); v.setMaxLength(p.getInteger(MAX_LENGTH)); v.setMinLength(p.getInteger(MIN_LENGTH)); v.setMaximum(p.get(MAXIMUM)); v.setExclusiveMaximum(p.getBoolean(EXCLUSIVE_MAXIMUM, v.isExclusiveMaximum())); v.setMinimum(p.get(MINIMUM)); v.setExclusiveMinimum(p.getBoolean(EXCLUSIVE_MINIMUM, v.isExclusiveMinimum())); List<String> enumValues = p.getList(ENUM); if(null != enumValues) { mp.setEnumValues(enumValues.toArray(Arrays2.EMPTY_STRING_ARRAY)); } mp.setValidation(v); readFormat(p, mp); }