|
Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.appserv.management.util.jmx.NoOpAttributeNameMapper
public final class NoOpAttributeNameMapper
A mapper that maps every name to itself.
| Constructor Summary | |
|---|---|
NoOpAttributeNameMapper(String[] originalNames)
Create a new instance which will map (as necessary) the specified Attribute names. |
|
| 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. |
boolean |
requiresMapping(String originalName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NoOpAttributeNameMapper(String[] originalNames)
| Method Detail |
|---|
public String matchName(String derivedName,
String[] candidates)
AttributeNameMapperIf a name is matched it is added as a mapping and the original name is returned.
matchName in interface AttributeNameMapperpublic void dontMap(String originalName)
AttributeNameMapper
dontMap in interface AttributeNameMapperoriginalName - the "real" name of the Attributepublic void deriveAll(String[] originalNames)
AttributeNameMapper
deriveAll in interface AttributeNameMapperoriginalNames - all names from which should be derived names
public void addMapping(String originalName,
String derivedName)
addMapping in interface AttributeNameMapperoriginalName - the original/source/real name of the AttributederivedName - the name by which it should be knownpublic boolean requiresMapping(String originalName)
public String originalToDerived(String originalName)
AttributeNameMapperA 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.
originalToDerived in interface AttributeNameMapperoriginalName - original namepublic String derivedToOriginal(String derivedName)
AttributeNameMapper
derivedToOriginal in interface AttributeNameMapperderivedName - name derived from the original onepublic Set<String> getAttributeNames()
AttributeNameMapper
getAttributeNames in interface AttributeNameMapper
|
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.