Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.griffin.bean.transform
Class BeanTransformer  view BeanTransformer download BeanTransformer.java

java.lang.Object
  extended bycom.aendvari.griffin.bean.transform.BeanTransformer

public class BeanTransformer
extends java.lang.Object

Translates the contents of a Java Bean into the given com.aendvari.common.model.ModelNode. See the com.aendvari.common.model package for more about the com.aendvari.common.model.ModelNode.


Constructor Summary
BeanTransformer()
           
 
Method Summary
static void beanToModel(java.lang.Object beanObject, com.aendvari.common.model.ModelNode modelNode, boolean replaceChildren)
          Converts the given bean into it's XML representation as required.
private static void beanToModel(java.lang.Object beanObject, com.aendvari.common.model.ModelTree modelTree, com.aendvari.common.model.ModelNode propertyNode)
          Converts the given bean into it's XML representation as required.
private static com.aendvari.common.model.ModelNode beanToModel(java.lang.Object beanObject, java.lang.String propertyName, com.aendvari.common.model.ModelTree modelTree, com.aendvari.common.model.ModelNode modelNode)
          Converts the given bean into it's XML representation as required.
static java.lang.Object createBeanFromModel(com.aendvari.common.model.ModelNode beanNode)
          Extract a bean from the XML node.
private static void examineNodeValues(InspectedBean inspectedBean, com.aendvari.common.model.ModelNode objectNode, boolean updateExamine)
          Examines the node (and it's children) for the bean properties to match with the inspected bean.
private static void examineObject(com.aendvari.common.model.ModelTree modelTree, com.aendvari.common.model.ModelNode classNode, java.lang.String propertyName, java.lang.Object value)
          Examines the given object to determine its type, and then transform that object into it's XML representation as required.
private static boolean hasClassChild(com.aendvari.common.model.ModelNode parentNode)
          Determines if the given node has a <class> child within it.
static boolean isJavaLangClass(java.lang.Class valueClass)
          Determines if the given class is from the java.lang package.
static boolean isJavaLangClass(java.lang.Object value)
          Determines if the given object is a class from the java.lang package
static boolean isJavaUtilClass(java.lang.Class valueClass)
          Determines if the given class is from the java.util package.
static boolean isJavaUtilClass(java.lang.Object value)
          Determines if the given object is a class from the java.util package.
static java.lang.Object updateBeanFromModel(java.lang.Object beanObj, com.aendvari.common.model.ModelNode beanNode)
          Extract a bean from the XMl node and places into given bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanTransformer

public BeanTransformer()
Method Detail

beanToModel

public static void beanToModel(java.lang.Object beanObject,
                               com.aendvari.common.model.ModelNode modelNode,
                               boolean replaceChildren)
                        throws java.lang.Exception
Converts the given bean into it's XML representation as required.


beanToModel

private static com.aendvari.common.model.ModelNode beanToModel(java.lang.Object beanObject,
                                                               java.lang.String propertyName,
                                                               com.aendvari.common.model.ModelTree modelTree,
                                                               com.aendvari.common.model.ModelNode modelNode)
                                                        throws java.lang.Exception
Converts the given bean into it's XML representation as required. A new node is created under the supplied model node to contain bean.


beanToModel

private static void beanToModel(java.lang.Object beanObject,
                                com.aendvari.common.model.ModelTree modelTree,
                                com.aendvari.common.model.ModelNode propertyNode)
                         throws java.lang.Exception
Converts the given bean into it's XML representation as required.


examineObject

private static void examineObject(com.aendvari.common.model.ModelTree modelTree,
                                  com.aendvari.common.model.ModelNode classNode,
                                  java.lang.String propertyName,
                                  java.lang.Object value)
                           throws java.lang.Exception
Examines the given object to determine its type, and then transform that object into it's XML representation as required.


hasClassChild

private static boolean hasClassChild(com.aendvari.common.model.ModelNode parentNode)
Determines if the given node has a <class> child within it.


createBeanFromModel

public static java.lang.Object createBeanFromModel(com.aendvari.common.model.ModelNode beanNode)
                                            throws java.lang.Exception
Extract a bean from the XML node.


updateBeanFromModel

public static java.lang.Object updateBeanFromModel(java.lang.Object beanObj,
                                                   com.aendvari.common.model.ModelNode beanNode)
                                            throws java.lang.Exception
Extract a bean from the XMl node and places into given bean. Only the properties in the XML are "set" into the bean, the remainders are left in their original state.


examineNodeValues

private static void examineNodeValues(InspectedBean inspectedBean,
                                      com.aendvari.common.model.ModelNode objectNode,
                                      boolean updateExamine)
                               throws java.lang.Exception
Examines the node (and it's children) for the bean properties to match with the inspected bean. Once a property is matched, it is added to the "set" method parameters of the bean.


isJavaUtilClass

public static boolean isJavaUtilClass(java.lang.Object value)
Determines if the given object is a class from the java.util package.


isJavaUtilClass

public static boolean isJavaUtilClass(java.lang.Class valueClass)
Determines if the given class is from the java.util package.


isJavaLangClass

public static boolean isJavaLangClass(java.lang.Object value)
Determines if the given object is a class from the java.lang package


isJavaLangClass

public static boolean isJavaLangClass(java.lang.Class valueClass)
Determines if the given class is from the java.lang package.