本文整理匯總了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);
}