com.primix.tapestry
Class Tapestry

java.lang.Object
  |
  +--com.primix.tapestry.Tapestry

public final class Tapestry
extends java.lang.Object

A placeholder for a number of (static) methods that don't belong elsewhere.

Since:
1.0.1
Version:
$Id: Tapestry.java,v 1.9 2001/09/11 21:41:12 hship Exp $
Author:
Howard Ship

Field Summary
static java.lang.String VERSION
          The version of the framework; this is updated for major releases.
 
Method Summary
static void close(java.io.InputStream stream)
          Closes the stream (if not null), ignoring any IOException thrown.
static java.util.Iterator coerceToIterator(java.lang.Object value)
          Converts an Object into an Iterator, following some basic rules.
static void copyInformalBindings(IComponent source, IComponent destination)
          Copys all informal bindings from a source component to the destination component.
static boolean evaluateBoolean(java.lang.Object value)
          Evaluates an object to determine its boolean value.
static java.util.Locale getLocale(java.lang.String s)
          Gets the Locale for the given string, which is the result of Locale.toString().
static boolean isNull(java.lang.String value)
          Returns true if the value is null or empty (is the empty string, or contains only whitespace).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
The version of the framework; this is updated for major releases.
Method Detail

isNull

public static boolean isNull(java.lang.String value)
Returns true if the value is null or empty (is the empty string, or contains only whitespace).

copyInformalBindings

public static void copyInformalBindings(IComponent source,
                                        IComponent destination)
Copys all informal bindings from a source component to the destination component. Informal bindings are bindings for informal parameters. This will overwrite parameters (formal or informal) in the destination component if there is a naming conflict.

evaluateBoolean

public static boolean evaluateBoolean(java.lang.Object value)
Evaluates an object to determine its boolean value.
Class Test
Boolean Self explanatory.
Number True if non-zero, false otherwise.
Collection True if contains any elements, false otherwise.
String True if contains any non-whitespace characters, false otherwise.
Any array type True if contains any elements, false otherwise.

Any other non-null object evaluates to true.


coerceToIterator

public static java.util.Iterator coerceToIterator(java.lang.Object value)
Converts an Object into an Iterator, following some basic rules.
Input Class Result
Object array Converted to a List and iterator returned. null returned if the array is empty.
Iterator Returned as-is.
Collection Iterator returned, or nul if the Collection is empty
Any other null returned
null null returned

getLocale

public static java.util.Locale getLocale(java.lang.String s)
Gets the Locale for the given string, which is the result of Locale.toString(). If no such locale is already registered, a new instance is created, registered and returned.

close

public static void close(java.io.InputStream stream)
Closes the stream (if not null), ignoring any IOException thrown.
Since:
1.0.2