Package com.helger.css.decl.visit
Class CSSVisitorForUrl
java.lang.Object
com.helger.css.decl.visit.CSSVisitorForUrl
- All Implemented Interfaces:
ICSSVisitor
A special
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.- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin()Before visiting starts.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!voidend()After visiting is done.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!voidonBeginFontFaceRule(CSSFontFaceRule aFontFaceRule) Called when a font-face rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)voidonBeginKeyframesBlock(CSSKeyframesBlock aKeyframesBlock) Called when a keyframes block starts.voidonBeginKeyframesRule(CSSKeyframesRule aKeyframesRule) Called when a keyframes rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)voidonBeginMediaRule(CSSMediaRule aMediaRule) Called when a media rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)voidonBeginPageMarginBlock(CSSPageMarginBlock aPageMarginBlock) Called when a page margin block starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)voidonBeginPageRule(CSSPageRule aPageRule) Called when a page rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration), contained page margin blocks are handled withICSSVisitor.onBeginPageMarginBlock(CSSPageMarginBlock)andICSSVisitor.onEndPageMarginBlock(CSSPageMarginBlock).voidonBeginStyleRule(CSSStyleRule aStyleRule) Called when a style rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)voidonBeginSupportsRule(CSSSupportsRule aSupportsRule) Called when a supports rule starts.voidonBeginViewportRule(CSSViewportRule aViewportRule) Called when a viewport rule starts.voidonDeclaration(CSSDeclaration aDeclaration) Called for each declarationvoidonEndFontFaceRule(CSSFontFaceRule aFontFaceRule) Called when a font-face rule ends.voidonEndKeyframesBlock(CSSKeyframesBlock aKeyframesBlock) Called when a keyframes block ends.voidonEndKeyframesRule(CSSKeyframesRule aKeyframesRule) Called when a keyframes rule ends.voidonEndMediaRule(CSSMediaRule aMediaRule) Called when a media rule ends.voidonEndPageMarginBlock(CSSPageMarginBlock aPageMarginBlock) Called when a page margin block ends.voidonEndPageRule(CSSPageRule aPageRule) Called when a page rule ends.voidonEndStyleRule(CSSStyleRule aStyleRule) Called when a style rule ends.voidonEndSupportsRule(CSSSupportsRule aSupportsRule) Called when a supports rule ends.voidonEndViewportRule(CSSViewportRule aViewportRule) Called when a viewport rule ends.voidonImport(CSSImportRule aImportRule) Called on CSS import statementvoidonNamespace(CSSNamespaceRule aNamespaceRule) Called on CSS namespace statementvoidonStyleRuleSelector(CSSSelector aSelector) Called for each selector of a style rulevoidonUnknownRule(CSSUnknownRule aUnknownRule) Called when an unknown rule is encountered.
-
Constructor Details
-
CSSVisitorForUrl
Constructor- Parameters:
aVisitor- The URL visitor to be used. May not benull.
-
-
Method Details
-
getVisitor
- Returns:
- The URL visitor passed in the constructor. Never
null.
-
begin
public void begin()Description copied from interface:ICSSVisitorBefore visiting starts.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!- Specified by:
beginin interfaceICSSVisitor
-
onImport
Description copied from interface:ICSSVisitorCalled on CSS import statement- Specified by:
onImportin interfaceICSSVisitor- Parameters:
aImportRule- Other imported CSS. Nevernull.
-
onNamespace
Description copied from interface:ICSSVisitorCalled on CSS namespace statement- Specified by:
onNamespacein interfaceICSSVisitor- Parameters:
aNamespaceRule- The namespace rule. Nevernull.
-
onDeclaration
Description copied from interface:ICSSVisitorCalled for each declaration- Specified by:
onDeclarationin interfaceICSSVisitor- Parameters:
aDeclaration- The declaration. Nevernull.
-
onBeginStyleRule
Description copied from interface:ICSSVisitorCalled when a style rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)- Specified by:
onBeginStyleRulein interfaceICSSVisitor- Parameters:
aStyleRule- The style rule. Nevernull.
-
onStyleRuleSelector
Description copied from interface:ICSSVisitorCalled for each selector of a style rule- Specified by:
onStyleRuleSelectorin interfaceICSSVisitor- Parameters:
aSelector- The style rule selector. Nevernull.
-
onEndStyleRule
Description copied from interface:ICSSVisitorCalled when a style rule ends.- Specified by:
onEndStyleRulein interfaceICSSVisitor- Parameters:
aStyleRule- The style rule. Nevernull.
-
onBeginPageRule
Description copied from interface:ICSSVisitorCalled when a page rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration), contained page margin blocks are handled withICSSVisitor.onBeginPageMarginBlock(CSSPageMarginBlock)andICSSVisitor.onEndPageMarginBlock(CSSPageMarginBlock).- Specified by:
onBeginPageRulein interfaceICSSVisitor- Parameters:
aPageRule- The page rule. Nevernull.
-
onBeginPageMarginBlock
Description copied from interface:ICSSVisitorCalled when a page margin block starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)- Specified by:
onBeginPageMarginBlockin interfaceICSSVisitor- Parameters:
aPageMarginBlock- The page margin block. Nevernull.
-
onEndPageMarginBlock
Description copied from interface:ICSSVisitorCalled when a page margin block ends.- Specified by:
onEndPageMarginBlockin interfaceICSSVisitor- Parameters:
aPageMarginBlock- The page margin block. Nevernull.
-
onEndPageRule
Description copied from interface:ICSSVisitorCalled when a page rule ends.- Specified by:
onEndPageRulein interfaceICSSVisitor- Parameters:
aPageRule- The page rule. Nevernull.
-
onBeginFontFaceRule
Description copied from interface:ICSSVisitorCalled when a font-face rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)- Specified by:
onBeginFontFaceRulein interfaceICSSVisitor- Parameters:
aFontFaceRule- The font-face rule. Nevernull.
-
onEndFontFaceRule
Description copied from interface:ICSSVisitorCalled when a font-face rule ends.- Specified by:
onEndFontFaceRulein interfaceICSSVisitor- Parameters:
aFontFaceRule- The font-face rule. Nevernull.
-
onBeginMediaRule
Description copied from interface:ICSSVisitorCalled when a media rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)- Specified by:
onBeginMediaRulein interfaceICSSVisitor- Parameters:
aMediaRule- The media rule. Nevernull.
-
onEndMediaRule
Description copied from interface:ICSSVisitorCalled when a media rule ends.- Specified by:
onEndMediaRulein interfaceICSSVisitor- Parameters:
aMediaRule- The media rule. Nevernull.
-
onBeginKeyframesRule
Description copied from interface:ICSSVisitorCalled when a keyframes rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)- Specified by:
onBeginKeyframesRulein interfaceICSSVisitor- Parameters:
aKeyframesRule- The keyframes rule. Nevernull.
-
onBeginKeyframesBlock
Description copied from interface:ICSSVisitorCalled when a keyframes block starts.- Specified by:
onBeginKeyframesBlockin interfaceICSSVisitor- Parameters:
aKeyframesBlock- The keyframes rule block. Nevernull.
-
onEndKeyframesBlock
Description copied from interface:ICSSVisitorCalled when a keyframes block ends.- Specified by:
onEndKeyframesBlockin interfaceICSSVisitor- Parameters:
aKeyframesBlock- The keyframes rule block. Nevernull.
-
onEndKeyframesRule
Description copied from interface:ICSSVisitorCalled when a keyframes rule ends.- Specified by:
onEndKeyframesRulein interfaceICSSVisitor- Parameters:
aKeyframesRule- The keyframes rule. Nevernull.
-
onBeginViewportRule
Description copied from interface:ICSSVisitorCalled when a viewport rule starts.- Specified by:
onBeginViewportRulein interfaceICSSVisitor- Parameters:
aViewportRule- The viewport rule. Nevernull.
-
onEndViewportRule
Description copied from interface:ICSSVisitorCalled when a viewport rule ends.- Specified by:
onEndViewportRulein interfaceICSSVisitor- Parameters:
aViewportRule- The viewport rule. Nevernull.
-
onBeginSupportsRule
Description copied from interface:ICSSVisitorCalled when a supports rule starts.- Specified by:
onBeginSupportsRulein interfaceICSSVisitor- Parameters:
aSupportsRule- The supports rule. Nevernull.
-
onEndSupportsRule
Description copied from interface:ICSSVisitorCalled when a supports rule ends.- Specified by:
onEndSupportsRulein interfaceICSSVisitor- Parameters:
aSupportsRule- The supports rule. Nevernull.
-
onUnknownRule
Description copied from interface:ICSSVisitorCalled when an unknown rule is encountered.- Specified by:
onUnknownRulein interfaceICSSVisitor- Parameters:
aUnknownRule- The unknown rule. Nevernull.
-
end
public void end()Description copied from interface:ICSSVisitorAfter visiting is done.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!- Specified by:
endin interfaceICSSVisitor
-