private JsonObjectParser<Object> getParserFor(FieldSchema fieldSchema) throws JSONException { final Set<String> customFieldsTypesWithFieldOption = ImmutableSet.of( "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes", "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons", "com.atlassian.jira.plugin.system.customfieldtypes:select", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect" ); String type = "array".equals(fieldSchema.getType()) ? fieldSchema.getItems() : fieldSchema.getType(); final String custom = fieldSchema.getCustom(); if (custom != null && customFieldsTypesWithFieldOption.contains(custom)) { type = "customFieldOption"; } @SuppressWarnings("unchecked") final JsonObjectParser<Object> jsonParser = registeredAllowedValueParsers.get(type); if (jsonParser == null) { throw new JSONException("Cannot find parser for field witch schema: " + fieldSchema); } else { return jsonParser; } } }
private JsonObjectParser<Object> getParserFor(FieldSchema fieldSchema) throws JSONException { final Set<String> customFieldsTypesWithFieldOption = ImmutableSet.of( "com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes", "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons", "com.atlassian.jira.plugin.system.customfieldtypes:select", "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect" ); String type = "array".equals(fieldSchema.getType()) ? fieldSchema.getItems() : fieldSchema.getType(); final String custom = fieldSchema.getCustom(); if (custom != null && customFieldsTypesWithFieldOption.contains(custom)) { type = "customFieldOption"; } @SuppressWarnings("unchecked") final JsonObjectParser<Object> jsonParser = registeredAllowedValueParsers.get(type); if (jsonParser == null) { throw new JSONException("Cannot find parser for field witch schema: " + fieldSchema); } else { return jsonParser; } } }
JSONArray valuesToParse; final boolean isProjectCF = "project".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:project".equals(fieldSchema.getCustom()); final boolean isVersionCF = "version".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:version".equals(fieldSchema.getCustom()); final boolean isMultiVersionCF = "array".equals(fieldSchema.getType()) && "version".equals(fieldSchema.getItems()) && "com.atlassian.jira.plugin.system.customfieldtypes:multiversion".equals(fieldSchema.getCustom());
JSONArray valuesToParse; final boolean isProjectCF = "project".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:project".equals(fieldSchema.getCustom()); final boolean isVersionCF = "version".equals(fieldSchema.getType()) && "com.atlassian.jira.plugin.system.customfieldtypes:version".equals(fieldSchema.getCustom()); final boolean isMultiVersionCF = "array".equals(fieldSchema.getType()) && "version".equals(fieldSchema.getItems()) && "com.atlassian.jira.plugin.system.customfieldtypes:multiversion".equals(fieldSchema.getCustom());