All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.properties.CssProperty
java.lang.Object
|
+----org.w3c.css.properties.CssProperty
- public abstract class CssProperty
- extends Object
- implements Cloneable, StyleSheetOrigin
-
property
-
a stylistic parameter that can be influenced through CSS. This specification
defines a list of properties and their corresponding values.
If you want to add some properties to the parser, you should subclass this
class.
-
context
- the context.
-
important
- True if this property is important.
-
inherit
- This keyword is used a lot of time in CSS2
-
line
- the position of the first character of this value.
-
order
- A uniq number for this property.
-
origin
- The origin of this property.
-
sourceFile
- the origin file.
-
CssProperty()
- Create a new CssProperty.
-
addToStyle(CssStyle)
- Add this property to the CssStyle.
-
duplicate()
- Duplicate this property.
-
equals(CssProperty)
- Compares two properties for equality.
-
get()
- Returns the value of this property.
-
getExplicitWeight()
- Calculate the explicit weight and the origin.
-
getImportant()
- Returns true if this property is important.
-
getLine()
- Returns the line number in the source file.
-
getOrderSpecified()
- Calculate the order specified.
-
getOrigin()
- Returns the attribute origin
-
getPropertyInStyle(CssStyle, boolean)
- Get this property in the style.
-
getPropertyName()
- Returns the name of this property IN LOWER CASE.
-
getSelectors()
- Returns the context.
-
getSourceFile()
- Returns the source file.
-
hashCode()
- Calculate an hashCode for this property.
-
Inherited()
- Returns true if the property is inherited.
-
isByUser()
- Returns the attribute byUser
-
isDefault()
- Is the value of this property is a default value.
-
isSoftlyInherited()
- Returns true if this property is "softly" inherited
e.g.
-
print(CssPrinterStyle)
- Print this property.
-
setByUser()
- Mark this property comes from the user
-
setImportant()
- Set this property to be important.
-
setInfo(int, String)
- Update the source file and the line.
-
setOrigin(int)
- Fix the origin of this property
Overrides this method for a macro
-
setSelectors(CssSelectors)
- Set the context.
-
toString()
- Returns a string representation of values.
important
protected boolean important
- True if this property is important. false otherwise.
origin
protected int origin
- The origin of this property.
the author's style sheets override the reader's style sheet which
override the UA's default values. An imported style sheet has the same
origin as the style sheet from which it is imported.
- See Also:
- BROWSER, READER, AUTHOR
order
protected long order
- A uniq number for this property.
Used by the cascading order algorithm to sort by order specified.
If two rules have the same weight, the latter specified wins.
line
protected int line
- the position of the first character of this value.
sourceFile
protected String sourceFile
- the origin file.
context
protected CssSelectors context
- the context.
inherit
public static final CssIdent inherit
- This keyword is used a lot of time in CSS2
CssProperty
public CssProperty()
- Create a new CssProperty.
Inherited
public boolean Inherited()
- Returns true if the property is inherited.
isSoftlyInherited
public boolean isSoftlyInherited()
- Returns true if this property is "softly" inherited
e.g. his value is equals to inherit
get
public abstract Object get()
- Returns the value of this property.
It is not very usable, implements your own function.
getPropertyName
public abstract String getPropertyName()
- Returns the name of this property IN LOWER CASE.
equals
public abstract boolean equals(CssProperty property)
- Compares two properties for equality.
- Parameters:
- value - The other property.
print
public void print(CssPrinterStyle printer)
- Print this property.
- Parameters:
- printer - The printer.
- See Also:
- toString, getPropertyName
toString
public abstract String toString()
- Returns a string representation of values.
So if you want have something like this :
property-name : property-value1 properpty-value2 ...
You should write something like this :
property.getPropertyName() + " : " + property.toString()
- Overrides:
- toString in class Object
setImportant
public void setImportant()
- Set this property to be important.
Overrides this method for a macro
getImportant
public boolean getImportant()
- Returns true if this property is important.
Overrides this method for a macro
hashCode
public final int hashCode()
- Calculate an hashCode for this property.
- Overrides:
- hashCode in class Object
setInfo
public void setInfo(int line,
String source)
- Update the source file and the line.
Overrides this method for a macro
- Parameters:
- line - The line number where this property is defined
- source - The source file where this property is defined
setOrigin
public void setOrigin(int origin)
- Fix the origin of this property
Overrides this method for a macro
- See Also:
- BROWSER, READER, AUTHOR
getOrigin
public int getOrigin()
- Returns the attribute origin
- Returns:
- the value of the attribute
isDefault
public boolean isDefault()
- Is the value of this property is a default value.
It is used by all macro for the function
print
- See Also:
- print
setSelectors
public void setSelectors(CssSelectors context)
- Set the context.
Overrides this method for a macro
- See Also:
- order, handleRule
getSelectors
public CssSelectors getSelectors()
- Returns the context.
- See Also:
- CssCascadingOrder
duplicate
public CssProperty duplicate()
- Duplicate this property.
- See Also:
- order
addToStyle
public abstract void addToStyle(CssStyle style)
- Add this property to the CssStyle.
- Parameters:
- style - The CssStyle
getPropertyInStyle
public abstract CssProperty getPropertyInStyle(CssStyle style,
boolean resolve)
- Get this property in the style.
- Parameters:
- style - The style where the property is
- resolve - if true, resolve the style to find this property
getSourceFile
public final String getSourceFile()
- Returns the source file.
getLine
public final int getLine()
- Returns the line number in the source file.
getExplicitWeight
public final int getExplicitWeight()
- Calculate the explicit weight and the origin.
Declarations marked '!important' carry more weight than unmarked
(normal) declarations.
- See Also:
- CssCascadingOrder
getOrderSpecified
public final long getOrderSpecified()
- Calculate the order specified.
- See Also:
- CssCascadingOrder, order
setByUser
public void setByUser()
- Mark this property comes from the user
- Parameters:
- byUser - the new value for the attribute
isByUser
public boolean isByUser()
- Returns the attribute byUser
- Returns:
- the value of the attribute
All Packages Class Hierarchy This Package Previous Next Index