Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jini.config
Class ConfigUtil

    java.lang.Object
      com.sun.jini.config.ConfigUtil

public class ConfigUtil
extends Object

A set of static convenience methods for use in configuration files. This class cannot be instantiated.

Since:
  2.0
See Also:
  `ConfigurationFile`

Method Summary
`static String` | `concat(Object[] objects)` Concatenate the strings resulting from calling `String.valueOf(Object)` on each element of an array of objects.
`static String` | `getHostName()` Return the local hostname.
`static String` | `stringLiteral(String string)` Returns a `String` whose characters, if parsed by a `ConfigurationFile`, would yield a `String` equivalent to the passed argument.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### concat

    public static String concat(Object[] objects)

  Concatenate the strings resulting from calling `String.valueOf(Object)` on each element of an array of objects. Passing a zero length array will result in the empty string being returned.

  Parameters:
    `objects` - the array of objects to be processed.
  Returns:
    the concatenation of the return values from calling `String.valueOf` on each element of `objects`.
  Throws:
    `NullPointerException` - if `objects` is `null`.

### getHostName

    public static String getHostName()
                              throws UnknownHostException

  Return the local hostname.

  Returns:
    the local hostname.
  Throws:
    `UnknownHostException` - if no IP address for the local host could be found.

### stringLiteral

    public static String stringLiteral(String string)

  Returns a `String` whose characters, if parsed by a `ConfigurationFile`, would yield a `String` equivalent to the passed argument. This is done by replacing CR and LF with their escape codes, quoting '\' and '"' with '\', and enclosing the entire sequence in double quotes. Additionally the tab, form feed, and backspace characters will be converted to their escape codes and other control characters (besides CR and LF) to octal escapes for better readability if the string is printed for debugging purposes.

  Parameters:
    `string` - the string to turn into a string literal
  Returns:
    a `String` that if parsed as sequence of of characters by `ConfigurationFile` would yield a `String` equivalent to `string`
  Throws:
    `NullPointerException` - if `string` is `null`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved