|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.caja.lang.css.CssSchema
public final class CssSchema
Definitions of CSS properties and symbols.
Nested Class Summary | |
---|---|
static class |
CssSchema.CssPropertyInfo
Encapsulates a css property and its signatures. |
private static class |
CssSchema.RegexpCriterion
|
static class |
CssSchema.SymbolInfo
Encapsulates a css symbol. |
Field Summary | |
---|---|
private static Criterion<java.lang.String> |
ALL_ELEMENTS
|
private static Criterion<java.lang.String> |
ALL_MEDIA
|
private static java.util.regex.Pattern |
CSS_IDENTIFIER
|
private static Pair<CssSchema,java.util.List<Message>> |
defaultSchema
|
private java.util.Set<Name> |
functionsAllowed
|
private static java.util.regex.Pattern |
HTML_IDENTIFIER
|
private static java.util.regex.Pattern |
JS_IDENTIFIER
|
private java.util.Set<Name> |
keywords
|
private java.util.Map<Name,CssSchema.CssPropertyInfo> |
properties
|
private java.util.Set<Name> |
propertiesAllowed
|
private java.util.Map<Name,CssSchema.SymbolInfo> |
symbols
|
Constructor Summary | |
---|---|
CssSchema(WhiteList symbolsAndProperties,
WhiteList functions)
|
Method Summary | |
---|---|
private static Criterion<java.lang.String> |
criterionFromConfig(java.lang.Object type,
Criterion<java.lang.String> permissiveCriterion)
|
private void |
defineProperty(Name name,
java.lang.String sig,
java.lang.String defaultValue,
Criterion<java.lang.String> appliesTo,
boolean inherited,
Criterion<java.lang.String> mediaGroups,
java.util.List<java.lang.String> dom2properties)
|
private void |
defineSymbol(Name name,
java.lang.String sig)
|
java.util.Collection<CssSchema.CssPropertyInfo> |
getCssProperties()
All defined properties including disallowed ones. |
CssSchema.CssPropertyInfo |
getCssProperty(Name propertyName)
Returns the signature and other information for a css property. |
static CssSchema |
getDefaultCss21Schema(MessageQueue mq)
|
CssSchema.SymbolInfo |
getSymbol(Name symbolName)
Returns the signature for a css symbol. |
private static Criterion<java.lang.String> |
in(java.lang.String... elementGroups)
|
boolean |
isFunctionAllowed(Name name)
Is the given word the name of a CSS function? |
boolean |
isKeyword(Name name)
Is the given word a css keyword? |
static boolean |
isMediaType(java.lang.String mediaType)
|
boolean |
isPropertyAllowed(Name name)
Is the given word the name of an allowed CSS property? |
private static WhiteList.TypeDefinition |
merge(WhiteList.TypeDefinition wl1,
WhiteList.TypeDefinition wl2)
|
private static CssPropertySignature |
parseSignature(Name name,
java.lang.String sig)
Parses a CssSignature according to the grammar described in http://www.w3.org/TR/CSS21/about.html#property-defs |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.Map<Name,CssSchema.CssPropertyInfo> properties
private final java.util.Map<Name,CssSchema.SymbolInfo> symbols
private final java.util.Set<Name> keywords
private final java.util.Set<Name> functionsAllowed
private final java.util.Set<Name> propertiesAllowed
private static Pair<CssSchema,java.util.List<Message>> defaultSchema
private static final java.util.regex.Pattern HTML_IDENTIFIER
private static final java.util.regex.Pattern CSS_IDENTIFIER
private static final java.util.regex.Pattern JS_IDENTIFIER
private static final Criterion<java.lang.String> ALL_ELEMENTS
private static final Criterion<java.lang.String> ALL_MEDIA
Constructor Detail |
---|
public CssSchema(WhiteList symbolsAndProperties, WhiteList functions)
Method Detail |
---|
public static CssSchema getDefaultCss21Schema(MessageQueue mq)
public CssSchema.CssPropertyInfo getCssProperty(Name propertyName)
propertyName
- non null.
public java.util.Collection<CssSchema.CssPropertyInfo> getCssProperties()
public CssSchema.SymbolInfo getSymbol(Name symbolName)
symbolName
- non null.
public boolean isKeyword(Name name)
public boolean isFunctionAllowed(Name name)
public boolean isPropertyAllowed(Name name)
public static boolean isMediaType(java.lang.String mediaType)
private static Criterion<java.lang.String> in(java.lang.String... elementGroups)
private static Criterion<java.lang.String> criterionFromConfig(java.lang.Object type, Criterion<java.lang.String> permissiveCriterion)
private void defineProperty(Name name, java.lang.String sig, java.lang.String defaultValue, Criterion<java.lang.String> appliesTo, boolean inherited, Criterion<java.lang.String> mediaGroups, java.util.List<java.lang.String> dom2properties)
private void defineSymbol(Name name, java.lang.String sig)
private static CssPropertySignature parseSignature(Name name, java.lang.String sig)
private static WhiteList.TypeDefinition merge(WhiteList.TypeDefinition wl1, WhiteList.TypeDefinition wl2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |