org.springframework.beans.PropertyValue.isOptional()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中org.springframework.beans.PropertyValue.isOptional()方法的一些代码示例,展示了PropertyValue.isOptional()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PropertyValue.isOptional()方法的具体详情如下:
包路径:org.springframework.beans.PropertyValue
类名称:PropertyValue
方法名:isOptional

PropertyValue.isOptional介绍

[英]Return whether this is an optional value, that is, to be ignored when no corresponding property exists on the target class.
[中]返回该值是否为可选值,即当目标类上不存在相应属性时将被忽略。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Constructor that exposes a new value for an original value holder.
 * The original holder will be exposed as source of the new holder.
 * @param original the PropertyValue to link to (never {@code null})
 * @param newValue the new value to apply
 */
public PropertyValue(PropertyValue original, @Nullable Object newValue) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = newValue;
  this.optional = original.isOptional();
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original);
  copyAttributesFrom(original);
}

代码示例来源:origin: org.springframework/spring-beans

/**
 * Constructor that exposes a new value for an original value holder.
 * The original holder will be exposed as source of the new holder.
 * @param original the PropertyValue to link to (never {@code null})
 * @param newValue the new value to apply
 */
public PropertyValue(PropertyValue original, @Nullable Object newValue) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = newValue;
  this.optional = original.isOptional();
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original);
  copyAttributesFrom(original);
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Copy constructor.
 * @param original the PropertyValue to copy (never {@code null})
 */
public PropertyValue(PropertyValue original) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = original.getValue();
  this.optional = original.isOptional();
  this.converted = original.converted;
  this.convertedValue = original.convertedValue;
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original.getSource());
  copyAttributesFrom(original);
}

代码示例来源:origin: org.springframework/spring-beans

/**
 * Copy constructor.
 * @param original the PropertyValue to copy (never {@code null})
 */
public PropertyValue(PropertyValue original) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = original.getValue();
  this.optional = original.isOptional();
  this.converted = original.converted;
  this.convertedValue = original.convertedValue;
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original.getSource());
  copyAttributesFrom(original);
}

代码示例来源:origin: spring-projects/spring-framework

private void processLocalProperty(PropertyTokenHolder tokens, PropertyValue pv) {
  PropertyHandler ph = getLocalPropertyHandler(tokens.actualName);
  if (ph == null || !ph.isWritable()) {
    if (pv.isOptional()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Ignoring optional value for property '" + tokens.actualName +

代码示例来源:origin: org.springframework/spring-beans

private void processLocalProperty(PropertyTokenHolder tokens, PropertyValue pv) {
  PropertyHandler ph = getLocalPropertyHandler(tokens.actualName);
  if (ph == null || !ph.isWritable()) {
    if (pv.isOptional()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Ignoring optional value for property '" + tokens.actualName +

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Constructor that exposes a new value for an original value holder.
 * The original holder will be exposed as source of the new holder.
 * @param original the PropertyValue to link to (never <code>null</code>)
 * @param newValue the new value to apply
 */
public PropertyValue(PropertyValue original, Object newValue) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = newValue;
  this.source = original;
  this.optional = original.isOptional();
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  this.resolvedDescriptor = original.resolvedDescriptor;
  copyAttributesFrom(original);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Copy constructor.
 * @param original the PropertyValue to copy (never <code>null</code>)
 */
public PropertyValue(PropertyValue original) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = original.getValue();
  this.source = original.getSource();
  this.optional = original.isOptional();
  this.converted = original.converted;
  this.convertedValue = original.convertedValue;
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  this.resolvedDescriptor = original.resolvedDescriptor;
  copyAttributesFrom(original);
}

代码示例来源:origin: camunda/camunda-bpm-platform

pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
if (pd == null || pd.getWriteMethod() == null) {
  if (pv.isOptional()) {
    logger.debug("Ignoring optional value for property '" + actualName +
        "' - property not found on bean class [" + getRootClass().getName() + "]");

代码示例来源:origin: apache/servicemix-bundles

/**
 * Constructor that exposes a new value for an original value holder.
 * The original holder will be exposed as source of the new holder.
 * @param original the PropertyValue to link to (never {@code null})
 * @param newValue the new value to apply
 */
public PropertyValue(PropertyValue original, Object newValue) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = newValue;
  this.optional = original.isOptional();
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original);
  copyAttributesFrom(original);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Copy constructor.
 * @param original the PropertyValue to copy (never {@code null})
 */
public PropertyValue(PropertyValue original) {
  Assert.notNull(original, "Original must not be null");
  this.name = original.getName();
  this.value = original.getValue();
  this.optional = original.isOptional();
  this.converted = original.converted;
  this.convertedValue = original.convertedValue;
  this.conversionNecessary = original.conversionNecessary;
  this.resolvedTokens = original.resolvedTokens;
  setSource(original.getSource());
  copyAttributesFrom(original);
}

代码示例来源:origin: apache/servicemix-bundles

private void processLocalProperty(PropertyTokenHolder tokens, PropertyValue pv) {
  PropertyHandler ph = getLocalPropertyHandler(tokens.actualName);
  if (ph == null || !ph.isWritable()) {
    if (pv.isOptional()) {
      if (logger.isDebugEnabled()) {
        logger.debug("Ignoring optional value for property '" + tokens.actualName +

相关文章