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

## org.jboss.mx.util
Class ObjectNameConverter

    java.lang.Object
      org.jboss.mx.util.ObjectNameConverter

public class ObjectNameConverter
extends Object

Converts forbidden characters in the key and value of an object name to valid characters and back.
Character Conversion Table: (based on RFC 1738 style escapes
'%' => '%25'
'*' => '%2a'
',' => '%2c'
':' => '%3a'
'?' => '%3f'
'=' => '%3d'
Thanx to William Hoyle for mention this
Attention:When you have a comma in one of your property value then you have to use a Hashtable to provide the properties otherwise the property parsing will fail.

Version:
  $Revision: 1.4 $
Author:
  Andreas Schaefer, William Hoyle

Constructor Summary
`ObjectNameConverter()`

Method Summary
`static ObjectName` | `convert(String pObjectName)` Parses the given Object Name String representation and replaces any invalid characters in property keays and values with valid characters.
`static ObjectName` | `convert(String pDomainName, Hashtable pProperties)` Check the keys and values of the properties and convert invalid characters
`static String` | `convertCharacters(String pValue, boolean pEncrypt)` Encrypt or decrypt the forbidden characters in an Object Name value property
`static Hashtable` | `getProperties(ObjectName pObjectName)` Takes the properties from the given Object Name and convert special characters back
`static String` | `getString(ObjectName pObjectName)` Takes the properties from the given Object Name and convert special characters back

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

Constructor Detail

### ObjectNameConverter

    public ObjectNameConverter()

Method Detail

### convert

    public static ObjectName convert(String pObjectName)
                              throws MalformedObjectNameException

  Parses the given Object Name String representation and replaces any invalid characters in property keays and values with valid characters. Attention: Do not use this method when a property key or value contain a comma because then the parsing will fail. Please use the `convert( String, Hashtable )` instead because the properties are already parsed (by you).

  Parameters:
    `pObjectName` - String representing an Object Name which must not contain a comman inside a property value
  Returns:
    Created Object Name with the converted keys and values of the given Object Name
  Throws:
    `MalformedObjectNameException` - If the given Object Name is not correct

### convert

    public static ObjectName convert(String pDomainName,
                                     Hashtable pProperties)
                              throws MalformedObjectNameException

  Check the keys and values of the properties and convert invalid characters

  Parameters:
    `pDomainName` - Name of the Domain
  Returns:
    Created Object Name with the converted keays and values
  Throws:
    `MalformedObjectNameException` - If the given Object Name is not correct

### getProperties

    public static Hashtable getProperties(ObjectName pObjectName)

  Takes the properties from the given Object Name and convert special characters back

  Parameters:
    `pObjectName` - Given Object Name
  Returns:
    Hashtable with the back converted properties in it and will contain a "*" as key if the given object name is a property pattern for queries.

### getString

    public static String getString(ObjectName pObjectName)

  Takes the properties from the given Object Name and convert special characters back

  Parameters:
    `pObjectName` - Given Object Name
  Returns:
    String with the original Object Name String representation and when a property pattern Object Name for queries it contains a ",*" at the end.

### convertCharacters

    public static String convertCharacters(String pValue,
                                           boolean pEncrypt)

  Encrypt or decrypt the forbidden characters in an Object Name value property

  Parameters:
    `pValue` - Property Value of the Object Name's property list to be en- or decrypted
    `pEncrypt` - True if the value must be encrypted otherwise decrypted
  Returns:
    A en- or decrypted String according to the conversion table above

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 © 2002 JBoss Group, LLC. All Rights Reserved.