/*
(non-Javadoc)

@see
org.apache.atlas.repository.graphdb.AtlasElement#setJsonProperty(java.
lang.String, java.lang.Object)
189293
@Override
    public <T> void setJsonProperty(String propertyName, T value) {
        setProperty(propertyName, value);

    }
765394
@Override
    public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException{
        if(!_setProperty(name, value))
            throw new SAXNotRecognizedException(name);
    }
1263698
public static void setPropertySafely(Marshaller marshaller, String name, Object value) {
        try {
            marshaller.setProperty(name, value);
        } catch (PropertyException e) {
            LOGGER.warn(String.format("Can't set \"%s\" property to given marshaller", name), e);
        }
    }
261327
public static void setGroovyObjectProperty(Object newValue, GroovyObject object, String property) {
        object.setProperty(property, newValue);
    }
1210824
@Override
    public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException {
        final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null));
        if (prefValue == null) {
            // Default to an empty object
            return mapper.createObjectNode();
        }
        return mapper.readTree(prefValue);
    }
705348
function addJSONProperties(jsonData, propertiesGroups, filePath, currentNamesPath) {

        var i,
            group,
            propertyDefinition,
            propertyDefinitionWithoutObjectName,
            propertyName,
            data;

        if (currentNamesPath === undefined) {
            currentNamesPath = '';
        }

        // get all values
        for (i in jsonData) {

            // add to group if is a simply object
            if (jsonData[i] instanceof Array || jsonData[i] == null || typeof jsonData[i] !== 'object' || grunt.util._.isEmpty(jsonData[i])) {

                // find group
                propertyDefinition = (currentNamesPath ? currentNamesPath + '.' + i : i)
                    .replace(/^[^.]+\./, '');
                group = propertiesUtils.getGroup(propertyDefinition, propertiesGroups);

                if (!group) {
                    grunt.log.error('Object ' + propertyDefinition + ' without init file');
                    return;
                }

                grunt.verbose.ok(propertyDefinition);

                // generate property data
                propertyDefinitionWithoutObjectName = propertyDefinition
                    .replace(group.pattern, '')
                    .replace(/^\./, '');
                propertyName = propertyDefinitionWithoutObjectName
                    .replace(/^prototype\./i, '');

                data = {
                    name:     propertyName,
                    comment:  '',

                    type:     'object',
                    isPublic: propertiesUtils.isPublic(propertyName),
                    isFromPrototype: propertiesUtils.isFromPrototype(propertyDefinitionWithoutObjectName),
                    filePath: filePath
                };


                // string -> "string"
                // true   -> true
                switch (typeof jsonData[i]) {
                case 'object':
                    if (jsonData[i] != null) {
                        data.source = JSON.stringify(jsonData[i]);
                    }
                    break;
                case 'string':
                    data.source = '"' + jsonData[i].split('"').join('\\"') + '"';
                    break;
                }
                if (data.source === undefined) {
                    data.source = '' + jsonData[i];
                }

                // add property data to prototype or inline array
                group[(data.isFromPrototype ? 'prototypeProperties' : 'inlineProperties')].push(data);
            } else {
                // is object
                // add attributeName to path and try to add
                addJSONProperties(jsonData[i], propertiesGroups, filePath, currentNamesPath ? currentNamesPath + '.' + i : i);
            }
        }
    }
933313
private static void setProperty( Object bean, String key, Object value, JsonConfig jsonConfig )
         throws Exception {
      PropertySetStrategy propertySetStrategy = jsonConfig.getPropertySetStrategy() != null ? jsonConfig.getPropertySetStrategy()
            : PropertySetStrategy.DEFAULT;
      propertySetStrategy.setProperty( bean, key, value, jsonConfig );
   }
601980
public JsonNode getPropertyValue(final JsiiObjectRef objRef, final String property) {
        ObjectNode req = makeRequest("get", objRef);
        req.put("property", property);

        return this.runtime.requestResponse(req).get("value");
    }
567417
public static void setPropertyEL(Object obj, String prop, Object value) {

	// first check for field
	Field[] fields = getFieldsIgnoreCase(obj.getClass(), prop, null);
	if (!ArrayUtil.isEmpty(fields)) {
	    try {
		fields[0].set(obj, value);
		return;
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
	    }
	}

	// then check for setter
	try {
	    getSetter(obj, prop, value).invoke(obj);
	}
	catch (Throwable t) {
	    ExceptionUtil.rethrowIfNecessary(t);
	}

    }
660997
public void storeToJSON(final OutputStream os) throws IOException {
		lock.readLock().lock();
		try {
			final JsonFactory f = new JsonFactory();
			final JsonGenerator generator = f.createGenerator(os, JsonEncoding.UTF8);
//			generator.configure(Feature.QUOTE_FIELD_NAMES, false);
			generator.useDefaultPrettyPrinter();

			generator.writeStartObject();
			writeJsonOrYaml(generator, getTreeMap());
			generator.writeEndObject();
			generator.flush();
		} finally {
			lock.readLock().unlock();
		}
	}
522959
public void registerJsonValueProcessor( Class propertyType, JsonValueProcessor jsonValueProcessor ) {
      if( propertyType != null && jsonValueProcessor != null ) {
         typeMap.put( propertyType, jsonValueProcessor );
      }
   }
63429
public void setValue(Properties properties)  {
        if (properties == null) {
            throw new IllegalArgumentException("properties must not be null");
        }
        if (type == null) {
            type = ItemType.PROPERTIES;
        }
        if (!isMappableType()) {
            throw new IllegalArgumentException("The type of this item must be 'properties' or 'map'");
        }
        tokensMap = new LinkedHashMap<>();
        for (String key : properties.stringPropertyNames()) {
            Object o = properties.get(key);
            if (o instanceof Token[]) {
                tokensMap.put(key, (Token[])o);
            } else if (o instanceof Token) {
                Token[] tokens = new Token[] { (Token)o };
                tokensMap.put(key, tokens);
            } else {
                Token[] tokens = TokenParser.makeTokens(o.toString(), isTokenize());
                putValue(name, tokens);
            }
        }
    }
1166470
public void setProperty(Object object, String property, Object newValue) {
        setProperty(theClass, object, property, newValue, false, false);
    }
323072
@com.fasterxml.jackson.annotation.JsonProperty("status")
    public void setStatus(String status) {
        this.status = status;
    }
1083762
@Override
    public BaseJsonBo setAttribute(String attrName, Object value, boolean triggerChange) {
        if (value instanceof JsonNode) {
            if (value instanceof NullNode || value instanceof MissingNode) {
                super.setAttribute(attrName, null, triggerChange);
            } else {
                super.setAttribute(attrName, value.toString(), triggerChange);
            }
        } else {
            JsonNode node = null;
            if (value instanceof String) {
                node = tryParseJson(value.toString());
            }
            node = node != null ? node : SerializationUtils.toJson(value);
            super.setAttribute(attrName, node.toString(), triggerChange);
        }
        return this;
    }
323796
@Override
	public synchronized void setProperties(Map<Object, Object> properties)
	{
		if(this.properties == null)
			this.properties = new Properties();
		
		
		this.properties.putAll(properties);
	}
145819
@Override
    public void setListProperty(String propertyName, List<String> values) {
        setProperty(propertyName, values);

    }