@GwtCompatible public final class SafeStyleSheets extends Object
SafeStyleSheet
.Modifier and Type | Method and Description |
---|---|
static SafeStyleSheet |
fromConstant(String styleSheet)
Creates a SafeStyleSheet from the given compile-time constant string
style . |
static SafeStyleSheet |
fromProto(SafeStyleSheetProto proto)
Deserializes a SafeStyleSheetProto into a SafeStyleSheet instance.
|
static SafeStyleSheetProto |
toProto(SafeStyleSheet style)
Serializes a SafeStyleSheet into its opaque protocol message representation.
|
public static SafeStyleSheet fromConstant(@CompileTimeConstant String styleSheet)
style
.
styleSheet
must not have any < characters in it so that the syntactic
structure of any surrounding CSS and HTML is not affected.
IllegalArgumentException
- if styleSheet
contains <public static SafeStyleSheet fromProto(SafeStyleSheetProto proto)
Protocol-message forms are intended to be opaque. The fields of the protocol message should
be considered encapsulated and are not intended for direct inspection or manipulation. Protocol
message forms of this type should be produced by toProto(SafeStyleSheet)
or its
equivalent in other implementation languages.
Important: It is unsafe to invoke this method on a protocol message that has been received from an entity outside the application's trust domain. Data coming from the browser is outside the application's trust domain.
public static SafeStyleSheetProto toProto(SafeStyleSheet style)
Protocol message forms of this type are intended to be opaque. The fields of the returned
protocol message should be considered encapsulated and are not intended for direct inspection
or manipulation. Protocol messages can be converted back into a SafeStyleSheet using
fromProto(SafeStyleSheetProto)
.