类org.springframework.boot.context.properties.DeprecatedConfigurationProperty源码实例Demo

下面列出了怎么用org.springframework.boot.context.properties.DeprecatedConfigurationProperty的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: spring-cloud-alibaba   文件: SentinelProperties.java
@Deprecated
@DeprecatedConfigurationProperty(
		reason = "replaced to SentinelProperties#blockPage.",
		replacement = SentinelConstants.PROPERTY_PREFIX + ".block-page")
public String getBlockPage() {
	return blockPage;
}
 
/**
 * recommend to use {@link NacosConfigProperties#sharedConfigs} .
 * @return string
 */
@Deprecated
@DeprecatedConfigurationProperty(
		reason = "replaced to NacosConfigProperties#sharedConfigs and not use it at the same time.",
		replacement = PREFIX + ".shared-configs[x]")
public String getSharedDataids() {
	return null == getSharedConfigs() ? null : getSharedConfigs().stream()
			.map(Config::getDataId).collect(Collectors.joining(COMMAS));
}
 
/**
 * Not providing support,the need to refresh is specified by the respective refresh
 * configuration and not use it at the same time .
 * @return string
 */
@Deprecated
@DeprecatedConfigurationProperty(
		reason = "replaced to NacosConfigProperties#sharedConfigs and not use it at the same time.",
		replacement = PREFIX + ".shared-configs[x].refresh")
public String getRefreshableDataids() {
	return null == getSharedConfigs() ? null
			: getSharedConfigs().stream().filter(Config::isRefresh)
					.map(Config::getDataId).collect(Collectors.joining(COMMAS));
}
 
/**
 * recommend to use
 * {@link com.alibaba.cloud.nacos.NacosConfigProperties#extensionConfigs} and not use
 * it at the same time .
 * @return extensionConfigs
 */
@Deprecated
@DeprecatedConfigurationProperty(
		reason = "replaced to NacosConfigProperties#extensionConfigs and not use it at the same time .",
		replacement = PREFIX + ".extension-configs[x]")
public List<Config> getExtConfig() {
	return this.getExtensionConfigs();
}
 
private void createComponentConfigurationSource(String packageName, ComponentModel model, String overrideComponentName) throws MojoFailureException {
    int pos = model.getJavaType().lastIndexOf(".");
    String name = model.getJavaType().substring(pos + 1);
    name = name.replace("Component", "ComponentConfiguration");

    final JavaClass javaClass = new JavaClass(getProjectClassLoader());
    javaClass.setPackage(packageName);
    javaClass.setName(name);
    javaClass.extendSuperType("ComponentConfigurationPropertiesCommon");
    javaClass.addImport("org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon");

    // add bogus field for enabled so spring boot tooling can get the
    // javadoc as description in its metadata
    Property bogus = javaClass.addProperty("java.lang.Boolean", "enabled");
    String scheme = overrideComponentName != null ? overrideComponentName : model.getScheme();
    bogus.getField().getJavaDoc().setText("Whether to enable auto configuration of the " + scheme + " component. This is enabled by default.");
    bogus.removeAccessor();
    bogus.removeMutator();

    String doc = "Generated by camel-package-maven-plugin - do not edit this file!";
    if (!Strings.isNullOrEmpty(model.getDescription())) {
        doc = model.getDescription() + "\n\n" + doc;
    }
    javaClass.getJavaDoc().setText(doc);

    String prefix = "camel.component." + (overrideComponentName != null ? overrideComponentName : model.getScheme());
    // make sure prefix is in lower case
    prefix = prefix.toLowerCase(Locale.US);
    javaClass.addAnnotation(Generated.class.getName()).setStringValue("value", SpringBootAutoConfigurationMojo.class.getName());
    javaClass.addAnnotation("org.springframework.boot.context.properties.ConfigurationProperties").setStringValue("prefix", prefix);

    for (ComponentOptionModel option : model.getComponentOptions()) {

        if (skipComponentOption(model, option)) {
            // some component options should be skipped
            continue;
        }

        String type = option.getJavaType();

        // generate inner class for non-primitive options
        type = getSimpleJavaType(type);

        // spring-boot auto configuration does not support complex types
        // (unless they are enum, nested)
        // and if so then we should use a String type so spring-boot and its
        // tooling support that
        // as Camel will be able to convert the string value into a lookup
        // of the bean in the registry anyway
        // and therefore there is no problem, eg
        // camel.component.jdbc.data-source = myDataSource
        // where the type would have been javax.sql.DataSource
        boolean complex = isComplexType(option) && isBlank(option.getEnums());
        if (complex) {
            // force to use a string type
            type = "java.lang.String";
        }

        Property prop = javaClass.addProperty(type, option.getName());
        if (option.isDeprecated()) {
            prop.getField().addAnnotation(Deprecated.class);
            prop.getAccessor().addAnnotation(Deprecated.class);
            prop.getMutator().addAnnotation(Deprecated.class);
            // DeprecatedConfigurationProperty must be on getter when deprecated
            prop.getAccessor().addAnnotation(DeprecatedConfigurationProperty.class);
        }
        if (!Strings.isNullOrEmpty(option.getDescription())) {
            String desc = option.getDescription();
            if (complex) {
                if (!desc.endsWith(".")) {
                    desc = desc + ".";
                }
                desc = desc + " The option is a " + option.getJavaType() + " type.";
            }
            prop.getField().getJavaDoc().setFullText(desc);
        }
        if (!isBlank(option.getDefaultValue())) {
            if ("java.lang.String".equals(option.getJavaType()) || "duration".equals(option.getType())) {
                prop.getField().setStringInitializer(option.getDefaultValue().toString());
            } else if ("long".equals(option.getJavaType()) || "java.lang.Long".equals(option.getJavaType())) {
                // the value should be a Long number
                String value = option.getDefaultValue() + "L";
                prop.getField().setLiteralInitializer(value);
            } else if ("integer".equals(option.getType()) || "java.lang.Integer".equals(option.getJavaType())
                    || "boolean".equals(option.getType()) || "java.lang.Boolean".equals(option.getJavaType())) {
                prop.getField().setLiteralInitializer(option.getDefaultValue().toString());
            } else if (!isBlank(option.getEnums())) {
                String enumShortName = type.substring(type.lastIndexOf(".") + 1);
                prop.getField().setLiteralInitializer(enumShortName + "." + option.getDefaultValue());
                javaClass.addImport(model.getJavaType());
            }
        }
    }

    String fileName = packageName.replaceAll("\\.", "\\/") + "/" + name + ".java";
    writeSourceIfChanged(javaClass, fileName, true);
}
 
