Skip to main content
summaryrefslogtreecommitdiffstats
blob: 10c4adf1b4a3a36732f994051168ed5f7bc6c77d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2001, 2005 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.j2ee.model.internal.validation;


import java.util.HashMap;
import java.util.Map;

import org.eclipse.jem.java.JavaClass;
import org.eclipse.jem.java.Method;
import org.eclipse.jst.j2ee.ejb.EnterpriseBean;


/**
 * Validate a BMP key.
 */
public class ValidateBMPKey extends AValidateKeyClass implements IMessagePrefixEjb11Constants {
	private static final String MSSGID = ".eb"; // In messages, to identify which message version belongs to the BMP bean class, this id is used. //$NON-NLS-1$
	private static final String EXT = MSSGID + SPEC; // Extension to be used on non-method, non-field messages

	private static final Object ID = IValidationRuleList.EJB11_BMP_KEYCLASS;
	private static final Object[] DEPENDS_ON = null;
	private static final Map MESSAGE_IDS;

	static {
		MESSAGE_IDS = new HashMap();

		MESSAGE_IDS.put(CHKJ2001, new String[]{CHKJ2001+EXT});

		MESSAGE_IDS.put(CHKJ2019, new String[]{CHKJ2019+EXT});

//Don't use that AValidateEJB method		MESSAGE_IDS.put(CHKJ2412, new String[]{CHKJ2412+EXT});
//Don't use that AValidateEJB method		MESSAGE_IDS.put(CHKJ2413, new String[]{CHKJ2413+EXT});
//Don't use that AValidateEJB method		MESSAGE_IDS.put(CHKJ2414, new String[]{CHKJ2414+EXT});

		MESSAGE_IDS.put(CHKJ2041, new String[]{CHKJ2041}); // special case. Shared by all types.
		MESSAGE_IDS.put(CHKJ2433, new String[]{CHKJ2433});
		MESSAGE_IDS.put(CHKJ2907, new String[]{CHKJ2907});
	}

	public final Map getMessageIds() {
		return MESSAGE_IDS;
	}

	public final Object[] getDependsOn() {
		return DEPENDS_ON;
	}

	public final Object getId() {
		return ID;
	}

	/**
	 * This method actually does the validation.
	 */
	public void primValidate(IEJBValidationContext vc, EnterpriseBean bean, JavaClass clazz, Method ejbMethod) throws InvalidInputException {
		// Can't invoke an abstract method
		//super.primValidate(ejbMethod);

		//Nothing to do.
	}
	
	/**
	 * 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);

		// Nothing to do
	}
}

Back to the top