public class CSSDocumentCache extends ConcurrentCacheStoreBase<ICSSDocument>
ICSSDocument
at workspace level. The CSS model can be a
"defaults.css" file inside a SWC library, or a CSS file on the disk.
The cache key is normalized path to the SWC file (optional) and the CSS file
name inside the SWC. The cache value is an ICSSDocument
.
Modifier and Type | Class and Description |
---|---|
static class |
CSSDocumentCache.CSSDocumentCacheKey
Key object for
CSSDocumentCache . |
protected static class |
CSSDocumentCache.CSSDocumentCacheKey2
Key object for
CSSDocumentCache . |
static class |
CSSDocumentCache.ProblemParsingCSSRuntimeException
Since
ConcurrentCacheStoreBase.get(org.apache.flex.compiler.internal.caches.CacheStoreKeyBase) doesn't return compiler
problems, when there's problem parsing CSS file in
createEntryValue(org.apache.flex.compiler.internal.caches.CacheStoreKeyBase) , we have to throw a runtime exception to pass
the compiler problems to the caller of the cache store. |
Modifier and Type | Field and Description |
---|---|
static String[] |
ALL_DEFAULTS_CSS_FILENAMES |
static ICSSDocument |
EMPTY_CSS_DOCUMENT
Since
ConcurrentCacheStoreBase does not allow null values, when a
SWC library does not have a "defaults.css" file, this dummy value is
used. |
Constructor and Description |
---|
CSSDocumentCache() |
Modifier and Type | Method and Description |
---|---|
protected ICSSDocument |
createEntryValue(CacheStoreKeyBase key)
Concrete class must implement this method to create a cache value object.
|
static CacheStoreKeyBase |
createKey(ISWC swc,
String cssFileName)
Create a cache key for
CSSDocumentCache that references
a CSS file in a SWC. |
static CacheStoreKeyBase |
createKey(String cssFileName)
Create a cache key for
CSSDocumentCache that references
a CSS file on disk. |
ICSSDocument |
getDefaultsCSS(ISWC swc,
Integer compatibilityVersion)
Get the "default" CSS model in a SWC library.
|
get, remove, size, toString
public static final ICSSDocument EMPTY_CSS_DOCUMENT
ConcurrentCacheStoreBase
does not allow null values, when a
SWC library does not have a "defaults.css" file, this dummy value is
used.public static String[] ALL_DEFAULTS_CSS_FILENAMES
public static CacheStoreKeyBase createKey(ISWC swc, String cssFileName)
CSSDocumentCache
that references
a CSS file in a SWC.swc
- SWC filecssFileName
- CSS file nameCSSDocumentCache
.public static CacheStoreKeyBase createKey(String cssFileName)
CSSDocumentCache
that references
a CSS file on disk.cssFileName
- CSS file nameCSSDocumentCache
.protected ICSSDocument createEntryValue(CacheStoreKeyBase key)
ConcurrentCacheStoreBase
ConcurrentCacheStoreBase.get(CacheStoreKeyBase)
is
responsible for reading and writing the cache table.createEntryValue
in class ConcurrentCacheStoreBase<ICSSDocument>
key
- cache keypublic ICSSDocument getDefaultsCSS(ISWC swc, Integer compatibilityVersion)
compatibility-version=3
is set, this method will try to get
"defaults-3.0.0.css" first. If the compatibility version isn't present,
it will fall back to "defaults.css".swc
- SWC file.compatibilityVersion
- Compatibility version, or null if the
compiler is not under compatibility mode.Copyright © 2016 The Apache Software Foundation. All rights reserved.