我在 IntelliJ 使用 Gradle 获取自定义 Spring 配置元数据时遇到问题。
如果我使用初始化程序创建一个新的 Spring Boot 项目,在依赖项中包含配置处理器,在 Gradle 任务上设置以下任务,
创建一个包含以下内容的类:
package com.example.demo;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties("mycustomconfig")
public class MyCustomConfig {
private String name;
public String getName() {
return name;
}
public MyCustomConfig setName(String name) {
this.name = name;
return this;
}
}
Run Code Online (Sandbox Code Playgroud)
然后 IntelliJ 在类文件中抱怨“在类路径中找不到 Spring Boot 配置注释处理器”,即使它肯定在类路径上。
运行应用程序后,会生成一个包含build/classes/java/main/META-INF/spring-configuration-metadata.json以下内容的文件:
{
"groups": [
{
"name": "mycustomconfig",
"type": "com.example.demo.MyCustomConfig",
"sourceType": "com.example.demo.MyCustomConfig"
}
],
"properties": [
{
"name": "mycustomconfig.name",
"type": "java.lang.String",
"sourceType": "com.example.demo.MyCustomConfig"
}
], …Run Code Online (Sandbox Code Playgroud) 我正在尝试了解 JavaFX 的坐标系。
对于某些节点(形状?),例如Line或Rectangle我可以(或应该)在坐标系中指定 ax 和 y 值。
这究竟是什么?这是稍后附加到节点或其他东西的平移和拉伸吗?其他节点只有一个setLayoutX()方法,而例如Line具有setLayoutX()和setStartX()。
谢谢!