本文整理汇总了Java中org.springframework.beans.PropertyValue.getName方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyValue.getName方法的具体用法?Java PropertyValue.getName怎么用?Java PropertyValue.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.PropertyValue
的用法示例。
在下文中一共展示了PropertyValue.getName方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPropertyValuesForNamePrefix
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private MutablePropertyValues getPropertyValuesForNamePrefix(
MutablePropertyValues propertyValues) {
if (!StringUtils.hasText(this.namePrefix) && !this.ignoreNestedProperties) {
return propertyValues;
}
MutablePropertyValues rtn = new MutablePropertyValues();
for (PropertyValue value : propertyValues.getPropertyValues()) {
String name = value.getName();
for (String prefix : new RelaxedNames(stripLastDot(this.namePrefix))) {
for (String separator : new String[] { ".", "_" }) {
String candidate = (StringUtils.hasLength(prefix) ? prefix + separator
: prefix);
if (name.startsWith(candidate)) {
name = name.substring(candidate.length());
if (!(this.ignoreNestedProperties && name.contains("."))) {
PropertyOrigin propertyOrigin = OriginCapablePropertyValue
.getOrigin(value);
rtn.addPropertyValue(new OriginCapablePropertyValue(name,
value.getValue(), propertyOrigin));
}
}
}
}
}
return rtn;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:27,代码来源:RelaxedDataBinder.java
示例2: getConstrainedPropertyForPropertyValue
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private ConstrainedProperty getConstrainedPropertyForPropertyValue(Map constrainedProperties, PropertyValue propertyValue) {
final String propertyName = propertyValue.getName();
if (propertyName.indexOf(PATH_SEPARATOR) > -1) {
String[] propertyNames = propertyName.split("\\.");
Object target = getTarget();
Object value = getPropertyValueForPath(target, propertyNames);
if (value != null) {
Map nestedConstrainedProperties = resolveConstrainedProperties(value);
if (nestedConstrainedProperties != null) {
return (ConstrainedProperty) nestedConstrainedProperties.get(propertyNames[propertyNames.length - 1]);
}
}
} else {
return (ConstrainedProperty) constrainedProperties.get(propertyName);
}
return null;
}
示例3: filterPropertyValues
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private PropertyValues filterPropertyValues(PropertyValues propertyValues, String prefix) {
if (prefix == null || prefix.length() == 0)
return propertyValues;
PropertyValue[] valueArray = propertyValues.getPropertyValues();
MutablePropertyValues newValues = new MutablePropertyValues();
for (PropertyValue propertyValue : valueArray) {
String name = propertyValue.getName();
final String prefixWithDot = prefix + PREFIX_SEPERATOR;
if (name.startsWith(prefixWithDot)) {
name = name.substring(prefixWithDot.length(), name.length());
newValues.addPropertyValue(name, propertyValue.getValue());
}
}
return newValues;
}
示例4: autoCreateIfPossible
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
/**
* Auto-creates the a type if it is null and is possible to auto-create.
*
* @param mpvs A MutablePropertyValues instance
*/
protected void autoCreateIfPossible(MutablePropertyValues mpvs) {
PropertyValue[] pvs = mpvs.getPropertyValues();
for (PropertyValue pv : pvs) {
String propertyName = pv.getName();
if (propertyName.indexOf(PATH_SEPARATOR) > -1) {
String[] propertyNames = propertyName.split("\\.");
BeanWrapper currentBean = this.bean;
for (String name : propertyNames) {
Object created = autoCreatePropertyIfPossible(currentBean, name, pv.getValue());
if (created != null) {
currentBean = new BeanWrapperImpl(created);
} else {
break;
}
}
} else {
autoCreatePropertyIfPossible(this.bean, propertyName, pv.getValue());
}
}
}
示例5: toDto
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
/**
* Convert from an internal Spring bean definition to a DTO.
*
* @param beanDefinition The internal Spring bean definition.
* @return Returns a DTO representation.
*/
public BeanDefinitionInfo toDto(BeanDefinition beanDefinition) {
if (beanDefinition instanceof GenericBeanDefinition) {
GenericBeanDefinitionInfo info = new GenericBeanDefinitionInfo();
info.setClassName(beanDefinition.getBeanClassName());
if (beanDefinition.getPropertyValues() != null) {
Map<String, BeanMetadataElementInfo> propertyValues = new HashMap<String, BeanMetadataElementInfo>();
for (PropertyValue value : beanDefinition.getPropertyValues().getPropertyValueList()) {
Object obj = value.getValue();
if (obj instanceof BeanMetadataElement) {
propertyValues.put(value.getName(), toDto((BeanMetadataElement) obj));
} else {
throw new IllegalArgumentException("Type " + obj.getClass().getName()
+ " is not a BeanMetadataElement for property: " + value.getName());
}
}
info.setPropertyValues(propertyValues);
}
return info;
} else {
throw new IllegalArgumentException("Conversion to DTO of " + beanDefinition.getClass().getName()
+ " not implemented");
}
}
示例6: modifyProperty
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private PropertyValue modifyProperty(BeanWrapper target,
PropertyValue propertyValue) {
String name = propertyValue.getName();
String normalizedName = normalizePath(target, name);
if (!normalizedName.equals(name)) {
return new PropertyValue(normalizedName, propertyValue.getValue());
}
return propertyValue;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:RelaxedDataBinder.java
示例7: getNameOf
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private String getNameOf(PropertyValue propertyValue) {
String name = propertyValue.getName();
if (name.indexOf(STRUCTURED_PROPERTY_SEPERATOR) == -1) {
return name;
}
return name.substring(0, name.indexOf(STRUCTURED_PROPERTY_SEPERATOR));
}
示例8: visitPropertyValues
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
protected void visitPropertyValues(MutablePropertyValues pvs) {
PropertyValue[] pvArray = pvs.getPropertyValues();
for (PropertyValue pv : pvArray) {
currentPropertyName = pv.getName();
try {
Object newVal = resolveValue(pv.getValue());
if (!ObjectUtils.nullSafeEquals(newVal, pv.getValue())) {
pvs.addPropertyValue(pv.getName(), newVal);
}
} finally {
currentPropertyName = null;
}
}
}
示例9: SimpleBeanProperty
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
/**
* Constructs a new <code>SimpleBeanProperty</code> instance.
*
* @param propertyValue
*/
public SimpleBeanProperty(PropertyValue propertyValue) {
this.name = propertyValue.getName();
Object value = propertyValue.getValue();
this.value = ValueFactory.buildValue(value);
}
示例10: OriginCapablePropertyValue
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
OriginCapablePropertyValue(PropertyValue propertyValue) {
this(propertyValue.getName(), propertyValue.getValue(),
(PropertyOrigin) propertyValue.getAttribute(ATTRIBUTE_PROPERTY_ORIGIN));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:OriginCapablePropertyValue.java
示例11: isStructured
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private boolean isStructured(PropertyValue propertyValue) {
String name = propertyValue.getName();
return name.indexOf(STRUCTURED_PROPERTY_SEPERATOR) != -1;
}
示例12: propertyStartsWithFieldMarkerPrefix
import org.springframework.beans.PropertyValue; //导入方法依赖的package包/类
private boolean propertyStartsWithFieldMarkerPrefix(PropertyValue pv, String fieldMarkerPrefix) {
String propertyName = pv.getName().indexOf(PATH_SEPARATOR) > -1 ? StringUtils.substringAfterLast(pv.getName(), ".") : pv.getName();
return propertyName.startsWith(fieldMarkerPrefix);
}