StringPool
package jodd.util;
public interface StringPool {
String JODD = "jodd";
String AMPERSAND = "&";
String AND = "and";
String AT = "@";
String ASTERISK = "*";
String STAR = ASTERISK;
String BACK_SLASH = "\\";
String COLON = ":";
String COMMA = ",";
String DASH = "-";
String DOLLAR = "$";
String DOT = ".";
String DOTDOT = "..";
String DOT_CLASS = ".class";
String DOT_JAVA = ".java";
String EMPTY = "";
String EQUALS = "=";
String FALSE = "false";
String SLASH = "/";
String HASH = "#";
String HAT = "^";
String LEFT_BRACE = "{";
String LEFT_BRACKET = "(";
String LEFT_CHEV = "<";
String NEWLINE = "\n";
String N = "n";
String NO = "no";
String NULL = "null";
String OFF = "off";
String ON = "on";
String PERCENT = "%";
String PIPE = "|";
String PLUS = "+";
String QUESTION_MARK = "?";
String EXCLAMATION_MARK = "!";
String QUOTE = "\"";
String RETURN = "\r";
String TAB = "\t";
String RIGHT_BRACE = "}";
String RIGHT_BRACKET = ")";
String RIGHT_CHEV = ">";
String SEMICOLON = ";";
String SINGLE_QUOTE = "'";
String BACKTICK = "`";
String SPACE = " ";
String LEFT_SQ_BRACKET = "[";
String RIGHT_SQ_BRACKET = "]";
String TRUE = "true";
String UNDERSCORE = "_";
String UTF_8 = "UTF-8";
String US_ASCII = "US-ASCII";
String ISO_8859_1 = "ISO-8859-1";
String Y = "y";
String YES = "yes";
String ONE = "1";
String ZERO = "0";
String DOLLAR_LEFT_BRACE= "${";
String CRLF = "\r\n";
String HTML_NBSP = " ";
String HTML_AMP = "&";
String HTML_QUOTE = """;
String HTML_LT = "<";
String HTML_GT = ">";
// ---------------------------------------------------------------- array
String[] EMPTY_ARRAY = new String[0];
}
String
package java.lang
String.format("%s %s", OAuth2AccessToken.BEARER_TYPE, token)
OGNL表达式
//非根元素
@Test
public void testOgnl1() throws OgnlException {
//创建一个Ognl上下文对象
OgnlContext context = new OgnlContext();
/**
* 2.OgnlContext放入对象数据
*/
//创建对象,设置对象属性
UserDemo user = new UserDemo();
user.setId(100);
user.setName("Jack");
//【往非根元素放入数据,取值的时候表达式要用“#”】
context.put("user",user);
//获取对象属性
//使用这种方式也可以获取
Object s = context.get("user");
System.out.println(s);
//使用Ognl表达式来获取
//举例:例如标签<s:a value="#user.id">取值,实际上就是运行了下面的代码获取的
//先构建一个Ognl表达式,再解析表达式
Object ognl = Ognl.parseExpression("#user.id");//构建Ognl表达式
Object value1 = Ognl.getValue(ognl, context, context.getRoot());//解析表达式
System.out.println(value1);
}