org.apache.batik.css.value
Interface ValueFactory

All Known Implementing Classes:
AbstractValueFactory, VisibilityFactory, FontFamilyFactory

public interface ValueFactory

This interface represents objects that create the value associated with a managed CSS property.


Method Summary
 void createCSSValue(LexicalUnit lu, CSSOMStyleDeclaration d, java.lang.String imp)
          Creates a CSS value from a lexical unit and a style declaration, and put it in the style declaration.
 ImmutableValue createFloatValue(short unitType, float floatValue)
          Creates and returns a new float value.
 ImmutableValue createStringValue(short type, java.lang.String value)
          Creates and returns a new string value.
 ImmutableValue createValue(LexicalUnit lu)
          Creates a value from a lexical unit.
 ImmutableValue createValue(java.lang.String text)
          Creates a value from its text representation
 java.lang.String getPropertyName()
          Returns the name of the property handled.
 void setParser(Parser p)
          Sets the parser used by this factory.
 

Method Detail

setParser

public void setParser(Parser p)
Sets the parser used by this factory.

createValue

public ImmutableValue createValue(java.lang.String text)
                           throws DOMException
Creates a value from its text representation
Parameters:
text - The text that represents the CSS value to create.

createValue

public ImmutableValue createValue(LexicalUnit lu)
                           throws DOMException
Creates a value from a lexical unit.
Parameters:
lu - The SAC lexical unit used to create the value.

getPropertyName

public java.lang.String getPropertyName()
Returns the name of the property handled.

createCSSValue

public void createCSSValue(LexicalUnit lu,
                           CSSOMStyleDeclaration d,
                           java.lang.String imp)
                    throws DOMException
Creates a CSS value from a lexical unit and a style declaration, and put it in the style declaration.
Parameters:
lu - The SAC lexical unit used to create the value.
d - The style declaration in which to add the created value.
imp - The property priority.

createFloatValue

public ImmutableValue createFloatValue(short unitType,
                                       float floatValue)
                                throws DOMException
Creates and returns a new float value.
Parameters:
unitType - A unit code as defined above. The unit code can only be a float unit type
floatValue - The new float value.

createStringValue

public ImmutableValue createStringValue(short type,
                                        java.lang.String value)
                                 throws DOMException
Creates and returns a new string value.
Parameters:
type - A string code as defined in CSSPrimitiveValue. The string code can only be a string unit type.
value - The new string value.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.