org.apache.myfaces.trinidadinternal.image.xml.parse
Class BaseImageProviderRequestParser

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.xml.BaseNodeParser
      extended by org.apache.myfaces.trinidadinternal.image.xml.parse.BaseImageProviderRequestParser
All Implemented Interfaces:
NodeParser
Direct Known Subclasses:
ColorizedIconParser, CompositeButtonParser, DefaultsParser, FlippedIconParser

public class BaseImageProviderRequestParser
extends BaseNodeParser

Base class for NodeParsers which parse ImageProviderRequests.

This class parses the following attributes:

It also parses the following elements

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/image/xml/parse/BaseImageProviderRequestParser.java#0 $) $Date: 15-nov-2005.18:02:54 $
Author:
The Oracle ADF Faces Team

Constructor Summary
protected BaseImageProviderRequestParser(int capacity)
          Creates a NodeParser with enough storage to hold the number of ImageProviderRequest properties specified by capacity.
 
Method Summary
 void addCompletedChild(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, java.lang.Object child)
          Implementation of NodeParser.addCompletedChild().
 java.lang.Object endElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName)
          Implementation of NodeParser.endElement()
protected  java.lang.Object getColorKey(java.lang.String namespaceURI, java.lang.String localName)
          Returns the key to use for storing the color associated with the specified element in the ImageProviderRequest.
