String collectionFormat = serializableParameter.getCollectionFormat();
@Override public void setType(String type) { this.type = type; if(ArrayProperty.isType(type)) { if(getCollectionFormat() == null){ setCollectionFormat(getDefaultCollectionFormat()); } } else { setCollectionFormat(null); } }
public Object extract(String name, Parameter parameter, MultiMap params) { AbstractSerializableParameter abstractSerializableParameter = (AbstractSerializableParameter) parameter; if (!params.contains(name)) { if (abstractSerializableParameter.getRequired()) { throw new IllegalArgumentException("Missing required parameter: " + name); } else if (abstractSerializableParameter.getDefaultValue()!=null){ return abstractSerializableParameter.getDefaultValue(); } else { return null; } } if ((abstractSerializableParameter.getAllowEmptyValue() == null || !abstractSerializableParameter.getAllowEmptyValue()) && StringUtils.isEmpty(params.get(name))) { throw new IllegalArgumentException( "Empty value is not authorized for parameter: " + name); } if ("array".equals(abstractSerializableParameter.getType())) { if ("multi".equals(abstractSerializableParameter.getCollectionFormat())) { return params.getAll(name); } else { List<String> resultParams = this.splitArrayParam(abstractSerializableParameter, params.get(name)); if (resultParams != null) { return resultParams; } } } return params.get(name); }
String collectionFormat = serializableParameter.getCollectionFormat();
collectionFormat = p.getCollectionFormat(); } else { throw new MetadataException("Unknown property type" + parameter.getClass().getName()); //$NON-NLS-1$
switch (attr) { case "collectionFormat": _switchResult = param.getCollectionFormat(); break; case "defaultValue":
private static void copyFields(AbstractSerializableParameter<?> from, AbstractSerializableParameter<?> to) { copyFields((AbstractParameter) from, (AbstractParameter) to); to.setCollectionFormat(from.getCollectionFormat()); to.setDefault(from.getDefault()); to.setEnum(from.getEnum()); if (from.getExample() != null) { to.setExample(from.getExample().toString()); } to.setExclusiveMaximum(to.isExclusiveMaximum()); to.setExclusiveMinimum(to.isExclusiveMinimum()); to.setFormat(from.getFormat()); to.setItems(from.getItems()); to.setMaximum(from.getMaximum()); to.setMaxItems(from.getMaxItems()); to.setMaxLength(from.getMaxLength()); to.setMinLength(to.getMinLength()); to.setMinimum(from.getMinimum()); to.setMaxItems(from.getMaxItems()); to.setMinLength(from.getMinLength()); to.setMultipleOf(from.getMultipleOf()); to.setType(from.getType()); to.setUniqueItems(from.isUniqueItems()); }