@Deprecated
@DeprecatedConfigurationProperty
public String getCommand() {
    return command;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public Boolean getCache() {
    return cache;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public Boolean getCache() {
    return cache;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public Long getConnectTimeoutMillis() {
    return connectTimeoutMillis;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public Long getReadTimeoutMillis() {
    return readTimeoutMillis;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public String getWriteTimeoutMillis() {
    return writeTimeoutMillis;
}
 
@Deprecated
@DeprecatedConfigurationProperty
public String getComponentName() {
    return componentName;
}
 
源代码13 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.acknowledge-mode")
@Deprecated
public AcknowledgeMode getAcknowledgeMode() {
    return getSimple().getAcknowledgeMode();
}
 
源代码14 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.concurrency")
@Deprecated
public Integer getConcurrency() {
    return getSimple().getConcurrency();
}
 
源代码15 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.default-requeue-rejected")
@Deprecated
public Boolean getDefaultRequeueRejected() {
    return getSimple().getDefaultRequeueRejected();
}
 
源代码16 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.idle-event-interval")
@Deprecated
public Long getIdleEventInterval() {
    return getSimple().getIdleEventInterval();
}
 
源代码17 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.max-concurrency")
@Deprecated
public Integer getMaxConcurrency() {
    return getSimple().getMaxConcurrency();
}
 
源代码18 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.prefetch")
@Deprecated
public Integer getPrefetch() {
    return getSimple().getPrefetch();
}
 
源代码19 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.retry")
@Deprecated
public ListenerRetry getRetry() {
    return getSimple().getRetry();
}
 
源代码20 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.transaction-size")
@Deprecated
public Integer getTransactionSize() {
    return getSimple().getTransactionSize();
}
 
源代码21 项目: summerframework   文件: RabbitProperties.java
@DeprecatedConfigurationProperty(replacement = "spring.rabbitmq.listener.simple.auto-startup")
@Deprecated
public boolean isAutoStartup() {
    return getSimple().isAutoStartup();
}
 
源代码22 项目: SpringBoot2.0   文件: JiuxianProperties.java
@DeprecatedConfigurationProperty(replacement = "jiuxian.name-cn", reason = "deprecated")
public String getName() {
    return getNameCn();
}
 
@DeprecatedConfigurationProperty(replacement = "Use host + port properties instead")
public String getHostPort() {
  return hostPort;
}
 
源代码24 项目: thinking-in-spring-boot-samples   文件: User.java
@DeprecatedConfigurationProperty(reason = "不推荐使用 String 类型描述用户主页")
@Deprecated
public String getHomePage() {
    return homePage;
}
 
源代码25 项目: Spring-Boot-Examples   文件: CustomProperties.java
@DeprecatedConfigurationProperty(replacement = "custom.connection.address")
@Deprecated
public String getServer() {
    return getAddress();
}
 
源代码26 项目: code-examples   文件: MailModuleProperties.java
@DeprecatedConfigurationProperty(reason = "not needed anymore", replacement = "none")
public String getDefaultSubject() {
  return defaultSubject;
}
 
/**
 * Tells if rate limit response headers should be added to response.
 *
 * @deprecated use {{@link #responseHeaders}
 */
@Deprecated
@DeprecatedConfigurationProperty(replacement = "zuul.ratelimit.response-headers")
public boolean isAddResponseHeaders() {
    return !NONE.equals(responseHeaders);
}
 
@Deprecated
@DeprecatedConfigurationProperty(
		reason = "Backend version no longer required. The kv version is determined during secret retrieval")
public int getBackendVersion() {
	return this.backendVersion;
}
 
源代码29 项目: flowable-engine   文件: FlowableProperties.java
/**
 * @deprecated use {@link org.flowable.spring.boot.process.FlowableProcessProperties#getServlet()#getPath()}
 */
@DeprecatedConfigurationProperty(replacement = "flowable.process.servlet.path")
@Deprecated
public String getRestApiMapping() {
    throw new IllegalStateException("Usage of deprecated property. Use FlowableProcessProperties");
}
 
源代码30 项目: flowable-engine   文件: FlowableProperties.java
/**
 * @deprecated use {@link org.flowable.spring.boot.process.FlowableProcessProperties#getServlet()#getName()}
 */
@DeprecatedConfigurationProperty(replacement = "flowable.process.servlet.name")
@Deprecated
public String getRestApiServletName() {
    throw new IllegalStateException("Usage of deprecated property. Use FlowableProcessProperties");
}
 
 类所在包
 同包方法