protected void incrementCreateMethodCount(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method) { if (method == null) { return; } if ((method.listParametersWithoutReturn().length == 0) && (!hasDefaultCreateMethod)) { hasDefaultCreateMethod = true; } else { // add it to the list, for reporting extraneous create methods, for stateless session beans (section 6.8) createMethods.add(method); } }
protected void incrementCreateMethodCount(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method) { if (method == null) { return; } if ((method.listParametersWithoutReturn().length == 0) && (!hasDefaultCreateMethod)) { hasDefaultCreateMethod = true; } else { // add it to the list, for reporting extraneous create methods, for stateless session beans (section 6.8) createMethods.add(method); } }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_EJBACTIVATE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_EJBREMOVE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_EJBSTORE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
/** * Return the method's parameters in a displayable format. e.g., if * the method signature is "public Integer foo(String a, String b, String c)" * then this method returns "String, String, String". */ public static final String getParmsAsString(Method method) { if(method == null) { return ""; //$NON-NLS-1$ } return getParmsAsString(method.listParametersWithoutReturn()); }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_EJBLOAD)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().startsWith(IMethodAndFieldConstants.METHODNAME_CREATE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_FINALIZE)) { if(method.listParametersWithoutReturn().length ==0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().startsWith(IMethodAndFieldConstants.METHODNAME_EJBCREATE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_EJBPASSIVATE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_HASHCODE)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
public boolean isMethodType(EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) { if(method == null) { return false; } if(method.getName().equals(IMethodAndFieldConstants.METHODNAME_UNSETENTITYCONTEXT)) { if(method.listParametersWithoutReturn().length == 0) { return true; } } return false; }
protected void validateConstructor(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method) { if (method == null) { return; } hasAConstructor = true; if (!hasValidConstructor && ValidationRuleUtility.isPublic(method) && (method.listParametersWithoutReturn().length == 0)) { hasValidConstructor = true; } }
/** * Does the method name start with "get", and is the method a zero arg * method, that does not return void? */ protected static boolean isGetter(Method aMethod) { String name = aMethod.getName(); return name != null && name.startsWith(GET) && name.length() > 3 && aMethod.listParametersWithoutReturn().length==0 && !aMethod.isVoid(); }
/** * Does the method name start with "get", and is the method a one arg * method, that is void */ protected static boolean isSetter(Method aMethod) { String name = aMethod.getName(); return name != null && name.startsWith(SET) && name.length() > 3 && aMethod.listParametersWithoutReturn().length == 1 && aMethod.isVoid(); }
/** * Checks to see if @ejbMethod is one of the required methods. */ protected void primValidateExistence(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method ejbMethod) throws InvalidInputException { // Can't invoke an abstract method //super.validateExistence(ejbMethod); if (ejbMethod.isConstructor()) { // These booleans are used in the validateMethodExists() checks. hasAConstructor = true; if (ValidationRuleUtility.isPublic(ejbMethod) && (ejbMethod.listParametersWithoutReturn().length == 0)) { hasDefaultConstructor = true; } } }
public void validateEjbCreateMethod(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method, List[] methodsExtendedLists) throws ValidationCancelledException, InvalidInputException, ValidationException { if((method.listParametersWithoutReturn().length != 0) || (!IMethodAndFieldConstants.METHODNAME_EJBCREATE.equals(method.getName()))) { IMessage message = MessageUtility.getUtility().getMessage(vc, IMessagePrefixEjb20Constants.CHKJ2476, IEJBValidationContext.ERROR, bean, clazz, method, this); vc.addMessage(message); } else { super.validateEjbCreateMethod(vc, bean, clazz, method, methodsExtendedLists); } } /* (non-Javadoc)
public void validateCreateMethod(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method) throws ValidationCancelledException, InvalidInputException, ValidationException { // The create method must be a create() method. if((method.listParametersWithoutReturn().length != 0) || (!IMethodAndFieldConstants.METHODNAME_CREATE.equals(method.getName()))) { IMessage message = MessageUtility.getUtility().getMessage(vc, IMessagePrefixEjb20Constants.CHKJ2476, IEJBValidationContext.ERROR, bean, clazz, method, this); vc.addMessage(message); } else { super.validateCreateMethod(vc, bean, clazz, method); } } }
public final void validateFindByPrimaryKeyMethod(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method method) throws ValidationCancelledException, ValidationException { JavaClass key = ((Entity)bean).getPrimaryKey(); JavaParameter[] parms = method.listParametersWithoutReturn(); if((parms.length != 1) || (!ValidationRuleUtility.isAssignableFrom(key, parms[0].getJavaType()))) { String keyName = (key == null) ? IEJBValidatorConstants.NULL_PRIMARY_KEY : key.getJavaName(); IMessage message = MessageUtility.getUtility().getMessage(vc, IMessagePrefixEjb20Constants.CHKJ2475, IEJBValidationContext.WARNING, bean, clazz, method, new String[]{keyName}, this); vc.addMessage(message); } }