当前位置: 首页>>代码示例>>Java>>正文


Java PropertyAccessor.setPropertyValue方法代码示例

本文整理汇总了Java中org.springframework.beans.PropertyAccessor.setPropertyValue方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyAccessor.setPropertyValue方法的具体用法?Java PropertyAccessor.setPropertyValue怎么用?Java PropertyAccessor.setPropertyValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.PropertyAccessor的用法示例。


在下文中一共展示了PropertyAccessor.setPropertyValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeValueToEntity

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
/**
 * Write normal value to entity.
 *
 * @param accessor The accessor for the existing entity
 * @param key      The fields name we are overwriting
 * @param value    The new value
 */
private void writeValueToEntity(final PropertyAccessor accessor,
                                final String key,
                                final Object value) {
    final ResolvableType type = accessor.getPropertyTypeDescriptor(key).getResolvableType();

    accessor.setPropertyValue(key, parseValue(value, type));
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:15,代码来源:FormParse.java

示例2: getDirectoryService

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
private Directory getDirectoryService() {
  HttpTransport httpTransport = new NetHttpTransport();
  JacksonFactory jacksonFactory = new JacksonFactory();
  GoogleCredential credential = getGoogleCredential();

  PropertyAccessor accessor = PropertyAccessorFactory.forDirectFieldAccess(credential);
  accessor.setPropertyValue("serviceAccountUser", config.getAdminUsername());
  accessor.setPropertyValue("serviceAccountScopes", SERVICE_ACCOUNT_SCOPES);

  return new Directory.Builder(httpTransport, jacksonFactory, credential)
      .setApplicationName("Spinnaker-Fiat")
      .build();
}
 
开发者ID:spinnaker,项目名称:fiat,代码行数:14,代码来源:GoogleDirectoryUserRolesProvider.java

示例3: deserializeNonTemplate

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
private CompositionElement deserializeNonTemplate(JsonNode node, Map<String, Object> valueMap)
        throws JsonProcessingException {
    CompositionElement result = new CompositionElement();
    PropertyAccessor beanAccessor = PropertyAccessorFactory.forDirectFieldAccess(result);

    for (Iterator<Entry<String, JsonNode>> iter = node.fields(); iter.hasNext();) {
        Entry<String, JsonNode> subNode = iter.next();

        if (consumedListProperties.contains(subNode.getKey())) {
            result.getProperties().put(subNode.getKey(), mapper.treeToValue(subNode.getValue(), List.class));
        } else if (consumedMapProperties.contains(subNode.getKey())) {
            processMapProperty(result, subNode, valueMap);
        } else if (consumedIntProperties.contains(subNode.getKey())) {
            result.getProperties().put(subNode.getKey(), mapper.treeToValue(subNode.getValue(), Integer.class));
        } else if (consumedProperties.contains(subNode.getKey())) {
            processConsumedProperty(result, subNode, valueMap);
        } else if (supportedTextProperties.contains(subNode.getKey())) {
            beanAccessor.setPropertyValue(subNode.getKey(), subNode.getValue().asText());
        } else if (supportedIntProperties.contains(subNode.getKey())) {
            beanAccessor.setPropertyValue(subNode.getKey(), subNode.getValue().asInt());
        } else {
            throw new IllegalArgumentException("Unknown property: " + subNode.getKey());
            // result.getProperties().put(subNode.getKey(),
            // subNode.getValue().asText());
        }
    }
    return result;
}
 
开发者ID:kibertoad,项目名称:swampmachine,代码行数:29,代码来源:CompositionElementDeserializer.java

示例4: writeObjectToEntity

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
/**
 * Write object to the entity
 *
 * @param accessor The accessor for the existing entity
 * @param key      The fields name we are overwriting
 * @param value    The new value
 * @throws JSONException the json exception
 */
private void writeObjectToEntity(final PropertyAccessor accessor,
                                 final String key,
                                 final JSONObject value) throws JSONException {
    final ResolvableType type = accessor.getPropertyTypeDescriptor(key).getResolvableType();

    accessor.setPropertyValue(key, parseObject(value, type));
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:16,代码来源:FormParse.java

示例5: writeArrayMapToEntity

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
/**
 * Write an array map to an entity
 * an array map is an object, but is meant to represent an array
 *
 * @param accessor The accessor for the existing entity
 * @param key      The fields name we are overwriting
 * @param value    The new value
 * @throws JSONException the json exception
 */
private void writeArrayMapToEntity(final PropertyAccessor accessor,
                                   final String key,
                                   final JSONObject value) throws JSONException {
    final ResolvableType type = accessor.getPropertyTypeDescriptor(key).getResolvableType();

    accessor.setPropertyValue(key, parseArrayMap(value, type));
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:17,代码来源:FormParse.java

示例6: writeArrayToEntity

import org.springframework.beans.PropertyAccessor; //导入方法依赖的package包/类
/**
 * Write array to entity.
 *
 * @param accessor The accessor for the existing entity
 * @param key      The fields name we are overwriting
 * @param value    The new value
 * @throws JSONException the json exception
 */
private void writeArrayToEntity(final PropertyAccessor accessor,
                                final String key,
                                final JSONArray value) throws JSONException {
    final ResolvableType type = accessor.getPropertyTypeDescriptor(key).getResolvableType();

    accessor.setPropertyValue(key, parseArray(value, type));
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:16,代码来源:FormParse.java


注:本文中的org.springframework.beans.PropertyAccessor.setPropertyValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。