1 23 package com.sun.enterprise.tools.verifier.tests.ejb; 24 25 import com.sun.enterprise.deployment.EjbDescriptor; 26 import com.sun.enterprise.tools.verifier.NameToken; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 29 30 33 public class EjbNameNMTOKEN extends EjbTest implements EjbCheck { 34 35 36 37 44 public Result check(EjbDescriptor descriptor) { 45 46 Result result = getInitializedResult(); 47 String ejbName = descriptor.getName(); 48 ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor(); 49 50 if (!(NameToken.isNMTOKEN(ejbName))) { 52 addErrorDetails(result, compName); 54 result.failed 55 (smh.getLocalString 56 (getClass().getName() + ".failed", 57 "Error: [ {0} ] does not conform to the lexical rules of NMTOKEN within bean [ {1} ]", 58 new Object [] {ejbName, descriptor.getName()})); 59 } else { 60 addGoodDetails(result, compName); 61 result.passed 62 (smh.getLocalString 63 (getClass().getName() + ".passed", 64 "[ {0} ] conforms to the lexical rules of NMTOKEN within bean [ {1} ]", 65 new Object [] {ejbName, descriptor.getName()})); 66 } 67 return result; 68 } 69 70 } 71 | Popular Tags |