org.apache.myfaces.trinidadinternal.style.xml.parse
Class StyleSheetDocument

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.style.xml.parse.StyleSheetDocument

public class StyleSheetDocument
extends java.lang.Object

Parsed representation of a Trinidad style sheet document. The StyleSheetDocument provides access to both style as well as icons information, but not to skin properties.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/style/xml/parse/StyleSheetDocument.java#0 $) $Date: 10-nov-2005.18:58:12 $

Field Summary
static long UNKNOWN_TIMESTAMP
          Value used to indicate that the document timestamp is not know.
 
Constructor Summary
StyleSheetDocument(StyleSheetNode[] styleSheets)
          Deprecated. 
StyleSheetDocument(StyleSheetNode[] styleSheets, java.lang.String documentVersion)
          Deprecated. 
StyleSheetDocument(StyleSheetNode[] styleSheets, java.lang.String documentVersion, long documentTimestamp)
          Creates a StyleSheetDocument
 
Method Summary
 java.lang.String getDocumentId(StyleContext sContext)
          Returns the StyleSheetDocument's id.
 long getDocumentTimestamp()
          Returns a timestamp which indicates when the underlying source files which were used to create this StyleSheetDocument were last modified.
 java.lang.String getDocumentVersion()
          Returns the version identifier for this style sheet document.
 java.util.Iterator<IconNode> getIcons(StyleContext context)
          Returns an Iterator of StyleNode objects for the specified context.
 StyleNode getStyleByName(StyleContext context, java.lang.String name)
          Returns the fully-resolved StyleNode for the style with the specified name.
 StyleNode getStyleBySelector(StyleContext context, java.lang.String selector)
          Returns the fully-resolved StyleNode for the style with the specified selector.
 java.util.Iterator<StyleNode> getStyles(StyleContext context)
          Returns an Iterator of StyleNode objects for the specified context.
 java.util.Iterator<StyleSheetNode> getStyleSheets()
          Implementation of StyleSheetDocument.getStyleSheets();
 java.util.Iterator<StyleSheetNode> getStyleSheets(StyleContext context)
          Returns all StyleSheetNodes which can be applied to the specified context, sorted from lowest to highest precedence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_TIMESTAMP

public static final long UNKNOWN_TIMESTAMP
Value used to indicate that the document timestamp is not know.

See Also:
Constant Field Values
Constructor Detail

StyleSheetDocument

@Deprecated
public StyleSheetDocument(StyleSheetNode[] styleSheets)
Deprecated. 

Creates a StyleSheetDocument


StyleSheetDocument

@Deprecated
public StyleSheetDocument(StyleSheetNode[] styleSheets,
                                     java.lang.String documentVersion)
Deprecated. 

Creates a StyleSheetDocument


StyleSheetDocument

public StyleSheetDocument(StyleSheetNode[] styleSheets,
                          java.lang.String documentVersion,
                          long documentTimestamp)
Creates a StyleSheetDocument

Parameters:
styleSheets - The StyleSheetNodes which define the contents of this StyleSheetDocument.
documentVersion - The version identifier for this StyleSheetDocument.
documentTimestamp - The timestamp for this StyleSheetDocument.
Method Detail

getDocumentId

public java.lang.String getDocumentId(StyleContext sContext)
Returns the StyleSheetDocument's id. StyleSheetDocument contains one or more StyleSheetNodes. StyleSheetNodes contain StyleNodes & locale, browser, direction, etc. We compute the hashcode of the StyleSheetDocument's styleSheetNodes(StyleContext) and return that as a document id. One use of this id is to use it in the Skin's generated CSS filename so the filename will change if the Skin's StyleSheetNodes change.

Parameters:
sContext - The current StyleContext which is used to get the stylesheets that match, and then we create an id based on those stylesheets
Returns:
String The document Id as a String.

getDocumentVersion

public java.lang.String getDocumentVersion()
Returns the version identifier for this style sheet document.


getDocumentTimestamp

public long getDocumentTimestamp()
Returns a timestamp which indicates when the underlying source files which were used to create this StyleSheetDocument were last modified. The semantics of this method are slightly different than the typical last modified timestamp (eg. File.lastModified()) in that the timestamp is determined when the StyleSheetDocument is created. The StyleSheetDocument itself represents the contents of a style sheet at a particular moment in time - and does not detect later updates to the underlying source files.


getStyleSheets

public java.util.Iterator<StyleSheetNode> getStyleSheets()
Implementation of StyleSheetDocument.getStyleSheets();


getStyleSheets

public java.util.Iterator<StyleSheetNode> getStyleSheets(StyleContext context)
Returns all StyleSheetNodes which can be applied to the specified context, sorted from lowest to highest precedence.


getIcons

public java.util.Iterator<IconNode> getIcons(StyleContext context)
Returns an Iterator of StyleNode objects for the specified context.


getStyles

public java.util.Iterator<StyleNode> getStyles(StyleContext context)
Returns an Iterator of StyleNode objects for the specified context.


getStyleBySelector

public StyleNode getStyleBySelector(StyleContext context,
                                    java.lang.String selector)
Returns the fully-resolved StyleNode for the style with the specified selector.


getStyleByName

public StyleNode getStyleByName(StyleContext context,
                                java.lang.String name)
Returns the fully-resolved StyleNode for the style with the specified name.



Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.