protected <T> void fromJsonBase(ObjectNode main, Attribute<T> target) { target.setVisibility(AttributeVisibility.valueOf(main.get("visibility").asText())); if (main.has("translationProfile")) target.setTranslationProfile(main.get("translationProfile").asText()); if (main.has("remoteIdp")) target.setRemoteIdp(main.get("remoteIdp").asText()); ArrayNode values = main.withArray("values"); List<T> pValues = new ArrayList<T>(values.size()); Iterator<JsonNode> it = values.iterator(); AttributeValueSyntax<T> syntax = target.getAttributeSyntax(); try { while (it.hasNext()) pValues.add(syntax.deserialize(it.next().binaryValue())); } catch (Exception e) { throw new InternalException("Can't perform JSON deserialization", e); } target.setValues(pValues); }