|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache
public class FileSystemStyleCache
The FileSystemStyleCache is a StyleProvider implementation which caches generated CSS style sheets on the file system.
StyleProvider
,
SkinStyleProvider
Constructor Summary | |
---|---|
protected |
FileSystemStyleCache(java.lang.String source,
java.lang.String target)
Creates a FileSystemStyleCache. |
Method Summary | |
---|---|
protected StyleSheetDocument |
createStyleSheetDocument(StyleContext context)
Creates the StyleSheetDocument for this StyleProvider. |
java.lang.String |
getContentStyleType(StyleContext context)
Returns the mime type for the styles provided by this FileSystemStyleCache - "text/css". |
java.util.Map<java.lang.String,java.lang.String> |
getShortStyleClasses(StyleContext context)
Returns a Map which maps style class names to equivalent shorter names. |
StyleMap |
getStyleMap(StyleContext context)
Implementation of StyleProvider.getStyleMap(). |
java.lang.String |
getStyleSheetURI(StyleContext context)
Implementation of StyleCache.getStyleSheetURI(). |
protected java.lang.String |
getTargetStyleSheetName(StyleContext context,
StyleSheetDocument document)
Returns the name to use for the generated style sheet file . |
protected boolean |
hasSourceDocumentChanged(StyleContext context)
Tests whether the source style sheet files have been modified since the last call to createStyleSheetDocument(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected FileSystemStyleCache(java.lang.String source, java.lang.String target)
source
- The path of the source XSS document. The
specified file must be a valid XSS document. If the specified
file does not exists, an IllegalArgumentException is thrown.target
- The path of the target directory. Generated
CSS files are stored in this directory. If the directory
does not exist and can not be created, an IllegalArgumentException
is thrown.Method Detail |
---|
public java.lang.String getContentStyleType(StyleContext context)
getContentStyleType
in interface StyleProvider
public java.lang.String getStyleSheetURI(StyleContext context)
getStyleSheetURI
in interface StyleProvider
context
- The context which describes the end user
environment for this request
public StyleMap getStyleMap(StyleContext context)
getStyleMap
in interface StyleProvider
context
- The context which describes the target end user
environment
public java.util.Map<java.lang.String,java.lang.String> getShortStyleClasses(StyleContext context)
FileSystemStyleCache automatically generates short versions of every style class that is found the the underlying XSS document. FileSystemStyleCache clients can reduce the size of generated content by using this method to obtain short versions of any rendered style classes.
Note: The returned Map uses String keys to represent the full class names. However, the short style class values may not necessarily be type java.lang.String. Clients must avoid explicitly casting the values contained in the Map to type String. Instead, such values should be passed directly to the ResponseWriter API to be rendered. Or, if the String representation is required, toString() should be called on the value.
getShortStyleClasses
in interface StyleProvider
context
- The StyleContext
protected StyleSheetDocument createStyleSheetDocument(StyleContext context)
context
- The StyleContext
(not needed here, but is needed in subclass)
protected boolean hasSourceDocumentChanged(StyleContext context)
protected java.lang.String getTargetStyleSheetName(StyleContext context, StyleSheetDocument document)
context
- The StyleContextdocument
- The StyleSheetDocument which provides the styles
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |