Top Description Fields Constructors Methods
org.freedesktop.dbus.utils.bin

public final Class IdentifierMangler

extends Object
Class Inheritance
Imports
java.util.HashSet, .Set

Checks identifiers for keywords etc and mangles them if so.

Field Summary

Modifier and TypeField and Description
private static final Set<String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if reserved
isReservedWord
(String
name to check
_name
)

Checks if given value is a reserved keyword in Java.

public static String

Returns:

String
mangle
(String
name to check
_name
)

Checks if given name is a reserved word in Java.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KEYWORDSback to summary
private static final Set<String> KEYWORDS

Constructor Detail

IdentifierManglerback to summary
private IdentifierMangler()

Method Detail

isReservedWordback to summary
public static boolean isReservedWord(String _name)

Checks if given value is a reserved keyword in Java.

Parameters
_name:String

name to check

Returns:boolean

true if reserved

mangleback to summary
public static String mangle(String _name)

Checks if given name is a reserved word in Java.

If true, returns the given name with a "_" prepended. Otherwise returns the input string.

Parameters
_name:String

name to check

Returns:String

String