protected  java.lang.Integer getDirection(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the Integer value of the "direction" attribute.
protected  java.lang.String getEncodingType(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the image encoding type.
protected  java.lang.Object getFontKey(java.lang.String namespaceURI, java.lang.String localName)
          Returns the key to use for storing the font associated with the specified element in the ImageProviderRequest.
protected  java.lang.Integer getHeight(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the Integer value of the "height" attribute.
protected  java.lang.Integer getWidth(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the Integer value of the "width" attribute.
protected  boolean isColorElement(java.lang.String namespaceURI, java.lang.String localName)
          Tests whether the specified element is a color.
protected  java.lang.Boolean isDisabled(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the Boolean value of the "disabled" attribute.
protected  boolean isFontElement(java.lang.String namespaceURI, java.lang.String localName)
          Tests whether the specified element is a font.
protected  java.lang.Boolean isTextAntaliased(ParseContext context, org.xml.sax.Attributes attrs)
          Gets the boolean value of the "textAntialias" attribute.
protected  void setProperty(java.lang.Object key, java.lang.Object value)
          Sets a property to be included in the ImageProviderRequest
 NodeParser startChildElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attrs)
          Implementation of NodeParser.startChildElement()
 void startElement(ParseContext context, java.lang.String namespaceURI, java.lang.String localName, org.xml.sax.Attributes attrs)
          Implementation of NodeParser.startElement
 
Methods inherited from class org.apache.myfaces.trinidadinternal.share.xml.BaseNodeParser
addText, addWhitespace, endChildElement, getIgnoreParser, getRequiredAttribute, logError, logUnexpectedAttribute, logUnexpectedElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseImageProviderRequestParser

protected BaseImageProviderRequestParser(int capacity)
Creates a NodeParser with enough storage to hold the number of ImageProviderRequest properties specified by capacity.

Method Detail

startElement

public void startElement(ParseContext context,
                         java.lang.String namespaceURI,
                         java.lang.String localName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXParseException
Implementation of NodeParser.startElement

Specified by:
startElement in interface NodeParser
Overrides:
startElement in class BaseNodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the element
localName - the local name of the element
attrs - the attributes attached to the element
Throws:
org.xml.sax.SAXParseException

endElement

public java.lang.Object endElement(ParseContext context,
                                   java.lang.String namespaceURI,
                                   java.lang.String localName)
Implementation of NodeParser.endElement()

Specified by:
endElement in interface NodeParser
Overrides:
endElement in class BaseNodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the element
localName - the local name of the element
Returns:
the fully-initialized Java object corresponding to this release

startChildElement

public NodeParser startChildElement(ParseContext context,
                                    java.lang.String namespaceURI,
                                    java.lang.String localName,
                                    org.xml.sax.Attributes attrs)
Implementation of NodeParser.startChildElement()

Specified by:
startChildElement in interface NodeParser
Overrides:
startChildElement in class BaseNodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the child element
localName - the local name of the child element
attrs - the attributes attached to the element
Returns:
the node parser that should be used for this child element, or null if processing should continue with this NodeParser
See Also:
NodeParser.endChildElement(org.apache.myfaces.trinidadinternal.share.xml.ParseContext, java.lang.String, java.lang.String), NodeParser.addCompletedChild(org.apache.myfaces.trinidadinternal.share.xml.ParseContext, java.lang.String, java.lang.String, java.lang.Object)

addCompletedChild

public void addCompletedChild(ParseContext context,
                              java.lang.String namespaceURI,
                              java.lang.String localName,
                              java.lang.Object child)
Implementation of NodeParser.addCompletedChild().

Specified by:
addCompletedChild in interface NodeParser
Overrides:
addCompletedChild in class BaseNodeParser
Parameters:
context - the parsing context
namespaceURI - the namespace of the child element
localName - the local name of the child element
child - the Java object produced for that child by its NodeParser's endElement() method.
See Also:
NodeParser.endElement(org.apache.myfaces.trinidadinternal.share.xml.ParseContext, java.lang.String, java.lang.String)

setProperty

protected void setProperty(java.lang.Object key,
                           java.lang.Object value)
Sets a property to be included in the ImageProviderRequest


isColorElement

protected boolean isColorElement(java.lang.String namespaceURI,
                                 java.lang.String localName)
Tests whether the specified element is a color. Subclasses should override this method to indicate that a specified element should be parsed to a Color. getColorKey() should also be overridden to return the ImageProviderRequest property key to use for any color element.


isFontElement

protected boolean isFontElement(java.lang.String namespaceURI,
                                java.lang.String localName)
Tests whether the specified element is a font. Subclasses should override this method to indicate that a specified element should be parsed to a FontProxy. getFontKey() should also be overridden to return the ImageProviderRequest property key to use for any font element.


getColorKey

protected java.lang.Object getColorKey(java.lang.String namespaceURI,
                                       java.lang.String localName)
Returns the key to use for storing the color associated with the specified element in the ImageProviderRequest.


getFontKey

protected java.lang.Object getFontKey(java.lang.String namespaceURI,
                                      java.lang.String localName)
Returns the key to use for storing the font associated with the specified element in the ImageProviderRequest.


isTextAntaliased

protected java.lang.Boolean isTextAntaliased(ParseContext context,
                                             org.xml.sax.Attributes attrs)
Gets the boolean value of the "textAntialias" attribute.

Returns null if the textAntialias attribute is not specified. Otherwise, returns a Boolean indicating the value of the textAntialias attribute.


isDisabled

protected java.lang.Boolean isDisabled(ParseContext context,
                                       org.xml.sax.Attributes attrs)
Gets the Boolean value of the "disabled" attribute.

Returns null if the disabled attribute is not specified. Otherwise, returns a Boolean indicating the value of the disabled attribute.


getWidth

protected java.lang.Integer getWidth(ParseContext context,
                                     org.xml.sax.Attributes attrs)
Gets the Integer value of the "width" attribute.

Returns null if the width attribute is not specified. Otherwise, returns an Integer indicating the value of the width attribute.


getHeight

protected java.lang.Integer getHeight(ParseContext context,
                                      org.xml.sax.Attributes attrs)
Gets the Integer value of the "height" attribute.

Returns null if the height attribute is not specified. Otherwise, returns an Integer indicating the value of the height attribute.


getDirection

protected java.lang.Integer getDirection(ParseContext context,
                                         org.xml.sax.Attributes attrs)
Gets the Integer value of the "direction" attribute.

Returns LocaleUtils.DIRECTION_RIGHTTOLEFT for "rtl" directions, LocaleUtils.DIRECTION_LEFTTORIGHT for "ltr" directions, or LocaleUtils.DIRECTION_DEFAULT if the direction is not specified.


getEncodingType

protected java.lang.String getEncodingType(ParseContext context,
                                           org.xml.sax.Attributes attrs)
Gets the image encoding type.

Returns one of the ImageEncoderManager.*_TYPE constants.



Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.