|
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.AttributeNameMapperImpl
public class AttributeNameMapperImpl
Maps Attribute names to legal Java identifiers, so that they can be exposed in a proxy with get/set routines
| Constructor Summary | |
|---|---|
AttributeNameMapperImpl()
Create a new instance which will map nothing by default. |
|
AttributeNameMapperImpl(AttributeNameMangler mangler)
Create a new instance which will map (as necessary) the specified Attribute names |
|
AttributeNameMapperImpl(String[] originalNames)
Create a new instance which will map (as necessary) the specified Attribute names. |
|
AttributeNameMapperImpl(String[] originalNames,
AttributeNameMangler mangler)
Create a new instance which will map (as necessary) the specified Attribute names |
|
| Method Summary | |
|---|---|
void |
addMapping(String originalName,
String derivedName)
|
protected void |
debug(Object o)
|
void |
deriveAll(String[] originalNames)
Setup mapping for all specified Attribute names. |
boolean |
derivedSameAsOriginal(String derivedName)
|
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)
|
void |
setDebugOutput(Output debugOutput)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AttributeNameMapperImpl()
public AttributeNameMapperImpl(String[] originalNames)
public AttributeNameMapperImpl(AttributeNameMangler mangler)
public AttributeNameMapperImpl(String[] originalNames,
AttributeNameMangler mangler)
| Method Detail |
|---|
public void setDebugOutput(Output debugOutput)
protected final void debug(Object o)
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 deriveAll(String[] originalNames)
AttributeNameMapper
deriveAll in interface AttributeNameMapperoriginalNames - all names from which should be derived namespublic boolean derivedSameAsOriginal(String derivedName)
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 void dontMap(String originalName)
AttributeNameMapper
dontMap in interface AttributeNameMapperoriginalName - the "real" name of the Attributepublic 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 AttributeNameMapperpublic String toString()
toString in class Object
|
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.