public String paramValue(Properties attributes)
        throws XDocletException
    {
        XTag cTag = getCurrentClassTag();
        XTag mTag = getCurrentMethodTag();

        String validValues = attributes.getProperty("values");
        String paramName = attributes.getProperty("paramName");
        String tagName = getCurrentTagName();

        if(DEBUG) logger.debug("current class: " + getCurrentClass().getName());
        if(DEBUG) logger.debug("cTag value for attribute \"" + 
                                            attributes.getProperty("paramName") + "\" is " + 
                                            (cTag != null ? cTag.getAttributeValue(attributes.getProperty("paramName")) : "null"));

        XProgramElement member = null;
        String value = null;
        if(cTag != null)
        {
            value = cTag.getAttributeValue(paramName);
            member = getCurrentClass();
        }
        else if(mTag != null) 
        {
            value = mTag.getAttributeValue(paramName);
            member = getCurrentMethod();
        }

        // a value was found. perform sanity checks on valid values
        if (validValues != null) 
        {
            if(DEBUG) logger.debug("validValues: " + validValues);
            // check if the value is among the valid values
            StringTokenizer st = new StringTokenizer(validValues, ",");
            boolean valid = false;
            while (st.hasMoreTokens()) 
            {
                if (st.nextToken().equals(value)) 
                    valid = true;
            }

            if(!valid)
            {
                if(DEBUG) logger.debug("FOUND AN INVALID VALUE: " + value);

                if(member instanceof XMethod)
                {
                    throw new XDocletException
                        (Translator.getString(XDocletMessages.class, 
                                              XDocletMessages.INVALID_TAG_PARAM_VALUE_METHOD,
                                              new String[]{value, 
                                                           paramName, 
                                                           tagName, 
                                                           ((XMethod)member).getName(), 
                                                           ((XMethod)member).getContainingClass().getQualifiedName(), 
                                                           validValues}));
                }
                else if(member instanceof XClass)
                {
                    throw new XDocletException(Translator.getString(XDocletMessages.class, 
                                                                    XDocletMessages.INVALID_TAG_PARAM_VALUE_CLASS,
                                                                    new String[]{value, 
                                                                                 paramName, 
                                                                                 tagName, ((XClass)member).getQualifiedName(), 
                                                                                 validValues}));
                }
            }

            // it's ridiculous that this is private in the base class
            //invalidParamValueFound(doc, paramName, "", value, validValues);
        }
        
        return value;
    }
public String paramValue ( Properties attributes ) throws XDocletException { XTag cTag = getCurrentClassTag ( ) ; XTag mTag = getCurrentMethodTag ( ) ; String validValues = attributes . getProperty ( "values" ) ; String paramName = attributes . getProperty ( "paramName" ) ; String tagName = getCurrentTagName ( ) ; if ( DEBUG ) logger . debug ( "current class: " + getCurrentClass ( ) . getName ( ) ) ; if ( DEBUG ) logger . debug ( "cTag value for attribute \"" + attributes . getProperty ( "paramName" ) + "\" is " + ( cTag != null ? cTag . getAttributeValue ( attributes . getProperty ( "paramName" ) ) : "null" ) ) ; XProgramElement member = null ; String value = null ; if ( cTag != null ) { value = cTag . getAttributeValue ( paramName ) ; member = getCurrentClass ( ) ; } else if ( mTag != null ) { value = mTag . getAttributeValue ( paramName ) ; member = getCurrentMethod ( ) ; } if ( validValues != null ) { if ( DEBUG ) logger . debug ( "validValues: " + validValues ) ; StringTokenizer st = new StringTokenizer ( validValues , "," ) ; boolean valid = false ; while ( st . hasMoreTokens ( ) ) { if ( st . nextToken ( ) . equals ( value ) ) valid = true ; } if ( ! valid ) { if ( DEBUG ) logger . debug ( "FOUND AN INVALID VALUE: " + value ) ; if ( member instanceof XMethod ) { throw new XDocletException ( Translator . getString ( XDocletMessages . class , XDocletMessages . INVALID_TAG_PARAM_VALUE_METHOD , new String [ ] { value , paramName , tagName , ( ( XMethod ) member ) . getName ( ) , ( ( XMethod ) member ) . getContainingClass ( ) . getQualifiedName ( ) , validValues } ) ) ; } else if ( member instanceof XClass ) { throw new XDocletException ( Translator . getString ( XDocletMessages . class , XDocletMessages . INVALID_TAG_PARAM_VALUE_CLASS , new String [ ] { value , paramName , tagName , ( ( XClass ) member ) . getQualifiedName ( ) , validValues } ) ) ; } } } return value ; }
@doc:tag type="content"
@doc:param name="paramName" description="The parameter name"
@doc.param name="values"
description="The valid values for the parameter, comma separated. An error message is printed if the parameter value is not one of the values."