zinger.util
Class Util

java.lang.Object
  extended by zinger.util.Util

public final class Util
extends java.lang.Object

A general utility class.


Field Summary
static java.lang.String IMPORT_DELIMITER
           
static java.lang.String IMPORT_PROPERTY
           
static java.lang.String PROPERTY_REFERENCE_POSTFIX
          Used for property reference evaluation.
protected static int PROPERTY_REFERENCE_POSTFIX_LENGTH
          A constant that enables code dealing with parsing property references not to compute the length of the reference postfix every time.
static java.lang.String PROPERTY_REFERENCE_PREFIX
          Used for property reference evaluation.
protected static int PROPERTY_REFERENCE_PREFIX_LENGTH
          A constant that enables code dealing with parsing property references not to compute the length of the reference prefix every time.
 
Method Summary
static void evalAllProperties(java.util.Properties in, java.util.Properties out)
          Evaluates all properties in a Properties object.
static java.lang.String evalProperty(java.lang.String propertyName, java.util.Properties in, java.util.Properties out)
          Evaluates a property in a Properties object.
static void loadImports(java.util.Properties p)
           
static void loadImports(java.util.Properties p, java.util.Locale locale, java.lang.ClassLoader loader)
           
static void pipeStream(java.io.InputStream in, java.io.OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_REFERENCE_PREFIX

public static final java.lang.String PROPERTY_REFERENCE_PREFIX
Used for property reference evaluation. Set to "${".

See Also:
PROPERTY_REFERENCE_POSTFIX, Constant Field Values

PROPERTY_REFERENCE_PREFIX_LENGTH

protected static final int PROPERTY_REFERENCE_PREFIX_LENGTH
A constant that enables code dealing with parsing property references not to compute the length of the reference prefix every time.

See Also:
PROPERTY_REFERENCE_PREFIX

PROPERTY_REFERENCE_POSTFIX

public static final java.lang.String PROPERTY_REFERENCE_POSTFIX
Used for property reference evaluation. Set to "}".

See Also:
PROPERTY_REFERENCE_PREFIX, Constant Field Values

PROPERTY_REFERENCE_POSTFIX_LENGTH

protected static final int PROPERTY_REFERENCE_POSTFIX_LENGTH
A constant that enables code dealing with parsing property references not to compute the length of the reference postfix every time.

See Also:
PROPERTY_REFERENCE_POSTFIX

IMPORT_PROPERTY

public static final java.lang.String IMPORT_PROPERTY
See Also:
Constant Field Values

IMPORT_DELIMITER

public static final java.lang.String IMPORT_DELIMITER
See Also:
Constant Field Values
Method Detail

evalProperty

public static java.lang.String evalProperty(java.lang.String propertyName,
                                            java.util.Properties in,
                                            java.util.Properties out)
Evaluates a property in a Properties object. Property values can include references to other properties. In such cases, those references are evaluated. References are indicated by enclosing the name of the referred-to property in "${" and "}".

Parameters:
propertyName - the name of the property to be evaluated
in - the Properties object to evaluate the property in question and all its references
out - if not null, the result of the evaluation is written into this Properties object. It is okay to pass the same Properties object as in and out. In that case, the property will be written over with the resulting value.
See Also:
PROPERTY_REFERENCE_PREFIX, PROPERTY_REFERENCE_POSTFIX, Properties

evalAllProperties

public static void evalAllProperties(java.util.Properties in,
                                     java.util.Properties out)
Evaluates all properties in a Properties object.

See Also:
evalProperty(java.lang.String, java.util.Properties, java.util.Properties)

loadImports

public static void loadImports(java.util.Properties p,
                               java.util.Locale locale,
                               java.lang.ClassLoader loader)

loadImports

public static void loadImports(java.util.Properties p)

pipeStream

public static void pipeStream(java.io.InputStream in,
                              java.io.OutputStream out)
                       throws java.io.IOException
Throws:
java.io.IOException