/** * Escape HTML entities in a string */ @Functions.Expose(prefix = "os", names = {"htmlEncode"}) public static String htmlEncode(String text) { if (text == null) { return null; } return StringEscapeUtils.escapeHtml4(text); }
/** * Escape HTML entities in a string */ @Functions.Expose(prefix = "os", names = {"htmlEncode"}) public static String htmlEncode(String text) { if (text == null) { return null; } return StringEscapeUtils.escapeHtml4(text); }
/** * Decode a base-64 encoded string. */ @Functions.Expose(prefix = "osx", names = {"decodeBase64"}) public static String decodeBase64(String text) { if (text == null) { return null; } // TODO: allow a charset to be passed in? return CharsetUtil.newUtf8String(Base64.decodeBase64(CharsetUtil.getUtf8Bytes(text))); }
/** * Static function, should be exposed under two names. */ @Functions.Expose(prefix="other", names={"bonjour"}) public static String sayHi2() { return "French hello"; }
/** * Form decode a string * @param text * @return */ @Functions.Expose(prefix = "os", names = {"urlDecode"}) public static String formDecode(String text) { if (text == null) { return null; } return Utf8UrlCoder.decode(text); }
/** * Decode a base-64 encoded string. */ @Functions.Expose(prefix = "osx", names = {"decodeBase64"}) public static String decodeBase64(String text) { if (text == null) { return null; } // TODO: allow a charset to be passed in? return CharsetUtil.newUtf8String(Base64.decodeBase64(CharsetUtil.getUtf8Bytes(text))); }
/** * Static function, should be exposed under two names. */ @Functions.Expose(prefix="test", names={"hi", "hola"}) public static String sayHi() { return "hi"; }
/** * Non-static: shouldn't be exposed. */ @Functions.Expose(prefix="test", names={"goodbye"}) public String sayGoodbye() { return "goodbye"; } }
/** * Form encode a string */ @Functions.Expose(prefix = "osx", names = {"urlEncode"}) public static String formEncode(String text) { if (text == null) { return null; } return Utf8UrlCoder.encode(text); }
/** * Test with some arguments. */ @Functions.Expose(prefix="test", names={"add"}) public static int add(int i, int j) { return i + j; }
/** * Static function, should be exposed under two names. */ @Functions.Expose(prefix="test", names={"hi", "hola"}) public static String sayHi() { return "hi"; }
/** * Form encode a string */ @Functions.Expose(prefix = "os", names = {"urlEncode"}) public static String formEncode(String text) { if (text == null) { return null; } return Utf8UrlCoder.encode(text); }
/** * Test with some arguments. */ @Functions.Expose(prefix="test", names={"add"}) public static int add(int i, int j) { return i + j; }
/** * Form encode a string */ @Functions.Expose(prefix = "os", names = {"urlEncode"}) public static String formEncode(String text) { if (text == null) { return null; } return Utf8UrlCoder.encode(text); }
/** * Non-static: shouldn't be exposed. */ @Functions.Expose(prefix="test", names={"goodbye"}) public String sayGoodbye() { return "goodbye"; } }
/** * Static function, should be exposed under two names. */ @Functions.Expose(prefix="other", names={"bonjour"}) public static String sayHi2() { return "French hello"; }
/** * Test with some arguments. */ @Functions.Expose(prefix="test", names={"add"}) public static int add(int i, int j) { return i + j; }
/** * Static function, should be exposed under two names. */ @Functions.Expose(prefix="other", names={"bonjour"}) public static String sayHi2() { return "French hello"; }
/** * Test with some arguments. */ @Functions.Expose(prefix="test", names={"add"}) public static int add(int i, int j) { return i + j; }
/** * Form decode a string * @param text * @return */ @Functions.Expose(prefix = "os", names = {"urlDecode"}) public static String formDecode(String text) { if (text == null) { return null; } return Utf8UrlCoder.decode(text); }