FileDocCategorySizeDatePackage
EjbNameNMTOKEN.javaAPI DocGlassfish v2 API3773Fri May 04 22:33:32 BST 2007com.sun.enterprise.tools.verifier.tests.ejb

EjbNameNMTOKEN

public class EjbNameNMTOKEN extends EjbTest implements EjbCheck
The ejb-name must conform to the lexical rules for an NMTOKEN

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(com.sun.enterprise.deployment.EjbDescriptor descriptor)
The ejb-name must conform to the lexical rules for an NMTOKEN

param
descriptor the Enterprise Java Bean deployment descriptor
return
Result the results for this assertion


        Result result = getInitializedResult();
        String ejbName = descriptor.getName();
        ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();

        // The ejb-name must conform to the lexical rules for an NMTOKEN
        if (!(NameToken.isNMTOKEN(ejbName))) {
            // it's bad, test should not pass
            addErrorDetails(result, compName);
            result.failed
                    (smh.getLocalString
                    (getClass().getName() + ".failed",
                            "Error: [ {0} ] does not conform to the lexical rules of NMTOKEN within bean [ {1} ]",
                            new Object[] {ejbName, descriptor.getName()}));
        } else {
            addGoodDetails(result, compName);
            result.passed
                    (smh.getLocalString
                    (getClass().getName() + ".passed",
                            "[ {0} ] conforms to the lexical rules of NMTOKEN within bean [ {1} ]",
                            new Object[] {ejbName, descriptor.getName()}));
        }
        return result;