优化目录

master
xuchengsheng 2023-12-06 23:07:20 +08:00
parent fb5c3db157
commit 2db6b42c55
4 changed files with 65 additions and 1 deletions

View File

@ -313,9 +313,11 @@
📢 想要一起加入我们的精彩微信群吗?跟着以下简单步骤: 📢 想要一起加入我们的精彩微信群吗?跟着以下简单步骤:
1**扫描我的二维码**:使用微信的扫一扫功能,扫描下方的二维码,将我添加为你的好友。 1**扫描我的二维码**:使用微信的扫一扫功能,扫描下方的二维码,将我添加为你的好友。
<div> <div>
<img alt="logo" src="image/wechat-group.jpg" style="width: 344px;height: 483px"> <img alt="logo" src="image/wechat-group.jpg" style="width: 344px;height: 483px">
</div> </div>
2**等待好友请求被接受**:一旦你的好友请求被接受,你将收到一份群组邀请。 2**等待好友请求被接受**:一旦你的好友请求被接受,你将收到一份群组邀请。
3**点击邀请链接**:打开邀请链接,立即加入我们的精彩群组! 3**点击邀请链接**:打开邀请链接,立即加入我们的精彩群组!

View File

@ -0,0 +1,12 @@
package com.xcs.spring;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import java.text.SimpleDateFormat;
public class MyCustomDateEditor extends CustomDateEditor {
public MyCustomDateEditor(){
super(new SimpleDateFormat("yyyy-MM-DD"),false);
}
}

View File

@ -1,8 +1,23 @@
package com.xcs.spring; package com.xcs.spring;
import com.xcs.spring.bean.MyBean;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import java.util.Date;
public class PropertyEditorDemo { public class PropertyEditorDemo {
public static void main(String[] args) { public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.refresh();
RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(MyBean.class);
rootBeanDefinition.getPropertyValues().add("path", "/opt/myfile");
rootBeanDefinition.getPropertyValues().add("date", "2023-12-5");
context.registerBeanDefinition("myBean", rootBeanDefinition);
context.getBeanFactory().registerCustomEditor(Date.class, MyCustomDateEditor.class);
System.out.println("myBean= " + context.getBean("myBean"));
} }
} }

View File

@ -0,0 +1,35 @@
package com.xcs.spring.bean;
import java.nio.file.Path;
import java.util.Date;
public class MyBean {
private Path path;
private Date date;
public Path getPath() {
return path;
}
public void setPath(Path path) {
this.path = path;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
@Override
public String toString() {
return "MyBean{" +
"path=" + path +
", date=" + date +
'}';
}
}