|
Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.
| Method Summary | |
|---|---|
void |
addMapping(String originalName,
String derivedName)
|
void |
deriveAll(String[] originalNames)
Setup mapping for all specified Attribute names. |
String |
derivedToOriginal(String derivedName)
Reverse the effect of originalToDerived() |
void |
dontMap(String originalName)
Don't perform any mapping on this name. |
Set<String> |
getAttributeNames()
Get the entire set of Attribute names, consisting of the names that were derived, and the names that do not require mapping. |
String |
matchName(String derivedName,
String[] candidates)
Attempt to match the derived name to one of the candidates. |
String |
originalToDerived(String originalName)
Maps Attribute names to another name. |
| Method Detail |
|---|
void addMapping(String originalName,
String derivedName)
originalName - the original/source/real name of the AttributederivedName - the name by which it should be knownvoid dontMap(String originalName)
originalName - the "real" name of the Attributevoid deriveAll(String[] originalNames)
originalNames - all names from which should be derived names
String matchName(String derivedName,
String[] candidates)
If a name is matched it is added as a mapping and the original name is returned.
String originalToDerived(String originalName)
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.
originalName - original nameString derivedToOriginal(String derivedName)
derivedName - name derived from the original oneSet<String> getAttributeNames()
|
Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved.