com.phloc.css.decl.visit.ICSSUrlVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of phloc-css-jdk5 Show documentation
Show all versions of phloc-css-jdk5 Show documentation
phloc CSS parser an other components
/**
* Copyright (C) 2006-2014 phloc systems
* http://www.phloc.com
* office[at]phloc[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.phloc.css.decl.visit;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.phloc.css.decl.CSSDeclaration;
import com.phloc.css.decl.CSSExpressionMemberTermURI;
import com.phloc.css.decl.CSSImportRule;
import com.phloc.css.decl.ICSSTopLevelRule;
/**
* Interface for visiting all URLs in a CSS document.
*
* @author Philip Helger
* @see DefaultCSSUrlVisitor DefaultCSSUrlVisitor for a default empty
* implementation
* @see AbstractModifyingCSSUrlVisitor AbstractModifyingCSSUrlVisitor for an
* abstract URL visitor that modifies URLs according to a rule
*/
public interface ICSSUrlVisitor
{
/**
* Before visiting starts.
*/
void begin ();
/**
* Called on CSS import statement. Use aImportRule.getLocation()
* to retrieve the imported URL.
*
* @param aImportRule
* Other imported CSS. Never null
.
*/
void onImport (@Nonnull CSSImportRule aImportRule);
/**
* Called on a CSS declaration value that contains an URL.
* Note: for keyframes it is currently not possible to retrieve the keyframes
* block to which the declaration belongs.
*
* @param aTopLevelRule
* Top level rule of the URL. May be null
when a
* declaration list is handled.
* @param aDeclaration
* Declaration of the URL. Never null
.
* @param aURITerm
* The URI term from the current expression. Never null
.
*/
void onUrlDeclaration (@Nullable ICSSTopLevelRule aTopLevelRule,
@Nonnull CSSDeclaration aDeclaration,
@Nonnull CSSExpressionMemberTermURI aURITerm);
/**
* After visiting is done.
*/
void end ();
}