org.apache.myfaces.trinidadinternal.image.xml
Class ImageProviderRequestUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.image.xml.ImageProviderRequestUtils

public class ImageProviderRequestUtils
extends java.lang.Object

Utility methods for parsing and encoding ImageProviderRequest XML elements.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/image/xml/ImageProviderRequestUtils.java#0 $) $Date: 10-nov-2005.19:03:59 $
Author:
The Oracle ADF Faces Team

Method Summary
static ParserManager createDefaultManager()
          Creates a ParserManager with the default ParserFactory for the TECATE_NAMESPACE.
static ImageProviderRequest createImageProviderRequest(ImageContext context, XMLProvider provider, org.xml.sax.InputSource source)
          Creates an ImageProviderRequest from an InputSource containing a single image entry.
static ImageProviderRequest[] createImageProviderRequests(ImageContext context, XMLProvider provider, org.xml.sax.InputSource source)
          Creates an array of ImageProviderRequests from an InputSource containing multiple image entries.
static MapArea[] createMapAreas(ImageContext context, XMLProvider provider, org.xml.sax.InputSource source)
          Creates an array of MapAreas from an InputSource containing a single imageMap element.
static void encodeImageMapAreas(ImageContext context, java.lang.String namespaceURI, java.lang.String localName, MapArea[] areas, java.io.PrintWriter writer)
          Encodes the MapAreas into the XML representation.
static void encodeImageProviderRequest(ImageContext context, java.lang.String namespaceURI, java.lang.String localName, ImageType type, java.util.Map<java.lang.Object,java.lang.Object> properties, java.util.Map<java.lang.Object,java.lang.Object> responseProperties, java.io.PrintWriter writer)
          Encodes an request based on the requested image type and properties.
static void registerParserFactory(java.lang.Class<?> expectedType, java.lang.String namespace, ParserFactory factory)
          Registers a ParserFactory which is used to parse ImageProviderRequest objects for elements in the specified namespace.
static void unregisterParserFactory(java.lang.Class<?> expectedType, java.lang.String namespace)
          Unregisters the ParserFactory for the specified namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createImageProviderRequest

public static ImageProviderRequest createImageProviderRequest(ImageContext context,
                                                              XMLProvider provider,
                                                              org.xml.sax.InputSource source)
                                                       throws java.io.IOException,
                                                              org.xml.sax.SAXException
Creates an ImageProviderRequest from an InputSource containing a single image entry.

Throws:
java.io.IOException
org.xml.sax.SAXException

createImageProviderRequests

public static ImageProviderRequest[] createImageProviderRequests(ImageContext context,
                                                                 XMLProvider provider,
                                                                 org.xml.sax.InputSource source)
                                                          throws java.io.IOException,
                                                                 org.xml.sax.SAXException
Creates an array of ImageProviderRequests from an InputSource containing multiple image entries.

Throws:
java.io.IOException
org.xml.sax.SAXException

encodeImageProviderRequest

public static void encodeImageProviderRequest(ImageContext context,
                                              java.lang.String namespaceURI,
                                              java.lang.String localName,
                                              ImageType type,
                                              java.util.Map<java.lang.Object,java.lang.Object> properties,
                                              java.util.Map<java.lang.Object,java.lang.Object> responseProperties,
                                              java.io.PrintWriter writer)
                                       throws java.lang.IllegalArgumentException
Encodes an request based on the requested image type and properties. If an XMLEncoder can not be found for the requested ImageType, an IllegalArgumentException is thrown.

Parameters:
context - The image context
namespaceURI - The namespace URI of the root element. If null, no namespaceURI is written.
localName - The local name of the root element
type - The ImageType of the requested image
properties - The requested image properties
responseProperties - The response properties for the image generated for this request. If null, no repsonse properties are encoded.
The - PrintWriter to encode the request to
Throws:
java.lang.IllegalArgumentException

createMapAreas

public static MapArea[] createMapAreas(ImageContext context,
                                       XMLProvider provider,
                                       org.xml.sax.InputSource source)
                                throws java.io.IOException,
                                       org.xml.sax.SAXException
Creates an array of MapAreas from an InputSource containing a single imageMap element.

Throws:
java.io.IOException
org.xml.sax.SAXException

encodeImageMapAreas

public static void encodeImageMapAreas(ImageContext context,
                                       java.lang.String namespaceURI,
                                       java.lang.String localName,
                                       MapArea[] areas,
                                       java.io.PrintWriter writer)
Encodes the MapAreas into the XML representation.

Parameters:
context - The ImageContext
namespaceURI - The namespace URI of the root element. If null, no namespaceURI is written.
localName - The local name of the root element
areas - The MapAreas to encode
writer - The PrintWriter to which the MapAreas are written

createDefaultManager

public static ParserManager createDefaultManager()
Creates a ParserManager with the default ParserFactory for the TECATE_NAMESPACE.


registerParserFactory

public static void registerParserFactory(java.lang.Class<?> expectedType,
                                         java.lang.String namespace,
                                         ParserFactory factory)
Registers a ParserFactory which is used to parse ImageProviderRequest objects for elements in the specified namespace.


unregisterParserFactory

public static void unregisterParserFactory(java.lang.Class<?> expectedType,
                                           java.lang.String namespace)
Unregisters the ParserFactory for the specified namespace.



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