IT.CappuccinoNet  
StrutsCX v0.8.1
   

com.cappuccinonet.strutscx.xslt
Class StrutsCXBeanToElement

java.lang.Object
  |
  +--com.cappuccinonet.strutscx.xslt.StrutsCXBeanToElement

public class StrutsCXBeanToElement
extends java.lang.Object

Serializes a bean, respectively a FormBean, into a org.jdom.Element. This class is used by the StrutsCXDocumentBuilder class. Idea by Julien Mercay and Gilberd Bouzeid, Orbeon.com.

Version:
v0.8, 2002.10.15
Author:
Bernhard Woehrlin, IT.CappuccinoNet.com

Field Summary
private static Logger logger
          The Logger we use to log JDK 1.4 conform.
private static java.lang.String THIS_CLASS
          A String with this Classname used for system messages.
 
Constructor Summary
StrutsCXBeanToElement()
           
 
Method Summary
private  Element checkBeanContent(java.lang.Object bean)
          This method looks into a bean for the getters and invoke them to get the property's value.
 Element getBeanContent(java.lang.Object bean)
          Main method to serialize a bean and its content.
private  Element getBeanElement(java.lang.String name, java.lang.Object value, Element baseElement)
          This method serializes a JavaBean property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THIS_CLASS

private static final java.lang.String THIS_CLASS
A String with this Classname used for system messages.

See Also:
Constant Field Values

logger

private static Logger logger
The Logger we use to log JDK 1.4 conform.

Constructor Detail

StrutsCXBeanToElement

public StrutsCXBeanToElement()
Method Detail

getBeanContent

public Element getBeanContent(java.lang.Object bean)
Main method to serialize a bean and its content.

Parameters:
bean - a JavaBean to serialize
Returns:
org.w3c.dom.Element

checkBeanContent

private Element checkBeanContent(java.lang.Object bean)
                          throws java.beans.IntrospectionException,
                                 java.lang.IllegalAccessException,
                                 java.lang.reflect.InvocationTargetException
This method looks into a bean for the getters and invoke them to get the property's value.

Parameters:
bean - a JavaBean to introspect
Returns:
org.w3c.dom.Element
Throws:
java.beans.IntrospectionException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

getBeanElement

private Element getBeanElement(java.lang.String name,
                               java.lang.Object value,
                               Element baseElement)
This method serializes a JavaBean property. If the property is:
  1. an instance of Collection, we iterate through it to serialize all items in the collection. The resulting DOM tree looks like: OneTwo
  2. an instance java.lang.*, we simply invoke toString()
  3. null, NOP
  4. an instance of another class, we inspect that bean.

    Parameters:
    name - the name of the property
    value - the value of the property
    baseElement - where to append to resulting DOM tree
    Returns:
    org.w3c.dom.Element

IT.CappuccinoNet  
StrutsCX v0.8.1
   

© 2002, IT.CappuccinoNet.com - compiled 20021015:2052