Package dev.amp.validator.css
Class Declaration
- java.lang.Object
-
- com.steadystate.css.parser.Token
-
- dev.amp.validator.css.Token
-
- dev.amp.validator.css.Rule
-
- dev.amp.validator.css.Declaration
-
- All Implemented Interfaces:
Serializable
public class Declaration extends Rule
Object model for a declaration used to define css.- Author:
- nhant01, GeorgeLuo
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Declaration(String name)Constructor of Declaration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(RuleVisitor visitor)Process a Declaration with a visitorStringfirstIdent()For a declaration, if the first non-whitespace token is an identifier, returns its string value.booleangetImportant()Getter for important valueStringgetName()Getter for contents of name of declarationTokenTypegetTokenType()Getter for token typeList<com.steadystate.css.parser.Token>getValue()Getter for contents of declarationvoidsetImportant(boolean important)
-
-
-
Constructor Detail
-
Declaration
public Declaration(@Nonnull String name)Constructor of Declaration- Parameters:
name- to set for this declaration
-
-
Method Detail
-
accept
public void accept(@Nonnull RuleVisitor visitor) throws CssValidationExceptionProcess a Declaration with a visitor- Specified by:
acceptin classRule- Parameters:
visitor- a rule visitor object used to access a declaration- Throws:
CssValidationException- Css Validation Exception
-
getTokenType
public TokenType getTokenType()
Getter for token type- Specified by:
getTokenTypein classToken- Returns:
- the type of the token (declaration)
-
firstIdent
public String firstIdent()
For a declaration, if the first non-whitespace token is an identifier, returns its string value. Otherwise, returns the empty string.- Returns:
- value of first non-whitespace identifier or empty string
-
getValue
public List<com.steadystate.css.parser.Token> getValue()
Getter for contents of declaration
-
getName
@Nonnull public String getName()
Getter for contents of name of declaration- Returns:
- the name of a declaration
-
getImportant
public boolean getImportant()
Getter for important value- Returns:
- the target value of important flag
-
setImportant
public void setImportant(boolean important)
- Parameters:
important- the target value of important Setter for importance of declaration
-
-