Class StyleSheetParserUtil
java.lang.Object
org.pentaho.reporting.libraries.css.parser.StyleSheetParserUtil
A helper class that simplifies the parsing of stylesheets.
- Author:
- Thomas Morgner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic StyleSheetParserUtil
static String[]
parseNamespaceIdent
(String attrName) Parses a single namespace identifier.parseStyleRule
(Map namespaces, String styleText, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, CSSDeclarationRule baseRule, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style rule.parseStyles
(Map namespaces, String name, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, CSSDeclarationRule baseRule, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style value.parseStyles
(Map namespaces, String name, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style value.parseStyleValue
(Map namespaces, StyleKey key, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a single style value for the given key.
-
Constructor Details
-
StyleSheetParserUtil
public StyleSheetParserUtil()
-
-
Method Details
-
getInstance
-
parseStyleValue
public CSSValue parseStyleValue(Map namespaces, StyleKey key, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a single style value for the given key. Returnsnull
, if the key denotes a compound definition, which has no internal representation.- Parameters:
namespaces
- an optional map of known namespaces (prefix -> uri)key
- the stylekey to which the value should be assigned.value
- the value textbaseURL
- an optional base url- Returns:
- the parsed value or null, if the value was not valid.
-
parseStyleRule
public CSSDeclarationRule parseStyleRule(Map namespaces, String styleText, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, CSSDeclarationRule baseRule, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style rule.- Parameters:
namespaces
- an optional map of known namespaces (prefix -> uri)styleText
- the css text that should be parsedbaseURL
- an optional base urlbaseRule
- an optional base-rule to which the result gets added.- Returns:
- the CSS-Style-Rule that contains all values for the given text.
-
parseStyles
public CSSStyleRule parseStyles(Map namespaces, String name, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style value. If the style value is a compound key, the corresonding style entries will be added to the style rule.- Parameters:
namespaces
- an optional map of known namespaces (prefix -> uri)name
- the stylekey-name to which the value should be assigned.value
- the value textbaseURL
- an optional base url- Returns:
- the CSS-Style-Rule that contains all values for the given text.
-
parseStyles
public CSSStyleRule parseStyles(Map namespaces, String name, String value, org.pentaho.reporting.libraries.resourceloader.ResourceKey baseURL, CSSDeclarationRule baseRule, org.pentaho.reporting.libraries.resourceloader.ResourceManager resourceManager, StyleKeyRegistry styleKeyRegistry) Parses a style value. If the style value is a compound key, the corresonding style entries will be added to the style rule.- Parameters:
namespaces
- an optional map of known namespaces (prefix -> uri)name
- the stylekey-name to which the value should be assigned.value
- the value textbaseURL
- an optional base urlbaseRule
- an optional base-rule to which the result gets added.- Returns:
- the CSS-Style-Rule that contains all values for the given text.
-
parseNamespaceIdent
Parses a single namespace identifier. This simply splits the given attribute name when a namespace separator is encountered ('|').- Parameters:
attrName
- the attribute name- Returns:
- the parsed attribute.
-