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.


Variable Index

 o context
the context.
 o important
True if this property is important.
 o inherit
This keyword is used a lot of time in CSS2
 o line
the position of the first character of this value.
 o order
A uniq number for this property.
 o origin
The origin of this property.
 o sourceFile
the origin file.

Constructor Index

 o CssProperty()
Create a new CssProperty.

Method Index

 o addToStyle(CssStyle)
Add this property to the CssStyle.
 o duplicate()
Duplicate this property.
 o equals(CssProperty)
Compares two properties for equality.
 o get()
Returns the value of this property.
 o getExplicitWeight()
Calculate the explicit weight and the origin.
 o getImportant()
Returns true if this property is important.
 o getLine()
Returns the line number in the source file.
 o getOrderSpecified()
Calculate the order specified.
 o getOrigin()
Returns the attribute origin
 o getPropertyInStyle(CssStyle, boolean)
Get this property in the style.
 o getPropertyName()
Returns the name of this property IN LOWER CASE.
 o getSelectors()
Returns the context.
 o getSourceFile()
Returns the source file.
 o hashCode()
Calculate an hashCode for this property.
 o Inherited()
Returns true if the property is inherited.
 o isByUser()
Returns the attribute byUser
 o isDefault()
Is the value of this property is a default value.
 o isSoftlyInherited()
Returns true if this property is "softly" inherited e.g.
 o print(CssPrinterStyle)
Print this property.
 o setByUser()
Mark this property comes from the user
 o setImportant()
Set this property to be important.
 o setInfo(int, String)
Update the source file and the line.
 o setOrigin(int)
Fix the origin of this property Overrides this method for a macro
 o setSelectors(CssSelectors)
Set the context.
 o toString()
Returns a string representation of values.

Variables

 o important
 protected boolean important
True if this property is important. false otherwise.

 o 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
 o 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.

 o line
 protected int line
the position of the first character of this value.

 o sourceFile
 protected String sourceFile
the origin file.

 o context
 protected CssSelectors context
the context.

 o inherit
 public static final CssIdent inherit
This keyword is used a lot of time in CSS2

Constructors

 o CssProperty
 public CssProperty()
Create a new CssProperty.

Methods

 o Inherited
 public boolean Inherited()
Returns true if the property is inherited.

 o isSoftlyInherited
 public boolean isSoftlyInherited()
Returns true if this property is "softly" inherited e.g. his value is equals to inherit

 o get
 public abstract Object get()
Returns the value of this property. It is not very usable, implements your own function.

 o getPropertyName
 public abstract String getPropertyName()
Returns the name of this property IN LOWER CASE.

 o equals
 public abstract boolean equals(CssProperty property)
Compares two properties for equality.

Parameters:
value - The other property.
 o print
 public void print(CssPrinterStyle printer)
Print this property.

Parameters:
printer - The printer.
See Also:
toString, getPropertyName
 o 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
 o setImportant
 public void setImportant()
Set this property to be important. Overrides this method for a macro

 o getImportant
 public boolean getImportant()
Returns true if this property is important. Overrides this method for a macro

 o hashCode
 public final int hashCode()
Calculate an hashCode for this property.

Overrides:
hashCode in class Object
 o 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
 o setOrigin
 public void setOrigin(int origin)
Fix the origin of this property Overrides this method for a macro

See Also:
BROWSER, READER, AUTHOR
 o getOrigin
 public int getOrigin()
Returns the attribute origin

Returns:
the value of the attribute
 o 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
 o setSelectors
 public void setSelectors(CssSelectors context)
Set the context. Overrides this method for a macro

See Also:
order, handleRule
 o getSelectors
 public CssSelectors getSelectors()
Returns the context.

See Also:
CssCascadingOrder
 o duplicate
 public CssProperty duplicate()
Duplicate this property.

See Also:
order
 o addToStyle
 public abstract void addToStyle(CssStyle style)
Add this property to the CssStyle.

Parameters:
style - The CssStyle
 o 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
 o getSourceFile
 public final String getSourceFile()
Returns the source file.

 o getLine
 public final int getLine()
Returns the line number in the source file.

 o 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
 o getOrderSpecified
 public final long getOrderSpecified()
Calculate the order specified.

See Also:
CssCascadingOrder, order
 o setByUser
 public void setByUser()
Mark this property comes from the user

Parameters:
byUser - the new value for the attribute
 o isByUser
 public boolean isByUser()
Returns the attribute byUser

Returns:
the value of the attribute

All Packages  Class Hierarchy  This Package  Previous  Next  Index