FileDocCategorySizeDatePackage
DottedNameForValue.javaAPI DocGlassfish v2 API4462Fri May 04 22:24:08 BST 2007com.sun.enterprise.admin.dottedname

DottedNameForValue

public final class DottedNameForValue extends Object

Fields Summary
protected final DottedName
mDottedName
protected DottedName
mPrefix
protected String
mValueName
Constructors Summary
public DottedNameForValue(DottedName dottedName)

		mDottedName	= dottedName;
		mValueName	= null;
		mPrefix		= init();
	
Methods Summary
public DottedNamegetPrefix()

		return( mPrefix );
	
public java.lang.StringgetValueName()

		assert( mValueName != null );
		return( mValueName );
	
private DottedNameinit()
Examine the name and extract the name of the value, which could be either a plain name or a prefixed name.

		final List	parts		= mDottedName.getParts();
		final int	numParts	= parts.size();
		
		// the scope is first, then
		// there must be at least 1 part for there to be a value
		// example:  "domain.locale"
		if ( numParts == 0 )
		{
			final String	msg	= DottedNameStrings.getString(
					DottedNameStrings.NO_VALUE_NAME_SPECIFIED_KEY );
			throw new IllegalArgumentException( msg + " = " + mDottedName );
		}
		
		// the last part is the value name
		final String	lastPart	= (String)parts.get( numParts - 1 );
		int				numPrefixParts	= 0;
		
		// If the part preceeding the value name is prefix
		// then 
        PrefixedValueSupport prop_support = new PrefixedValueSupport(null);
        final String dottedName = DottedName.toString(mDottedName.getDomain(),
                                                mDottedName.getScope(),
                                                mDottedName.getParts(), false);
        final boolean  isPrefixed = prop_support.isPrefixedValueDottedName(dottedName);
		if ( isPrefixed )
		{
			mValueName		= prop_support.getPrefixedValueName(dottedName, true);
			numPrefixParts	= numParts - 2;
		}
		else
		{
			// it's a regular value name; does not include prefix
			mValueName		= lastPart;
			numPrefixParts	= numParts - 1;
		}
		
		return( DottedNameFactory.getInstance().get( DottedName.toString( mDottedName, numPrefixParts ) ) );
	
public java.lang.StringtoString()

        return mDottedName.toString();