/** * Wraps an assumed-safe CSS constant. * * <p>This only accepts compile-time constants, based on the assumption that URLs that are * controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantCss(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.CSS, Dir.LTR); }
/** * Wraps an assumed-safe URI constant. * * <p>This only accepts compile-time constants, based on the assumption that URLs that are * controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantUri(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.URI, Dir.LTR); }
/** * Wraps an assumed-safe constant string that specifies an attribute. * * <p>This only accepts compile-time constants, based on the assumption that attributes that are * controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.ATTRIBUTES, Dir.LTR); }
/** * Wraps an assumed-safe URI constant. * * <p>This only accepts compile-time constants, based on the assumption that URLs that are * controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantUri(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.URI, Dir.LTR); }
/** * Wraps an assumed-safe constant string that specifies a safe, balanced, document fragment. * * <p>This only accepts compile-time constants, based on the assumption that HTML snippets that * are controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantHtml(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.HTML, null); }
/** * Wraps an assumed-safe constant string that specifies a safe, balanced, document fragment. * * <p>This only accepts compile-time constants, based on the assumption that HTML snippets that * are controlled by the application (and not user input) are considered safe. */ public static SanitizedContent constantHtml(@CompileTimeConstant final String constant) { return fromConstant(constant, ContentKind.HTML, null); }