从字符串内容加载Properties
185591
public static Properties loadFromString(String content) {
		Properties p = new Properties();
		try (Reader reader = new StringReader(content)) {
			p.load(reader);
		} catch (IOException ignored) { // NOSONAR
		}
		return p;
	}
606218
def add_itemprop(itemprop)
      properties = Itemprop.parse(itemprop, @page_url)
      properties.each { |name, value| (@properties[name] ||= []) << value }
    end
860111
public PropertyContainer add(String property) {
		
		// Si la propriete n'est pas nulle
		if(property != null && property.trim().length() > 0) properties.add(property);
		
		// On retourne le conteneur
		return this;
	}
512860
@Nonnull
    public static Properties loadProperties(@Nonnull String properties) throws IOException {
        Properties p = new Properties();
        p.load(new StringReader(properties));
        return p;
    }
521821
public void addProperty(String propertyName, Object value)
    {
        if (propertyName != null)
        {
            propertyNames.add(propertyName);
            if (value == null)
            {
                properties.remove(propertyName);
            }
            else
            {
                properties.put(propertyName, value);
            }
        }
    }
753574
public void addProperty(String propertyType) {

        if (m_properties == null) {
            // this list will be used and clean up in the importResource method
            m_properties = new HashMap<String, CmsProperty>();
        }
        try {
            if ((m_propertyName == null) || getIgnoredProperties().contains(m_propertyName)) {
                // continue if the current property (name) should be ignored or is null
                return;
            }
            CmsProperty property = m_properties.get(m_propertyName);
            if (property == null) {
                property = new CmsProperty();
                property.setName(m_propertyName);
                property.setAutoCreatePropertyDefinition(true);
                m_properties.put(m_propertyName, property);
            }

            if (m_propertyValue == null) {
                m_propertyValue = "";
            }

            if ((propertyType != null) && propertyType.equals(PROPERTY_ATTRIB_TYPE_SHARED)) {
                // it is a shared/resource property value
                property.setResourceValue(m_propertyValue);
            } else {
                // it is an individual/structure value
                property.setStructureValue(m_propertyValue);
            }
        } finally {
            m_propertyName = null;
            m_propertyValue = null;
        }
    }
706484
@Override
    public void loadFromProperties(Properties props) {
        String strValue = props.getProperty(container.getSimpleName() + "." + name);
        if (strValue == null)
            return;

        try {
            int intValue = Integer.parseInt(strValue);
            set(intValue);
        } catch (NumberFormatException nfe) {
        }
    }
998539
public void addProperty(final String propertyName, final String value) {
        Preconditions.checkNotNull(propertyName);
        Preconditions.checkNotNull(value);
        List<String> values = properties.get(propertyName);
        if (values == null) {
            values = new ArrayList<>();
            values.add(value);
            properties.put(propertyName, values);
        } else {
            values.add(value);
        }
    }
125265
private void init() {
        add("text", PropertySerializer.STRING, PropertyEditorText.class);
        add("color", PropertySerializer.STRING, PropertyEditorColor.class);
        add("choice", PropertySerializer.STRING, PropertyEditorChoiceList.class);
        add("action", PropertySerializer.STRING, PropertyEditorAction.class);
        add("icon", PropertySerializer.STRING, PropertyEditorIcon.class);
        add("integer", PropertySerializer.INTEGER, PropertyEditorInteger.class);
        add("double", PropertySerializer.DOUBLE, PropertyEditorDouble.class);
        add("boolean", PropertySerializer.BOOLEAN, PropertyEditorBoolean.class);
        add("date", PropertySerializer.DATE, PropertyEditorDate.class);
    }
1058564
private void reloadProperties() {
        Properties temp = new Properties();
        BufferedReader bufferedReader = null;
        try {
            bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(propertiesFile), "UTF8"));
            temp.load(bufferedReader);
            this.properties = temp;
        } catch (IOException e) {
            error("Error while trying to load the Properties-File: "
                    + propertiesFile.getAbsolutePath(), e);
        } finally {
            if (bufferedReader != null) {
                try {
                    bufferedReader.close();
                } catch (IOException e) {
                    error("Unable to close input stream", e);
                }
            }
        }
    }
373699
function handleProperties(schema, properties, node, stack) {
    var name = handleTagName(schema, node.tagName, node, stack)
    var attrs = schema.attributes
    var props = properties || {}
    var result = {}
    var allowed
    var prop
    var value

    allowed = own.call(attrs, name) ? attrs[name] : []
    allowed = [].concat(allowed, attrs['*'])

    for (prop in props) {
        value = props[prop]

        if (
            allowed.indexOf(prop) === -1 &&
            !(data(prop) && allowed.indexOf('data*') !== -1)
        ) {
            continue
        }

        if (value && typeof value === 'object' && 'length' in value) {
            value = handlePropertyValues(schema, value, prop)
        } else {
            value = handlePropertyValue(schema, value, prop)
        }

        if (value !== null && value !== undefined) {
            result[prop] = value
        }
    }

    return result
}
438935
function addToSchema(index, properties) {
        this[_privateKey]._schema[index] = normalizeProperties.call(this, properties, index);

        defineGetter.call(this[_privateKey]._getset, index, this[_privateKey]._schema[index]);
        defineSetter.call(this[_privateKey]._getset, index, this[_privateKey]._schema[index]);
    }
1135755
function addMetaProperty (object, propName, value) {
  defineProperty(object, propName, {
    enumerable: false,
    value
  })
}
1023054
function addPropToValue( prop, value ) {
    if ( value === undefined || value === null ) return;
    if ( value.isContentChangeAware !== true ) return;
    var properties = value[ PROPERTY_SYMBOL ];
    if ( !Array.isArray( properties ) ) {
        properties = [ prop ];
    } else if ( properties.indexOf( prop ) === -1 ) {
        properties.push( prop );
    }
    value[ PROPERTY_SYMBOL ] = properties;
}
714614
private Map<String, String> readProperties(Element properties)
    {
        Map<String, String> values = new HashMap<>();
        for (Element p : $(properties).find("prop"))
        {
            String key = $(p).attr("key");
            String val = $(p).text();
            values.put(key, val);
        }
        for (Element p : $(properties).find("entry"))
        {
            String key = $(p).attr("key");
            String val = $(p).attr("value");
            values.put(key, val);
        }
        for (Element p : $(properties).find("value"))
        {
            String propVal = StringUtils.trim($(p).text());
            String key = StringUtils.substringBefore(propVal, "=");
            String val = StringUtils.substringAfter(propVal, "=");
            values.put(key, val);
        }
        return values;
    }
34561
def append_with(self, obj, **properties):
        ''''''
        for prop, val in properties.items():
            val = self.serialize(val)
            self._meta.setdefault(prop, {}).setdefault(val, []).append(obj)
        self.append(obj)
385870
function(properties) {
            properties = utils.isArray(properties) ? properties[0] : properties;
            
            // Initialize the properties to
            // empty values
            properties = properties || {
                content: {},
                fields: {},
                acl: {},
                links: {}
            };
            
            this._super(properties);
            
            // Take out the entity-specific content
            this._properties = properties.content   || {};
            this._fields     = properties.fields    || this._fields || {};
            this._acl        = properties.acl       || {};
            this._links      = properties.links     || {};
            this._author     = properties.author    || null;
            this._updated    = properties.updated   || null;
            this._published  = properties.published || null;
        }