Java EE 5 SDK

com.sun.appserv.management.util.jmx
Class NoOpAttributeNameMapper

java.lang.Object
  extended by com.sun.appserv.management.util.jmx.NoOpAttributeNameMapper
All Implemented Interfaces:
AttributeNameMapper

public final class NoOpAttributeNameMapper
extends Object
implements AttributeNameMapper

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

NoOpAttributeNameMapper

public NoOpAttributeNameMapper(String[] originalNames)
Create a new instance which will map (as necessary) the specified Attribute names. Same as AttributeNameMapperImpl( attributeNames, new AttributeNameManglerImpl() )

Method Detail

matchName

public String matchName(String derivedName,
                        String[] candidates)
Description copied from interface: AttributeNameMapper
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.

Specified by:
matchName in interface AttributeNameMapper

dontMap

public void dontMap(String originalName)
Description copied from interface: AttributeNameMapper
Don't perform any mapping on this name. Equivalent to calling addMapping( originalName, originalName )

Specified by:
dontMap in interface AttributeNameMapper
Parameters:
originalName - the "real" name of the Attribute

deriveAll

public void deriveAll(String[] originalNames)
Description copied from interface: AttributeNameMapper
Setup mapping for all specified Attribute names. These add to (or replace) any existing mappings.

Specified by:
deriveAll in interface AttributeNameMapper
Parameters:
originalNames - all names from which should be derived names

addMapping

public void addMapping(String originalName,
                       String derivedName)
Specified by:
addMapping in interface AttributeNameMapper
Parameters:
originalName - the original/source/real name of the Attribute
derivedName - the name by which it should be known

requiresMapping

public boolean requiresMapping(String originalName)

originalToDerived

public String originalToDerived(String originalName)
Description copied from interface: AttributeNameMapper
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.

Specified by:
originalToDerived in interface AttributeNameMapper
Parameters:
originalName - original name

derivedToOriginal

public String derivedToOriginal(String derivedName)
Description copied from interface: AttributeNameMapper
Reverse the effect of originalToDerived()

Specified by:
derivedToOriginal in interface AttributeNameMapper
Parameters:
derivedName - name derived from the original one

getAttributeNames

public Set<String> getAttributeNames()
Description copied from interface: AttributeNameMapper
Get the entire set of Attribute names, consisting of the names that were derived, and the names that do not require mapping.

Specified by:
getAttributeNames in interface AttributeNameMapper

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.