org.apache.cocoon.components.language.markup.xsp
Class XSPObjectHelper

java.lang.Object
  extended by org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper
Direct Known Subclasses:
XSPCookieHelper

public class XSPObjectHelper
extends Object

Base class for XSP's object model manipulation logicsheets

Version:
$Id: XSPObjectHelper.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Ricardo Rocha, Sylvain Wallez (Cocoon1 xspExpr() methods port)

Constructor Summary
XSPObjectHelper()
           
 
Method Summary
protected static void addAttribute(AttributesImpl attr, String name, String value)
          Add an attribute
protected static void data(ContentHandler contentHandler, String data)
          Add string data
protected static void elementData(String uri, String prefix, ContentHandler contentHandler, String name, String data)
          Output an element containing text only and no attributes
protected static void elementData(String uri, String prefix, ContentHandler contentHandler, String name, String data, AttributesImpl attr)
          Output an element containing text only and attributes
protected static void end(String uri, String prefix, ContentHandler contentHandler, String name)
          End an element with the proper object's uri and prefix
protected static void start(String uri, String prefix, ContentHandler contentHandler, String name)
          Start an element with the proper object's uri and prefix and no attributes
protected static void start(String uri, String prefix, ContentHandler contentHandler, String name, AttributesImpl attr)
          Start an element with the proper object's uri and prefix and with attributes
static void xspExpr(ContentHandler contentHandler, boolean v)
          Implementation of <xsp:expr> for boolean : outputs characters representing the value (true / false).
static void xspExpr(ContentHandler contentHandler, byte v)
          Implementation of <xsp:expr> for byte : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, char v)
          Implementation of <xsp:expr> for char : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, Collection v)
          Implementation of <xsp:expr> for java.util.Collection : outputs the value by calling xspExpr() on each element of the collection.
static void xspExpr(ContentHandler contentHandler, double v)
          Implementation of <xsp:expr> for double : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, float v)
          Implementation of <xsp:expr> for long : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, int v)
          Implementation of <xsp:expr> for int : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, long v)
          Implementation of <xsp:expr> for long : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, Node v)
          Implementation of <xsp:expr> for org.w3c.dom.Node : converts the Node to a SAX event stream.
static void xspExpr(ContentHandler contentHandler, Object v)
          Implementation of <xsp:expr> for Object depending on its class : if it's an array, call xspExpr() on all its elements, if it's class has a specific xspExpr()implementation, use it, else, output it's string representation.
static void xspExpr(ContentHandler contentHandler, String text)
          Implementation of <xsp:expr> for String : outputs characters representing the value.
static void xspExpr(ContentHandler contentHandler, XMLizable v)
          Implementation of <xsp:expr> for XMLizable : outputs the value by calling v.toSax(contentHandler).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSPObjectHelper

public XSPObjectHelper()
Method Detail

elementData

protected static void elementData(String uri,
                                  String prefix,
                                  ContentHandler contentHandler,
                                  String name,
                                  String data)
                           throws SAXException
Output an element containing text only and no attributes

Parameters:
contentHandler - The SAX content handler
name - The element name
data - The data contained by the element
Throws:
SAXException

elementData

protected static void elementData(String uri,
                                  String prefix,
                                  ContentHandler contentHandler,
                                  String name,
                                  String data,
                                  AttributesImpl attr)
                           throws SAXException
Output an element containing text only and attributes

Parameters:
contentHandler - The SAX content handler
name - The element name
data - The data contained by the element
attr - The element attributes
Throws:
SAXException

start

protected static void start(String uri,
                            String prefix,
                            ContentHandler contentHandler,
                            String name)
                     throws SAXException
Start an element with the proper object's uri and prefix and no attributes

Parameters:
contentHandler - The SAX content handler
name - The element name
Throws:
SAXException

start

protected static void start(String uri,
                            String prefix,
                            ContentHandler contentHandler,
                            String name,
                            AttributesImpl attr)
                     throws SAXException
Start an element with the proper object's uri and prefix and with attributes

Parameters:
contentHandler - The SAX content handler
name - The element name
attr - The element attributes
Throws:
SAXException

end

protected static void end(String uri,
                          String prefix,
                          ContentHandler contentHandler,
                          String name)
                   throws SAXException
End an element with the proper object's uri and prefix

Parameters:
contentHandler - The SAX content handler
name - The element name
Throws:
SAXException

addAttribute

protected static void addAttribute(AttributesImpl attr,
                                   String name,
                                   String value)
                            throws SAXException
Add an attribute

Parameters:
attr - The attribute list
name - The attribute name
value - The attribute value
Throws:
SAXException

data

protected static void data(ContentHandler contentHandler,
                           String data)
                    throws SAXException
Add string data

Parameters:
contentHandler - The SAX content handler
data - The string data
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           char v)
                    throws SAXException
Implementation of <xsp:expr> for char : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           byte v)
                    throws SAXException
Implementation of <xsp:expr> for byte : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           boolean v)
                    throws SAXException
Implementation of <xsp:expr> for boolean : outputs characters representing the value (true / false).

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           int v)
                    throws SAXException
Implementation of <xsp:expr> for int : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           long v)
                    throws SAXException
Implementation of <xsp:expr> for long : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           float v)
                    throws SAXException
Implementation of <xsp:expr> for long : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           double v)
                    throws SAXException
Implementation of <xsp:expr> for double : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           String text)
                    throws SAXException
Implementation of <xsp:expr> for String : outputs characters representing the value.

Parameters:
contentHandler - the SAX content handler
text - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           XMLizable v)
                    throws SAXException
Implementation of <xsp:expr> for XMLizable : outputs the value by calling v.toSax(contentHandler).

Parameters:
contentHandler - the SAX content handler
v - the XML fragment
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           Node v)
                    throws SAXException
Implementation of <xsp:expr> for org.w3c.dom.Node : converts the Node to a SAX event stream.

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           Collection v)
                    throws SAXException
Implementation of <xsp:expr> for java.util.Collection : outputs the value by calling xspExpr() on each element of the collection.

Parameters:
contentHandler - the SAX content handler
v - the XML fragment
Throws:
SAXException

xspExpr

public static void xspExpr(ContentHandler contentHandler,
                           Object v)
                    throws SAXException
Implementation of <xsp:expr> for Object depending on its class :

Parameters:
contentHandler - the SAX content handler
v - the value
Throws:
SAXException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.