EchoPoint
1.0

echopoint.stylesheet
Interface CssStyleSheetHandler

All Known Implementing Classes:
AbstractStyleSheetHandler

public interface CssStyleSheetHandler

This interface is used to create CssStyleSheetHandler that can be called upon by a CssStyleSheet when parsing style sheet data.

The CssStyleSheetHandler is responsible for indicating whether a given attribute name and value is known and valid to set in a Style for a Component class and also providing the fully qualified class name of a Component.

In general you will not need to provide a CssStyleSheetHandler implementation if your Component classes have support for the StyleInfo interface either via a xxxStyleInfo support class or a nested public static class that implements StyleInfo.

The unknown style attribute name and value parsing is done in the following order :

  1. The getStyleInfo() method is called to retreive StyleInfo about a Component class.
  2. Then the setKnownStyleAttribute() method is called when the style attribute name is known but the value type cannot be parsed.
  3. If no StyleInfo is available for the Component, then the setUnknownStyleAttribute() method is called for a given Component class.
  4. If this fails, then the parseUnknownStyleValue() method will be called to parse a Object value given a Component class and a style attribute name and value context.
  5. Failing all of this the parseUnknownStyleValue() method will be called to parse a Object value given a value string context.


Method Summary
 java.lang.String getFullQualifiedClassName(java.lang.String partialClassName)
          This method is called to ask the StyleSheetHandler to make a name into a fully qualified Java class name.
 java.lang.Class[] getHandledClasses()
          Called to return an array of the classes that a CssStyleSheetHandler manages.
 StyleInfo getStyleInfo(java.lang.Class componentClazz)
          This method can be called to retrieve a StyleInfo object for the specified component class.
 java.lang.Object parseUnknownStyleValue(java.lang.Class componentClazz, java.lang.String attrName, java.lang.String attrValue)
          This method is called to set a parse a style attribute value into its object form.
 java.lang.Object parseUnknownStyleValue(java.lang.String attrValue)
          This method is called to set a parse a style attribute value into its object form.
 boolean setKnownStyleAttribute(java.lang.Class componentClazz, java.lang.Class attrValueClass, nextapp.echo.Style style, java.lang.String attrName, java.lang.String attrValue)
          This method is called to set a specific attribute and value into a style, when the Class of the attribute value is known.
 boolean setUnknownStyleAttribute(java.lang.Class componentClazz, nextapp.echo.Style style, java.lang.String attrName, java.lang.String attrValue)
          This method is called to set a specific attribute and value into a style, when the Class of the attribute value is NOT known.
 

Method Detail

getFullQualifiedClassName

public java.lang.String getFullQualifiedClassName(java.lang.String partialClassName)
This method is called to ask the StyleSheetHandler to make a name into a fully qualified Java class name. For example "Component" might become "nextapp.echo.Component".

If the StyleSheetHandler does in fact handle a class called partialClassName then it should make it into a fully qualified class name.

If the StyleSheetHandler doesnt have a class called partialClassName, then it must return null.


getHandledClasses

public java.lang.Class[] getHandledClasses()
Called to return an array of the classes that a CssStyleSheetHandler manages.

Returns:
a Class array

getStyleInfo

public StyleInfo getStyleInfo(java.lang.Class componentClazz)
This method can be called to retrieve a StyleInfo object for the specified component class. If the handler does not know about the componentClass it should return null

Parameters:
componentClazz - - the component class
Returns:
- the StyleInfo for that component class or null

setKnownStyleAttribute

public boolean setKnownStyleAttribute(java.lang.Class componentClazz,
                                      java.lang.Class attrValueClass,
                                      nextapp.echo.Style style,
                                      java.lang.String attrName,
                                      java.lang.String attrValue)
This method is called to set a specific attribute and value into a style, when the Class of the attribute value is known.

The CssStyleSheetHandler must perform the Style.setAttribute and return a true indicating this was successful.


setUnknownStyleAttribute

public boolean setUnknownStyleAttribute(java.lang.Class componentClazz,
                                        nextapp.echo.Style style,
                                        java.lang.String attrName,
                                        java.lang.String attrValue)
This method is called to set a specific attribute and value into a style, when the Class of the attribute value is NOT known.

The CssStyleSheetHandler must perform the Style.setAttribute and return a true indicating this was successful.


parseUnknownStyleValue

public java.lang.Object parseUnknownStyleValue(java.lang.Class componentClazz,
                                               java.lang.String attrName,
                                               java.lang.String attrValue)
This method is called to set a parse a style attribute value into its object form. This is called after the setUnknownStyleAttribute method is called and the style attribute value still cannot be determined.

The CssStyleSheetHandler must perform parse the attrValue string into an object or return null indicating that the value string form is not known, given the current context of componentClazz and attrName.


parseUnknownStyleValue

public java.lang.Object parseUnknownStyleValue(java.lang.String attrValue)
This method is called to set a parse a style attribute value into its object form. This is called after the parseUnknownStyleValue method is called and the style attribute value still cannot be determined.

The CssStyleSheetHandler must perform parse the attrValue string into an object or return null indicating that the value string form is not known.


EchoPoint
1.0