Package com.helger.css.decl.visit
Class DefaultCSSVisitor
- java.lang.Object
-
- com.helger.css.decl.visit.DefaultCSSVisitor
-
- All Implemented Interfaces:
ICSSVisitor
@Immutable public class DefaultCSSVisitor extends Object implements ICSSVisitor
Default implementation of theICSSVisitor
interface. Use as base class for your own implementations since this class does nothing on its own.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description DefaultCSSVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin()
Before visiting starts.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!void
end()
After visiting is done.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!void
onBeginFontFaceRule(CSSFontFaceRule aFontFaceRule)
Called when a font-face rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
void
onBeginKeyframesBlock(CSSKeyframesBlock aKeyframesBlock)
Called when a keyframes block starts.void
onBeginKeyframesRule(CSSKeyframesRule aKeyframesRule)
Called when a keyframes rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
void
onBeginMediaRule(CSSMediaRule aMediaRule)
Called when a media rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
void
onBeginPageMarginBlock(CSSPageMarginBlock aPageMarginBlock)
Called when a page margin block starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
void
onBeginPageRule(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)
.void
onBeginStyleRule(CSSStyleRule aStyleRule)
Called when a style rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
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 declarationvoid
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 statementvoid
onNamespace(CSSNamespaceRule aNamespaceRule)
Called on CSS namespace statementvoid
onStyleRuleSelector(CSSSelector aSelector)
Called for each selector of a style rulevoid
onUnknownRule(CSSUnknownRule aUnknownRule)
Called when an unknown rule is encountered.
-
-
-
Method Detail
-
begin
@OverrideOnDemand public void begin()
Description copied from interface:ICSSVisitor
Before visiting starts.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!- Specified by:
begin
in interfaceICSSVisitor
-
onImport
@OverrideOnDemand public void onImport(@Nonnull CSSImportRule aImportRule)
Description copied from interface:ICSSVisitor
Called on CSS import statement- Specified by:
onImport
in interfaceICSSVisitor
- Parameters:
aImportRule
- Other imported CSS. Nevernull
.
-
onNamespace
@OverrideOnDemand public void onNamespace(@Nonnull CSSNamespaceRule aNamespaceRule)
Description copied from interface:ICSSVisitor
Called on CSS namespace statement- Specified by:
onNamespace
in interfaceICSSVisitor
- Parameters:
aNamespaceRule
- The namespace rule. Nevernull
.
-
onDeclaration
@OverrideOnDemand public void onDeclaration(@Nonnull CSSDeclaration aDeclaration)
Description copied from interface:ICSSVisitor
Called for each declaration- Specified by:
onDeclaration
in interfaceICSSVisitor
- Parameters:
aDeclaration
- The declaration. Nevernull
.
-
onBeginStyleRule
@OverrideOnDemand public void onBeginStyleRule(@Nonnull CSSStyleRule aStyleRule)
Description copied from interface:ICSSVisitor
Called when a style rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
- Specified by:
onBeginStyleRule
in interfaceICSSVisitor
- Parameters:
aStyleRule
- The style rule. Nevernull
.
-
onStyleRuleSelector
@OverrideOnDemand public void onStyleRuleSelector(@Nonnull CSSSelector aSelector)
Description copied from interface:ICSSVisitor
Called for each selector of a style rule- Specified by:
onStyleRuleSelector
in interfaceICSSVisitor
- Parameters:
aSelector
- The style rule selector. Nevernull
.
-
onEndStyleRule
@OverrideOnDemand public void onEndStyleRule(@Nonnull CSSStyleRule aStyleRule)
Description copied from interface:ICSSVisitor
Called when a style rule ends.- Specified by:
onEndStyleRule
in interfaceICSSVisitor
- Parameters:
aStyleRule
- The style rule. Nevernull
.
-
onBeginPageRule
@OverrideOnDemand public void onBeginPageRule(@Nonnull CSSPageRule aPageRule)
Description copied from interface:ICSSVisitor
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)
.- Specified by:
onBeginPageRule
in interfaceICSSVisitor
- Parameters:
aPageRule
- The page rule. Nevernull
.
-
onBeginPageMarginBlock
@OverrideOnDemand public void onBeginPageMarginBlock(@Nonnull CSSPageMarginBlock aPageMarginBlock)
Description copied from interface:ICSSVisitor
Called when a page margin block starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
- Specified by:
onBeginPageMarginBlock
in interfaceICSSVisitor
- Parameters:
aPageMarginBlock
- The page margin block. Nevernull
.
-
onEndPageMarginBlock
@OverrideOnDemand public void onEndPageMarginBlock(@Nonnull CSSPageMarginBlock aPageMarginBlock)
Description copied from interface:ICSSVisitor
Called when a page margin block ends.- Specified by:
onEndPageMarginBlock
in interfaceICSSVisitor
- Parameters:
aPageMarginBlock
- The page margin block. Nevernull
.
-
onEndPageRule
@OverrideOnDemand public void onEndPageRule(@Nonnull CSSPageRule aPageRule)
Description copied from interface:ICSSVisitor
Called when a page rule ends.- Specified by:
onEndPageRule
in interfaceICSSVisitor
- Parameters:
aPageRule
- The page rule. Nevernull
.
-
onBeginFontFaceRule
@OverrideOnDemand public void onBeginFontFaceRule(@Nonnull CSSFontFaceRule aFontFaceRule)
Description copied from interface:ICSSVisitor
Called when a font-face rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
- Specified by:
onBeginFontFaceRule
in interfaceICSSVisitor
- Parameters:
aFontFaceRule
- The font-face rule. Nevernull
.
-
onEndFontFaceRule
@OverrideOnDemand public void onEndFontFaceRule(@Nonnull CSSFontFaceRule aFontFaceRule)
Description copied from interface:ICSSVisitor
Called when a font-face rule ends.- Specified by:
onEndFontFaceRule
in interfaceICSSVisitor
- Parameters:
aFontFaceRule
- The font-face rule. Nevernull
.
-
onBeginMediaRule
@OverrideOnDemand public void onBeginMediaRule(@Nonnull CSSMediaRule aMediaRule)
Description copied from interface:ICSSVisitor
Called when a media rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
- Specified by:
onBeginMediaRule
in interfaceICSSVisitor
- Parameters:
aMediaRule
- The media rule. Nevernull
.
-
onEndMediaRule
@OverrideOnDemand public void onEndMediaRule(@Nonnull CSSMediaRule aMediaRule)
Description copied from interface:ICSSVisitor
Called when a media rule ends.- Specified by:
onEndMediaRule
in interfaceICSSVisitor
- Parameters:
aMediaRule
- The media rule. Nevernull
.
-
onBeginKeyframesRule
@OverrideOnDemand public void onBeginKeyframesRule(@Nonnull CSSKeyframesRule aKeyframesRule)
Description copied from interface:ICSSVisitor
Called when a keyframes rule starts.
Note: contained declarations are handled byICSSVisitor.onDeclaration(CSSDeclaration)
- Specified by:
onBeginKeyframesRule
in interfaceICSSVisitor
- Parameters:
aKeyframesRule
- The keyframes rule. Nevernull
.
-
onBeginKeyframesBlock
@OverrideOnDemand public void onBeginKeyframesBlock(@Nonnull CSSKeyframesBlock aKeyframesBlock)
Description copied from interface:ICSSVisitor
Called when a keyframes block starts.- Specified by:
onBeginKeyframesBlock
in interfaceICSSVisitor
- Parameters:
aKeyframesBlock
- The keyframes rule block. Nevernull
.
-
onEndKeyframesBlock
@OverrideOnDemand public void onEndKeyframesBlock(@Nonnull CSSKeyframesBlock aKeyframesBlock)
Description copied from interface:ICSSVisitor
Called when a keyframes block ends.- Specified by:
onEndKeyframesBlock
in interfaceICSSVisitor
- Parameters:
aKeyframesBlock
- The keyframes rule block. Nevernull
.
-
onEndKeyframesRule
@OverrideOnDemand public void onEndKeyframesRule(@Nonnull CSSKeyframesRule aKeyframesRule)
Description copied from interface:ICSSVisitor
Called when a keyframes rule ends.- Specified by:
onEndKeyframesRule
in interfaceICSSVisitor
- Parameters:
aKeyframesRule
- The keyframes rule. Nevernull
.
-
onBeginViewportRule
@OverrideOnDemand public void onBeginViewportRule(@Nonnull CSSViewportRule aViewportRule)
Description copied from interface:ICSSVisitor
Called when a viewport rule starts.- Specified by:
onBeginViewportRule
in interfaceICSSVisitor
- Parameters:
aViewportRule
- The viewport rule. Nevernull
.
-
onEndViewportRule
@OverrideOnDemand public void onEndViewportRule(@Nonnull CSSViewportRule aViewportRule)
Description copied from interface:ICSSVisitor
Called when a viewport rule ends.- Specified by:
onEndViewportRule
in interfaceICSSVisitor
- Parameters:
aViewportRule
- The viewport rule. Nevernull
.
-
onBeginSupportsRule
@OverrideOnDemand public void onBeginSupportsRule(@Nonnull CSSSupportsRule aSupportsRule)
Description copied from interface:ICSSVisitor
Called when a supports rule starts.- Specified by:
onBeginSupportsRule
in interfaceICSSVisitor
- Parameters:
aSupportsRule
- The supports rule. Nevernull
.
-
onEndSupportsRule
@OverrideOnDemand public void onEndSupportsRule(@Nonnull CSSSupportsRule aSupportsRule)
Description copied from interface:ICSSVisitor
Called when a supports rule ends.- Specified by:
onEndSupportsRule
in interfaceICSSVisitor
- Parameters:
aSupportsRule
- The supports rule. Nevernull
.
-
onUnknownRule
@OverrideOnDemand public void onUnknownRule(@Nonnull CSSUnknownRule aUnknownRule)
Description copied from interface:ICSSVisitor
Called when an unknown rule is encountered.- Specified by:
onUnknownRule
in interfaceICSSVisitor
- Parameters:
aUnknownRule
- The unknown rule. Nevernull
.
-
end
@OverrideOnDemand public void end()
Description copied from interface:ICSSVisitor
After visiting is done.
Note: This is only called for complete style sheets, and not when starting e.g. with a declaration list!- Specified by:
end
in interfaceICSSVisitor
-
-