First drop of SPEL
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
public class Company {
|
||||
String address;
|
||||
|
||||
public Company(String string) {
|
||||
this.address = string;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
public class Fruit {
|
||||
public String name; // accessible as property field
|
||||
public Color color; // accessible as property through getter/setter
|
||||
public String colorName; // accessible as property through getter/setter
|
||||
|
||||
public Fruit(String name, Color color, String colorName) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
this.colorName = colorName;
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "A" + (colorName.startsWith("o") ? "n " : " ") + colorName + " " + name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Inventor {
|
||||
private String name;
|
||||
private PlaceOfBirth placeOfBirth;
|
||||
Date birthdate;
|
||||
private int sinNumber;
|
||||
private String nationality;
|
||||
private String[] inventions;
|
||||
public String randomField;
|
||||
|
||||
public Inventor(String name, Date birthdate, String nationality) {
|
||||
this.name = name;
|
||||
this.birthdate = birthdate;
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public void setPlaceOfBirth(PlaceOfBirth placeOfBirth2) {
|
||||
this.placeOfBirth = placeOfBirth2;
|
||||
}
|
||||
|
||||
public void setInventions(String[] inventions) {
|
||||
this.inventions = inventions;
|
||||
}
|
||||
|
||||
public PlaceOfBirth getPlaceOfBirth() {
|
||||
return placeOfBirth;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String echo(Object o) {
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
public String sayHelloTo(String person) {
|
||||
return "hello " + person;
|
||||
}
|
||||
|
||||
public String joinThreeStrings(String a, String b, String c) {
|
||||
return a + b + c;
|
||||
}
|
||||
|
||||
public int aVarargsMethod(String...strings ) {
|
||||
if (strings==null) return 0;
|
||||
return strings.length;
|
||||
}
|
||||
public int aVarargsMethod2(int i, String...strings ) {
|
||||
if (strings==null) return i;
|
||||
return strings.length+i;
|
||||
}
|
||||
|
||||
public Inventor(String...strings ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
|
||||
public class Person {
|
||||
private String privateName;
|
||||
Company company;
|
||||
|
||||
public Person(String name) {
|
||||
this.privateName = name;
|
||||
}
|
||||
|
||||
public Person(String name, Company company) {
|
||||
this.privateName = name;
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return privateName;
|
||||
}
|
||||
|
||||
public void setName(String n) {
|
||||
this.privateName = n;
|
||||
}
|
||||
|
||||
public Company getCompany() {
|
||||
return company;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
public class PlaceOfBirth {
|
||||
private String city;
|
||||
|
||||
@Override
|
||||
public String toString() {return "PlaceOfBirth("+city+")";}
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
public void setCity(String s) {
|
||||
this.city = s;
|
||||
}
|
||||
|
||||
public PlaceOfBirth(String string) {
|
||||
this.city=string;
|
||||
}
|
||||
|
||||
public int doubleIt(int i) {
|
||||
return i*2;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user