info.informatica.doc.style.css
Class CSSStyleSheetFactory

java.lang.Object
  extended by info.informatica.doc.style.css.CSSStyleSheetFactory
Direct Known Subclasses:
DOMCSSStyleSheetFactory, XHTMLDocumentFactory.DOM4JCSSStyleSheetFactory

public abstract class CSSStyleSheetFactory
extends Object

CSS2 style sheet factory.

Author:
Carlos Amengual (amengual at informatica.info)

Field Summary
static String XHTML_NAMESPACE_URI
           
 
Constructor Summary
CSSStyleSheetFactory()
           
 
Method Summary
 org.w3c.dom.css.CSSStyleSheet createStyleSheet()
          Creates a CSS style sheet in XHTML namespace for all media.
abstract  org.w3c.dom.css.CSSStyleSheet createStyleSheet(String namespaceUri, org.w3c.dom.stylesheets.MediaList mediaList)
          Creates a CSS style sheet.
 org.w3c.dom.css.CSSStyleSheet createStyleSheet(String namespaceUri, String media)
          Creates a CSS style sheet for a target media.
protected  InputStream loadCSSfromClasspath(String cssFilename)
           
 org.w3c.dom.css.CSSStyleSheet loadXHTMLDefaultSheet()
          Loads a default CSS style sheet for (X)HTML documents.
static void parse(org.w3c.dom.css.CSSStyleSheet sheet, org.w3c.css.sac.InputSource source)
          Parses a style sheet from a source.
 void setClassLoader(ClassLoader loader)
          Sets the class loader to be used when loading internal style sheets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XHTML_NAMESPACE_URI

public static final String XHTML_NAMESPACE_URI
See Also:
Constant Field Values
Constructor Detail

CSSStyleSheetFactory

public CSSStyleSheetFactory()
Method Detail

createStyleSheet

public org.w3c.dom.css.CSSStyleSheet createStyleSheet()
Creates a CSS style sheet in XHTML namespace for all media.

Returns:
the style sheet.

createStyleSheet

public org.w3c.dom.css.CSSStyleSheet createStyleSheet(String namespaceUri,
                                                      String media)
Creates a CSS style sheet for a target media.

Parameters:
namespaceUri - the Namespace URI for the style sheet.
media - the target media for style information.
Returns:
the style sheet.

createStyleSheet

public abstract org.w3c.dom.css.CSSStyleSheet createStyleSheet(String namespaceUri,
                                                               org.w3c.dom.stylesheets.MediaList mediaList)
Creates a CSS style sheet.

Parameters:
namespaceUri - the Namespace URI for the style sheet.
mediaList - the target media list for the style information.
Returns:
the style sheet.

parse

public static void parse(org.w3c.dom.css.CSSStyleSheet sheet,
                         org.w3c.css.sac.InputSource source)
                  throws DOMException,
                         IOException
Parses a style sheet from a source.

If the given style sheet Object is not empty, the rules from the parsed source will be added at the end of the rule list.

Parameters:
sheet - the style sheet to be filled from the source.
source - the SAC input source.
Throws:
DOMException - if a DOM problem is found parsing the sheet.
org.w3c.css.sac.CSSException - if a non-DOM problem is found parsing the sheet.
IOException - if a problem is found reading the sheet.

setClassLoader

public void setClassLoader(ClassLoader loader)
Sets the class loader to be used when loading internal style sheets.

Parameters:
loader - the class loader.

loadXHTMLDefaultSheet

public org.w3c.dom.css.CSSStyleSheet loadXHTMLDefaultSheet()
                                                    throws IOException
Loads a default CSS style sheet for (X)HTML documents.

Returns:
the default style sheet for XHTML.
Throws:
IOException - if a problem arose when reading the default sheet.

loadCSSfromClasspath

protected InputStream loadCSSfromClasspath(String cssFilename)


Copyright © 2011 informatica.info. All Rights Reserved.