-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huangdi
committed
Jul 6, 2018
1 parent
65af2c5
commit 2bb190c
Showing
7 changed files
with
589 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http:https://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>daydayup</artifactId> | ||
<groupId>com.github.landyking</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>learn-springel</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-expression</artifactId> | ||
<version>4.3.12.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-core</artifactId> | ||
<version>4.3.12.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>4.3.12.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context-support</artifactId> | ||
<version>4.3.12.RELEASE</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
17 changes: 17 additions & 0 deletions
17
learn-springel/src/test/java/springel/ApplicationContextFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package springel; | ||
|
||
import org.springframework.beans.factory.support.RootBeanDefinition; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.support.GenericApplicationContext; | ||
|
||
/** | ||
* Created by landy on 2018/7/5. | ||
*/ | ||
public class ApplicationContextFactory { | ||
public static ApplicationContext createInstance() { | ||
GenericApplicationContext app = new GenericApplicationContext(); | ||
app.registerBeanDefinition("SpElUtil", new RootBeanDefinition(SpElUtil.class)); | ||
app.refresh(); | ||
return app; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package springel; | ||
|
||
/** | ||
* Created by landy on 2018/7/5. | ||
*/ | ||
public class Date2 { | ||
private int year; | ||
private int month; | ||
private int day; | ||
|
||
public int getYear() { | ||
return year; | ||
} | ||
|
||
public void setYear(int year) { | ||
this.year = year; | ||
} | ||
|
||
public int getMonth() { | ||
return month; | ||
} | ||
|
||
public void setMonth(int month) { | ||
this.month = month; | ||
} | ||
|
||
public int getDay() { | ||
return day; | ||
} | ||
|
||
public void setDay(int day) { | ||
this.day = day; | ||
} | ||
|
||
public Date2(int year, int month, int day) { | ||
this.year=year; | ||
this.month=month; | ||
this.day=day; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package springel; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* Created by landy on 2018/7/5. | ||
*/ | ||
public class SpElUtil { | ||
private String name; | ||
private SpelTestInnerClass innerClass; | ||
private Date2 time; | ||
private Map<String, Object> maps = new HashMap<String, Object>(); | ||
private List<Integer> numbers; | ||
|
||
public SpElUtil() { | ||
maps.put("key", Arrays.asList(1, 3, 4)); | ||
maps.put("1", "string1"); | ||
this.time = new Date2(111, 1, 2); | ||
innerClass = new SpelTestInnerClass(); | ||
} | ||
|
||
public List<Integer> getNumbers() { | ||
return numbers; | ||
} | ||
|
||
public void setNumbers(List<Integer> integers) { | ||
this.numbers=integers; | ||
} | ||
|
||
public SpelTestInnerClass getInnerClass() { | ||
return innerClass; | ||
} | ||
|
||
public Map<String, Object> getMaps() { | ||
return maps; | ||
} | ||
|
||
public void setMaps(Map<String, Object> maps) { | ||
this.maps = maps; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setTime(Date2 time) { | ||
this.time = time; | ||
} | ||
|
||
public Date2 getTime() { | ||
return time; | ||
} | ||
|
||
public static int len(String name) { | ||
return name.length(); | ||
} | ||
|
||
public void setInnerClass(SpelTestInnerClass innerClass) { | ||
this.innerClass = innerClass; | ||
} | ||
} |
Oops, something went wrong.