@NotThreadSafe public class CSSVisitorForUrl extends Object implements ICSSVisitor
ICSSVisitor that is used to extract URLs from the available
rules and call the ICSSUrlVisitor visitor. This visitor effectively
only visits URLs that are in import rules and those in declaration
expressions.| Constructor and Description |
|---|
CSSVisitorForUrl(ICSSUrlVisitor aVisitor)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Before visiting starts.
|
void |
end()
After visiting is done.
|
ICSSUrlVisitor |
getVisitor() |
void |
onBeginFontFaceRule(CSSFontFaceRule aFontFaceRule)
Called when a font-face rule starts.
|
void |
onBeginKeyframesBlock(CSSKeyframesBlock aKeyframesBlock)
Called when a keyframes block starts.
|
void |
onBeginKeyframesRule(CSSKeyframesRule aKeyframesRule)
Called when a keyframes rule starts.
|
void |
onBeginMediaRule(CSSMediaRule aMediaRule)
Called when a media rule starts.
|
void |
onBeginPageMarginBlock(CSSPageMarginBlock aPageMarginBlock)
Called when a page margin block starts.
|
void |
onBeginPageRule(CSSPageRule aPageRule)
Called when a page rule starts.
|
void |
onBeginStyleRule(CSSStyleRule aStyleRule)
Called when a style rule starts.
|
void |
onBeginSupportsRule(CSSSupportsRule aSupportsRule)
Called when a supports rule starts.
|
void |
onBeginViewportRule(CSSViewportRule aViewportRule)
Called when a viewport rule starts.
|
void |
onDeclaration(CSSDeclaration aDeclaration)
Called for each declaration
|
void |
onEndFontFaceRule(CSSFontFaceRule aFontFaceRule)
Called when a font-face rule ends.
|
void |
onEndKeyframesBlock(CSSKeyframesBlock aKeyframesBlock)
Called when a keyframes block ends.
|
void |
onEndKeyframesRule(CSSKeyframesRule aKeyframesRule)
Called when a keyframes rule ends.
|
void |
onEndMediaRule(CSSMediaRule aMediaRule)
Called when a media rule ends.
|
void |
onEndPageMarginBlock(CSSPageMarginBlock aPageMarginBlock)
Called when a page margin block ends.
|
void |
onEndPageRule(CSSPageRule aPageRule)
Called when a page rule ends.
|
void |
onEndStyleRule(CSSStyleRule aStyleRule)
Called when a style rule ends.
|
void |
onEndSupportsRule(CSSSupportsRule aSupportsRule)
Called when a supports rule ends.
|
void |
onEndViewportRule(CSSViewportRule aViewportRule)
Called when a viewport rule ends.
|
void |
onImport(CSSImportRule aImportRule)
Called on CSS import statement
|
void |
onNamespace(CSSNamespaceRule aNamespaceRule)
Called on CSS namespace statement
|
void |
onStyleRuleSelector(CSSSelector aSelector)
Called for each selector of a style rule
|
void |
onUnknownRule(CSSUnknownRule aUnknownRule)
Called when an unknown rule is encountered.
|
public CSSVisitorForUrl(@Nonnull ICSSUrlVisitor aVisitor)
aVisitor - The URL visitor to be used. May not be null.@Nonnull public ICSSUrlVisitor getVisitor()
null.public void begin()
ICSSVisitorbegin in interface ICSSVisitorpublic void onImport(@Nonnull CSSImportRule aImportRule)
ICSSVisitoronImport in interface ICSSVisitoraImportRule - Other imported CSS. Never null.public void onNamespace(@Nonnull CSSNamespaceRule aNamespaceRule)
ICSSVisitoronNamespace in interface ICSSVisitoraNamespaceRule - The namespace rule. Never null.public void onDeclaration(@Nonnull CSSDeclaration aDeclaration)
ICSSVisitoronDeclaration in interface ICSSVisitoraDeclaration - The declaration. Never null.public void onBeginStyleRule(@Nonnull CSSStyleRule aStyleRule)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration)onBeginStyleRule in interface ICSSVisitoraStyleRule - The style rule. Never null.public void onStyleRuleSelector(@Nonnull CSSSelector aSelector)
ICSSVisitoronStyleRuleSelector in interface ICSSVisitoraSelector - The style rule selector. Never null.public void onEndStyleRule(@Nonnull CSSStyleRule aStyleRule)
ICSSVisitoronEndStyleRule in interface ICSSVisitoraStyleRule - The style rule. Never null.public void onBeginPageRule(@Nonnull CSSPageRule aPageRule)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration), contained page margin blocks are
handled with ICSSVisitor.onBeginPageMarginBlock(CSSPageMarginBlock) and
ICSSVisitor.onEndPageMarginBlock(CSSPageMarginBlock).onBeginPageRule in interface ICSSVisitoraPageRule - The page rule. Never null.public void onBeginPageMarginBlock(@Nonnull CSSPageMarginBlock aPageMarginBlock)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration)onBeginPageMarginBlock in interface ICSSVisitoraPageMarginBlock - The page margin block. Never null.public void onEndPageMarginBlock(@Nonnull CSSPageMarginBlock aPageMarginBlock)
ICSSVisitoronEndPageMarginBlock in interface ICSSVisitoraPageMarginBlock - The page margin block. Never null.public void onEndPageRule(@Nonnull CSSPageRule aPageRule)
ICSSVisitoronEndPageRule in interface ICSSVisitoraPageRule - The page rule. Never null.public void onBeginFontFaceRule(@Nonnull CSSFontFaceRule aFontFaceRule)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration)onBeginFontFaceRule in interface ICSSVisitoraFontFaceRule - The font-face rule. Never null.public void onEndFontFaceRule(@Nonnull CSSFontFaceRule aFontFaceRule)
ICSSVisitoronEndFontFaceRule in interface ICSSVisitoraFontFaceRule - The font-face rule. Never null.public void onBeginMediaRule(@Nonnull CSSMediaRule aMediaRule)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration)onBeginMediaRule in interface ICSSVisitoraMediaRule - The media rule. Never null.public void onEndMediaRule(@Nonnull CSSMediaRule aMediaRule)
ICSSVisitoronEndMediaRule in interface ICSSVisitoraMediaRule - The media rule. Never null.public void onBeginKeyframesRule(@Nonnull CSSKeyframesRule aKeyframesRule)
ICSSVisitorICSSVisitor.onDeclaration(CSSDeclaration)onBeginKeyframesRule in interface ICSSVisitoraKeyframesRule - The keyframes rule. Never null.public void onBeginKeyframesBlock(@Nonnull CSSKeyframesBlock aKeyframesBlock)
ICSSVisitoronBeginKeyframesBlock in interface ICSSVisitoraKeyframesBlock - The keyframes rule block. Never null.public void onEndKeyframesBlock(@Nonnull CSSKeyframesBlock aKeyframesBlock)
ICSSVisitoronEndKeyframesBlock in interface ICSSVisitoraKeyframesBlock - The keyframes rule block. Never null.public void onEndKeyframesRule(@Nonnull CSSKeyframesRule aKeyframesRule)
ICSSVisitoronEndKeyframesRule in interface ICSSVisitoraKeyframesRule - The keyframes rule. Never null.public void onBeginViewportRule(@Nonnull CSSViewportRule aViewportRule)
ICSSVisitoronBeginViewportRule in interface ICSSVisitoraViewportRule - The viewport rule. Never null.public void onEndViewportRule(@Nonnull CSSViewportRule aViewportRule)
ICSSVisitoronEndViewportRule in interface ICSSVisitoraViewportRule - The viewport rule. Never null.public void onBeginSupportsRule(@Nonnull CSSSupportsRule aSupportsRule)
ICSSVisitoronBeginSupportsRule in interface ICSSVisitoraSupportsRule - The supports rule. Never null.public void onEndSupportsRule(@Nonnull CSSSupportsRule aSupportsRule)
ICSSVisitoronEndSupportsRule in interface ICSSVisitoraSupportsRule - The supports rule. Never null.public void onUnknownRule(@Nonnull CSSUnknownRule aUnknownRule)
ICSSVisitoronUnknownRule in interface ICSSVisitoraUnknownRule - The unknown rule. Never null.public void end()
ICSSVisitorend in interface ICSSVisitorCopyright © 2014–2018 Philip Helger. All rights reserved.