FileDocCategorySizeDatePackage
AttributeNameMapper.javaAPI DocGlassfish v2 API4809Fri May 04 22:31:04 BST 2007com.sun.appserv.management.util.jmx

AttributeNameMapper

public interface AttributeNameMapper
Maps names to a derived name. An example use for this might be to map a JMX Attribute "foo-bar" to a suiteable "FooBar" form so that it can be used as a Java identifier.

Fields Summary
Constructors Summary
Methods Summary
public voidaddMapping(java.lang.String originalName, java.lang.String derivedName)

param
originalName the original/source/real name of the Attribute
param
derivedName the name by which it should be known

public voidderiveAll(java.lang.String[] originalNames)
Setup mapping for all specified Attribute names. These add to (or replace) any existing mappings.

param
originalNames all names from which should be derived names

public java.lang.StringderivedToOriginal(java.lang.String derivedName)
Reverse the effect of originalToDerived()

param
derivedName name derived from the original one

public voiddontMap(java.lang.String originalName)
Don't perform any mapping on this name. Equivalent to calling addMapping( originalName, originalName )

param
originalName the "real" name of the Attribute

public java.util.SetgetAttributeNames()
Get the entire set of Attribute names, consisting of the names that were derived, and the names that do not require mapping.

public java.lang.StringmatchName(java.lang.String derivedName, java.lang.String[] candidates)
Attempt to match the derived name to one of the candidates. This facility is used when different runtime conditions present different original names which must be mapped to the same derived name.

If a name is matched it is added as a mapping and the original name is returned.

public java.lang.StringoriginalToDerived(java.lang.String originalName)
Maps Attribute names to another name.

A common use is to construct legal Java identifiers, so that they can be exposed in an MBean proxy with get/set routines.

For example "classpath-prefix" is not legal in a Java API; it could not generate the methods getclasspath-prefix() and setclasspath-prefix().

Any legal mapping is OK. Suggested possible mappings include: ClasspathPrefix, classpathPrefix, classpath_prefix, etc. These would result in the method names: getClasspathPrefix(), getclasspathPrefix(), getclasspath_prefix(), etc.

param
originalName original name