org.apache.taglibs.rdc
Class RDCUtils

java.lang.Object
  extended byorg.apache.taglibs.rdc.RDCUtils

public class RDCUtils
extends java.lang.Object

Utility methods for the rdc package

Author:
Rahul Akolkar

Constructor Summary
RDCUtils()
           
 
Method Summary
static boolean clearChildDataModel(BaseModel parent, java.lang.String childId)
          Clear a nested data model
static java.util.Map configHandler(java.lang.String config, javax.servlet.jsp.PageContext context)
          A config handler commonly used by composites for passing prompts down to their constituent components (such as mortgage and creditcardInfo).
static org.xml.sax.InputSource extract(java.lang.String jar, java.lang.String file)
          Given a jar and a file location within the jar, extract the file as an InputSource
static BaseModel getChildDataModel(BaseModel parent, java.lang.String childId)
          Return a nested data model
static java.lang.Class getClass(java.lang.String className)
          Return the Class for this class name, if such a class exists, else return null.
static java.lang.String getNextRDCVarName()
          Create a temporary variable name for this groupTag's page context
static boolean hasField(java.lang.Class clas, java.lang.String field)
          Return true if the given class defines or inherits the given field.
static boolean hasMethod(java.lang.Class clas, java.lang.String methodName, java.lang.Class[] paramTypes)
          Return true if the given class defines or inherits the given method.
static boolean implementsInterface(java.lang.Class clas, java.lang.Class interfayce)
          Return true if the given class implements the given interface.
static boolean isStringEmpty(java.lang.String str)
          Return true if this string contains non-white space characters.
static void mustExist(java.lang.String str, java.lang.String err_msg)
          Log error if the supplied string is null or empty.
static void mustSatisfy(boolean cond, java.lang.String err_msg)
          Log error if the supplied condition is not satisfied.
static void warnIf(boolean cond, java.lang.String err_msg)
          Print warning via if the supplied error condition holds, but move on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDCUtils

public RDCUtils()
Method Detail

implementsInterface

public static boolean implementsInterface(java.lang.Class clas,
                                          java.lang.Class interfayce)
Return true if the given class implements the given interface.


hasField

public static boolean hasField(java.lang.Class clas,
                               java.lang.String field)
Return true if the given class defines or inherits the given field.


hasMethod

public static boolean hasMethod(java.lang.Class clas,
                                java.lang.String methodName,
                                java.lang.Class[] paramTypes)
Return true if the given class defines or inherits the given method.


getClass

public static java.lang.Class getClass(java.lang.String className)
Return the Class for this class name, if such a class exists, else return null.


mustExist

public static void mustExist(java.lang.String str,
                             java.lang.String err_msg)
Log error if the supplied string is null or empty.


mustSatisfy

public static void mustSatisfy(boolean cond,
                               java.lang.String err_msg)
Log error if the supplied condition is not satisfied.


warnIf

public static void warnIf(boolean cond,
                          java.lang.String err_msg)
Print warning via if the supplied error condition holds, but move on.


isStringEmpty

public static boolean isStringEmpty(java.lang.String str)
Return true if this string contains non-white space characters.


getNextRDCVarName

public static java.lang.String getNextRDCVarName()
Create a temporary variable name for this groupTag's page context


getChildDataModel

public static BaseModel getChildDataModel(BaseModel parent,
                                          java.lang.String childId)
Return a nested data model


clearChildDataModel

public static boolean clearChildDataModel(BaseModel parent,
                                          java.lang.String childId)
Clear a nested data model


configHandler

public static java.util.Map configHandler(java.lang.String config,
                                          javax.servlet.jsp.PageContext context)
A config handler commonly used by composites for passing prompts down to their constituent components (such as mortgage and creditcardInfo). Stores the id and file attributes from the config xml to a Map. Composite config file should look like:

<config>
<componentConfigList>
<component id="foo" config="dir/configfile.xml" />
<!-- More component elements here -->
</componentConfigList>
</config>


extract

public static org.xml.sax.InputSource extract(java.lang.String jar,
                                              java.lang.String file)
                                       throws java.io.IOException
Given a jar and a file location within the jar, extract the file as an InputSource

Throws:
java.io.IOException


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.