Methods Summary |
---|
java.lang.Object | coerceToClass(java.lang.Class theClass, java.lang.String value)
Object result = value;
if ( theClass != String.class )
{
if ( ClassUtil.classIsArray( theClass ) )
{
final String theClassName = theClass.getName();
final String elementClassName = ClassUtil.getArrayMemberClassName( theClassName );
// convert the string to an array of strings
result = stringToArray( value, ClassUtil.getClassFromName( elementClassName ) );
}
else
{
boolean canCoerce = true;
final Class resultClass = ClassUtil.PrimitiveClassToObjectClass( theClass );
if ( resultClass == Boolean.class )
{
// insist on "true" or "false" (case insensitive)
canCoerce = value.equalsIgnoreCase( "true" ) || value.equalsIgnoreCase( "false" );
}
if ( canCoerce )
{
result = ClassUtil.InstantiateFromString( resultClass, value );
}
}
}
return( result );
|
java.lang.Object[] | convert(java.lang.String[] stringValues, java.lang.Class elementClass)
if ( elementClass == String.class )
{
return( stringValues );
}
if ( ClassUtil.classnameIsPrimitiveArray( elementClass.getName() ) )
{
throw new IllegalArgumentException( );
}
final Object [] values = (Object [])Array.newInstance( elementClass, stringValues.length );
for( int i = 0; i < values.length; ++i )
{
values[ i ] = ClassUtil.InstantiateFromString( elementClass, stringValues[ i ] );
}
return( values );
|
javax.management.MBeanServerConnection | getMBS()
return( mConn );
|
public abstract javax.management.Attribute | getValue(javax.management.ObjectName objectName, java.lang.String valueName)
|
public abstract javax.management.Attribute | setValue(javax.management.ObjectName objectName, javax.management.Attribute attr)
|
java.lang.Object[] | stringToArray(java.lang.String s, java.lang.Class elementClass)
final String [] stringValues = stringToStringArray( s );
final Object [] values = convert( stringValues, elementClass );
return( values );
|
java.lang.String[] | stringToStringArray(java.lang.String s)
final String delimiters = "" + ARRAY_ELEMENT_SEPARATOR;
final String escapableChars = "" + ARRAY_ELEMENT_SEPARATOR + ESCAPE_CHAR;
final Tokenizer tok = new TokenizerImpl( s, delimiters, false, ESCAPE_CHAR, escapableChars );
final String [] values = tok.getTokens();
return( values );
|